设置使用eval-after-load和使用模式挂钩的模式之间有区别吗?
我已经看到一些代码在define-key主模式钩子中使用,而其他一些代码define-key在eval-after-load形式中使用.
更新:
为了更好地理解,下面是使用带有org-mode的eval-after-load和mode钩子的示例.该代码可以运行之前 (load "org")或(require 'org)或(package-initialize).
;; The following two lines of code set some org-mode options.
;; Usually, these can be outside (eval-after-load ...) and work.
;; In cases that doesn't work, try using setq-default or set-variable
;; and putting them in (eval-after-load ...), if the
;; doc for the variables don't say what to do.
;; Or use Customize interface.
(setq org-hide-leading-stars t) …Run Code Online (Sandbox Code Playgroud)