【问题标题】:Emacs Prelude - Electric indentationEmacs Prelude - 电动压痕
【发布时间】:2013-12-08 13:20:32
【问题描述】:

我正在尝试让电子压痕在前奏中工作。

在 .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

electric 应该可以工作,因为我从 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

【问题讨论】:

    标签: emacs emacs-prelude


    【解决方案1】:

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

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

    【讨论】:

    • 我有 emacs 24.3.1 运行,ctrl-j 和原版 emacs 中的电动工作,我只是在 preude 中得到错误。我已经用personal.el 更新了帖子,但现在我收到了这个错误。在帖子中编辑
    • (provide 'personal)\n中删除\n
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-23
    • 1970-01-01
    相关资源
    最近更新 更多