【发布时间】:2011-05-26 11:47:57
【问题描述】:
我在 Ubuntu 10.10 上有 GNU Emacs 23.1.1。
我必须关注 .emacs:
(custom-set-variables
'(cua-mode t nil (cua-base))
'(inhibit-startup-screen t)
)
(show-paren-mode 1)
(setq show-paren-delay 0)
;; perl mode stuff
(fset 'perl-mode 'cperl-mode)
(setq cperl-indent-level 4
cperl-close-paren-offset -4
cperl-continued-statement-offset 0
cperl-indent-parens-as-block t
cperl-tab-always-indent t
cperl-invalid-face nil
)
当我执行$ emacs -nw 时,制表符缩进效果很好。当我使用 $ emacs 启动 GUI 版本时,标签缩进不起作用。我只得到空格缩进。
如何在 GUI 中也获得制表符缩进?
cperl conf 取自 emacswiki
我拥有的 emacs 包:
$ dpkg -l | grep emacs
ii emacs 23.1+1-4ubuntu7.2+maverick1 The GNU Emacs editor (metapackage)
ii emacs-goodies-el 33.6ubuntu1 Miscellaneous add-ons for Emacs
ii emacs-snapshot 1:20090909-1 The GNU Emacs editor (development snapshot)
ii emacs-snapshot-bin-common 1:20090909-1 The GNU Emacs editor's shared, architecture dependent files
ii emacs-snapshot-common 1:20090909-1 The GNU Emacs editor's common infrastructure
ii emacs23 23.1+1-4ubuntu7.2+maverick1 The GNU Emacs editor (with GTK+ user interface)
ii emacs23-bin-common 23.1+1-4ubuntu7.2+maverick1 The GNU Emacs editor's shared, architecture dependent files
ii emacs23-common 23.1+1-4ubuntu7.2+maverick1 The GNU Emacs editor's shared, architecture independent infrastructure
ii emacsen-common 1.4.19ubuntu1 Common facilities for all emacsen
编辑:抱歉,我只是注意到我没有正确研究这种行为。在 gui 和 -nw 中,当我编辑一个已在制表符中缩进的文件时,它使用制表符,而当我编辑一个新文件时,它用空格缩进。
【问题讨论】:
-
C-h w <TAB>的结果是什么? -
@kindahero:在 GUI 中对吗?结果是“命令在哪里”的提示和可能的命令列表(我猜是由于
) -
对不起,那应该是
C-h k <TAB>(C-h k 告诉你“命令”通过按键运行) -
@kindahero 嗯,好像有什么东西。在 GUI 中
indent-for-tab-command在 -nwforward-button中。虽然看到我的编辑我犯了一个错误。
标签: emacs indentation emacs23 cperl-mode