2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

(normal-top-level-add-subdirs-to-load-path)を使うときはdefault-directoryをletで束縛しておく必要がある

Last updated at Posted at 2012-12-26

(normal-top-level-add-subdirs-to-load-path)を使うときはdefault-directoryをletで束縛しておく必要があります。

~/.emacs.d/init.el
(let (major name path)
  (setq major (number-to-string emacs-major-version))
  (setq name (concat "emacs" major))
  (setq path (concat "~/share/" name))
  (setq my-user-lisp-dir
    (expand-file-name (concat path "/user-lisp")))
  (if (file-directory-p my-user-lisp-dir)
    (progn
        (add-to-list 'load-path my-user-lisp-dir)
        (let ((default-directory my-user-lisp-dir))
          (normal-top-level-add-subdirs-to-load-path)))))

そうしないと何が起こるか、答えは「いまいるディレクトリ配下のすべてをload-pathに追加しようとする」です。

~/.emacs.d/init.elに書いてしまったらたぶん、Emacsが始まらなくなります。

2
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?