summary refs log tree commit diff stats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/acdw.el39
1 files changed, 26 insertions, 13 deletions
diff --git a/lisp/acdw.el b/lisp/acdw.el index f1c1a8d..96b69f9 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -57,19 +57,26 @@ each hook in HOOKS."
57(defun refresh-emacs () 57(defun refresh-emacs ()
58 "Reload Emacs's configuration files." 58 "Reload Emacs's configuration files."
59 (interactive) 59 (interactive)
60 (dolist (file (append 60 (let ((init-files (append
61 ;; Load lisp libraries first, in case their functionality is 61 ;; Load lisp libraries first, in case their functionality
62 ;; used by {early-,}init.el 62 ;; is used by {early-,}init.el
63 (let* ((dir (expand-file-name "lisp/" user-emacs-directory)) 63 (let* ((dir (expand-file-name "lisp/"
64 (full-name (lambda (f) 64 user-emacs-directory))
65 (concat (file-name-as-directory dir) f)))) 65 (full-name (lambda (f)
66 (mapcar full-name (directory-files dir nil "\\.el\\'"))) 66 (concat
67 ;; Load regular init files 67 (file-name-as-directory dir) f))))
68 (list (locate-user-emacs-file "early-init.el") 68 (mapcar full-name (directory-files dir nil "\\.el\\'")))
69 (locate-user-emacs-file "init.el" ".emacs")))) 69 ;; Load regular init files
70 (with-message (format "Loading %s" file) 70 (list (locate-user-emacs-file "early-init.el")
71 (when (file-exists-p file) 71 (locate-user-emacs-file "init.el" ".emacs"))))
72 (load-file file))))) 72 (debug-on-error t))
73 (with-message "Saving init files"
74 (save-some-buffers :no-confirm (lambda () (member (buffer-file-name)
75 init-files))))
76 (dolist (file init-files)
77 (with-message (format "Loading %s" file)
78 (when (file-exists-p file)
79 (load-file file))))))
73 80
74(defun expand-file-name-exists-p (&rest expand-file-name-args) 81(defun expand-file-name-exists-p (&rest expand-file-name-args)
75 "Call `expand-file-name' on EXPAND-FILE-NAME-ARGS, returning 82 "Call `expand-file-name' on EXPAND-FILE-NAME-ARGS, returning
@@ -162,6 +169,12 @@ Prompt only if there are unsaved changes."
162 (16 (mapc 'kill-buffer (delq (current-buffer) (buffer-list))) 169 (16 (mapc 'kill-buffer (delq (current-buffer) (buffer-list)))
163 (delete-other-windows)))) 170 (delete-other-windows))))
164 171
172(defun acdw/insert-iso-date (with-time)
173 "Insert the ISO-8601-formatted date, with optional time."
174 (interactive "P")
175 (let ((format (if with-time "%FT%T%z" "%F")))
176 (insert (format-time-string format (current-time)))))
177
165 178
166;; Make `C-z' more useful 179;; Make `C-z' more useful
167(defvar acdw/leader 180(defvar acdw/leader