emacs - 让 .emacs.d 的行为就像 .d 文件夹一样

标签 emacs configuration configuration-files

我想解决我的“.emacs bankruptcy ”问题,我已经经历过

https://help.ubuntu.com/community/EmacsHowto
http://www.emacswiki.org/emacs/DotEmacsBankruptcy
http://www.emacswiki.org/emacs/DotEmacsDotD
http://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html

我仍然不清楚 .emacs.d 文件夹是否是解决方案。即,它是否会像普通的 .d 文件夹一样运行,例如 /etc/profile.d/,您将脚本放在其中,系统会自动神奇地拾取它们。请确认。

如果没有,有人可以给我一个可以做到这一点的脚本,或者给我一个解决方案吗?

谢谢

最佳答案

我的 ~/.emacs 文件的基本内容是:

(require 'cl)

(loop for src in (directory-files "~/.emacs.d" 'full-path "[0-9].*\\.el$") do
      (let ((byte (concat src "c")))
    (when (file-newer-than-file-p src byte)
      (byte-compile-file src))
    (message "Loading %s.elc" byte)
    (load-file byte)))

它从 ~/.emacs.d 加载以数字开头的配置文件。如果源文件(扩展名.el)比字节编译版本(扩展名.elc)新,那么它会对源进行字节编译。然后它加载字节编译文件。

关于emacs - 让 .emacs.d 的行为就像 .d 文件夹一样,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20826544/

相关文章:

installation - 使用 installshield 2011 安装时修改配置文件

svn - 用户的 Subversion 配置文件存储在主要操作系统上的哪里?

django {{ STATIC_URL }} 有时不起作用

emacs - emacs org-mode 中的 ISO 嵌入

shell - Emacs 口齿不清 : is it possible (using lisp) to run command in an eshell working in other buffer?

emacs - 在拆分窗口中同时滚动两个打开的缓冲区

c# - 使 C# 程序集属性详细显示

windows - 如何在Windows下将Qt5构建为静态库

python - 在 python 中读取属性文件的快速方法是什么?

ruby - Emacs + OSX 中的 Bash 找不到通过 terminal.app 安装的 gems?