Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

49 lines (40 sloc) 1.555 kB
;;; config loading functions
(setq ini-directory (concat dotfiles-dir "/ini"))
(setq private-directory "~/.emacs.private")
(defvar ini-loaded ()
"List of files loaded during initialization")
(defvar ini-not-loaded ()
"List of files that failed to load during initialization")
(defun ini-try-load (inifn ext)
"Attempt to load an ini-type elisp file"
(let ((fn (concat ini-directory "/" inifn ext)))
(if (file-readable-p fn)
(progn
(load-file fn)
(setq ini-loaded (cons inifn ini-loaded))))))
(defun ini-load (inifn)
"Load an ini-type elisp file"
(cond ((ini-try-load inifn ".elc"))
((ini-try-load inifn ".el"))
(t (setq ini-not-loaded (cons inifn ini-not-loaded))
(message (concat inifn " not found")))))
(defun edit-ini-file (fn)
"Open the ini file in a buffer for editing"
(interactive "MIni file: ")
(let ((inifile (concat ini-directory "/" fn ".el")))
(if (file-readable-p inifile)
(find-file inifile)
(message "ini for %s not found" inifile))))
(defun load-ini-files ()
"Load all ini-* files"
(let ((files (directory-files ini-directory nil ".*\\.el$")))
(while (not (null files))
(ini-load (substring (car files) 0 -3))
(setq files (cdr files)))))
(defun load-private-files ()
"Load files from ~/.emacs.private"
(let ((files (directory-files private-directory nil ".*\\.el$")))
(while (not (null files))
(load-file (concat private-directory "/" (car files)))
(setq files (cdr files)))))
(provide 'load-ini)
Jump to Line
Something went wrong with that request. Please try again.