我的Emacs配置(.emacs 和 load-files.el) -- 001

GNU Emacs 23.1.1
Copyright (C) 2009 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

;;;
;;; ----------- .emacs -----------------------
;;;

;;; auto load emacs file recursively

(setq my-auto-lisp (list "~/.my_emacs/lisp/common"  "~/.my_emacs/lisp/config"))
(require 'load-files)

;;; End of load my-auto-lisp files
;;; ---------------------------------------------



load-files.el 加载指定列表的文件或者目录
;;;*****************************************************
;;
;;    Author  :  joans
;;    Date    :  2011 Jul 22
;;    File    :  load-files.el
;;
;;; ******************************************************

(defun load-file-or-dir (file-dir)
  "load this file or files in the directory"
  (if (file-exists-p file-dir)
      (if (file-directory-p file-dir)
      (mapc 'load-file-or-dir
        (directory-files file-dir t "^[a-zA-z0-9].*"))
    (safe-load file-dir))))

(defun safe-load (file)
  "only load *.el file"
  (if (and (file-regular-p file)
       (file-readable-p file)
       (equal (file-name-extension file)
          "el"))
      (load file)))


(defun load-files (file-list)
    "load all files or directories of file-list"
    (mapc 'load-file-or-dir file-list))

(defcustom my-auto-lisp nil
  "Auto load lisp files or directories list")

(load-files my-auto-lisp)
(provide 'load-files)


;;; ------------ End of load-files.el --------------------------




你可能感兴趣的:(c,Date,list,File,emacs,lisp)