Emacs Prelude - 电动压痕

时间:2013-12-08 13:20:32

标签: emacs emacs-prelude

我试图让电动缩进工作在前奏中。

在.emacs.d / personal / personal.el文件中,我添加了以下内容

;;; package --- Summary
;;; adding indent for python and binding for python-django
;;; Code:
(electric-indent-mode +1)
;;; Commentary:

;;; package --- Summary
;;; adding indent for python and binding for python-django
;;; Code:
(global-set-key (kbd "C-x j") 'python-django-open-project)
;;; Commentary:

(provide 'personal)\n
;;; personal.el ends here
当我从bbatsov的网站上获得它时,电气应该有效。electric-indent

我注意到,即使ctrl-j也无法缩进。我该如何解决这个问题?

来自personal.el的编辑错误

Debugger entered--Lisp error: (void-variable n)
  eval-buffer(#<buffer  *load*-827116> nil "/home/sayth/.emacs.d/personal/personal.el" nil t)  ; Reading at buffer position 327
  load-with-code-conversion("/home/sayth/.emacs.d/personal/personal.el" "/home/sayth/.emacs.d/personal/personal.el" nil nil)
  load("/home/sayth/.emacs.d/personal/personal.el")
  mapc(load ("/home/sayth/.emacs.d/personal/personal.el"))
  (progn (message "Loading personal configuration files in %s..." prelude-personal-dir) (mapc (quote load) (directory-files prelude-personal-dir (quote t) "^[^#].*el$")))
  (if (file-exists-p prelude-personal-dir) (progn (message "Loading personal configuration files in %s..." prelude-personal-dir) (mapc (quote load) (directory-files prelude-personal-dir (quote t) "^[^#].*el$"))))
  eval-buffer(#<buffer  *load*> nil "/home/sayth/.emacs.d/init.el" nil t)  ; Reading at buffer position 4738
  load-with-code-conversion("/home/sayth/.emacs.d/init.el" "/home/sayth/.emacs.d/init.el" t t)
  load("/home/sayth/.emacs.d/init" t t)   #[0 "\205\262

1 个答案:

答案 0 :(得分:1)

当我在Emacs 24.3.50中测试时,

electric-indent-mode似乎工作正常。您应该记住,它将 C-j 重新映射到electric-indent-just-newline。它只是插入一个换行符,没有任何自动缩进。

这很有意义,因为 RET 在启用模式时会自动缩进。我似乎记得它在旧版本的Emacs中有问题,所以如果你想使用它,我建议你看一下emacs-snapshot