Browse Source

emacs.el: add function prepare-init-el

pull/1/head
10sr 10 years ago
parent
commit
67b7ed6c50
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      emacs.el

+ 15
- 0
emacs.el View File

@@ -20,6 +20,21 @@
(require 'cl nil t)) (require 'cl nil t))




;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; prepare init.el

(defun prepare-init-el (elfile)
"Prepare ~/.emacs/init.el to load ELFILE."
(interactive "fFilename to set to be loaded: ")
(with-temp-buffer
(insert (format "(and (file-readable-p \"%s\")
(load-file \"%s\"))"
elfile
elfile))
(write-file (expand-file-name (concat user-emacs-directory
"init.el")))))


;; (add-hook 'after-change-major-mode-hook ;; (add-hook 'after-change-major-mode-hook
;; (lambda () ;; (lambda ()
;; (message "cmm: %S %s" ;; (message "cmm: %S %s"


Loading…
Cancel
Save