emacs标识仅在终端-nw中起作用

问题描述

| 我在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
)
当我执行“ 1”时,制表符缩进可以正常工作。当我使用
$ 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中,当我编辑已经在选项卡中缩进的文件时,它将使用选项卡,而当我编辑新文件时,它将使用空格缩进。     

解决方法

首先,在启动时检查
*Messages*
*Warnings*
缓冲区。那里可能有什么提示。特别是,“ 4”应列出emacs正在加载的所有启动文件;在Ubuntu上,它将包括
/etc/emacs
和your8ѭ中的文件。 如果这样做没有帮助,请尝试在emacs调试器中交互式运行.emacs。用
emacs -nw -q
启动emacs,然后将.emacs加载到缓冲区中。运行M-x edebug-all-forms,然后运行M-x eval-buffer。重复按空格键可逐步浏览文件。 编辑:在两个环境的perl缓冲区中检查ѭ10的值。这用于控制是否缩进制表符或空格。添加“ 11”应强制emacs使用制表符缩进。