Skip to content

Instantly share code, notes, and snippets.

@pogin503
Created February 24, 2016 08:34
Show Gist options
  • Save pogin503/784e049b6c63573ba9db to your computer and use it in GitHub Desktop.
Save pogin503/784e049b6c63573ba9db to your computer and use it in GitHub Desktop.
# 確認用
emacs --batch --eval "(progn (message (mapconcat 'identity load-path \"\\n\")) (normal-top-level-add-subdirs-to-load-path) (message (mapconcat 'identity load-path \"\\n\")))"
# 実行
emacs --batch -l util.el --eval "(add-to-load-path \"elpa\")"
;;; util.el --- util.el -*- lexical-binding: t; coding: utf-8 -*-
;;; Commentary:
;; This program is free software
;;; Code:
(defun add-to-load-path (&rest paths)
"Add to load path recursively.
`PATHS' Directorys you want to read recursively."
(let (path)
(dolist (path paths paths)
(let ((default-directory (expand-file-name (concat user-emacs-directory path))))
(add-to-list 'load-path default-directory)
(if (fboundp 'normal-top-level-add-subdirs-to-load-path)
(normal-top-level-add-subdirs-to-load-path))))))
(provide 'util)
;;; util.el ends here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment