about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-04-26 15:26:32 -0500
committerCase Duckworth2021-04-26 15:26:32 -0500
commit476f696af8921c4906525b46f4cc2928462313a2 (patch)
tree92217b5b8c6c673fd3fd80290af359c662e4a0d0
parentEnhance `refresh-emacs' (diff)
downloademacs-476f696af8921c4906525b46f4cc2928462313a2.tar.gz
emacs-476f696af8921c4906525b46f4cc2928462313a2.zip
Add `acdw/insert-iso-date'
Like `crux-insert-date', but I use ISO 8601.
-rw-r--r--init.el3
-rw-r--r--lisp/acdw.el6
2 files changed, 8 insertions, 1 deletions
diff --git a/init.el b/init.el index c65a3ea..3ff41b4 100644 --- a/init.el +++ b/init.el
@@ -254,7 +254,8 @@
254 "C-c i" acdw/find-emacs-dotfiles 254 "C-c i" acdw/find-emacs-dotfiles
255 "C-x k" acdw/kill-a-buffer) 255 "C-x k" acdw/kill-a-buffer)
256 256
257 (:leader "C-c" save-buffers-kill-emacs) 257 (:leader "C-c" save-buffers-kill-emacs
258 "t" acdw/insert-iso-date)
258 259
259 ;;; Advice 260 ;;; Advice
260 ;; `acdw/kill-line-and-join-advice' cribs from `crux-kill-and-join-forward'. 261 ;; `acdw/kill-line-and-join-advice' cribs from `crux-kill-and-join-forward'.
diff --git a/lisp/acdw.el b/lisp/acdw.el index 9426117..96b69f9 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el
@@ -169,6 +169,12 @@ Prompt only if there are unsaved changes."
169 (16 (mapc 'kill-buffer (delq (current-buffer) (buffer-list))) 169 (16 (mapc 'kill-buffer (delq (current-buffer) (buffer-list)))
170 (delete-other-windows)))) 170 (delete-other-windows))))
171 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
172 178
173;; Make `C-z' more useful 179;; Make `C-z' more useful
174(defvar acdw/leader 180(defvar acdw/leader