0

我正试图让电动压痕在前奏中工作。

在 .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 的网站得到它。电动压痕

但是我注意到即使 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
4

1 回答 1

1

electric-indent-mode当我在 Emacs 24.3.50 中测试时,似乎工作得很好。您应该记住,它重新映射C-jelectric-indent-just-newline. 它只是插入一个换行符,没有任何自动缩进。

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

于 2013-12-08T18:16:36.283 回答