From 1394b10658f5059aeb5fa45a2985f4cac97f833d Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 17 Jan 2022 13:45:32 -0600 Subject: So! Many! Changes!! --- lisp/acdw.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lisp/acdw.el') diff --git a/lisp/acdw.el b/lisp/acdw.el index 7cad67c..17741ab 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -114,13 +114,19 @@ If Emacs is already started, run FUNCTION. Otherwise, add it to (funcall function) (add-hook 'after-init-hook function))) +(defmacro +with-ensure-after-init (&rest body) + "Ensure BODY forms run after init. +Convenience macro wrapper around `+ensure-after-init'." + (declare (indent 0) (debug (def-body))) + `(+ensure-after-init (lambda () ,@body))) + (defun +remember-prefix-arg (p-arg P-arg) "Display prefix ARG, in \"p\" and \"P\" `interactive' types. I keep forgetting how they differ." (interactive "p\nP") (message "p: %S P: %S" p-arg P-arg)) -(defmacro +defvar (var value &optional _) +(defmacro +defvar (var value &rest _) "Quick way to `setq' a variable from a `defvar' form." (declare (doc-string 3)) `(setq ,var ,value)) @@ -133,7 +139,7 @@ If body executes without errors, MESSAGE...Done will be displayed." `(let ((,msg ,message)) (unwind-protect (progn (message "%s..." ,msg) ,@body) - (message "%s... Done." ,msg))))) + (message "%s...done" ,msg))))) (defun +mapc-some-buffers (func &optional predicate) "Perform FUNC on all buffers satisfied by PREDICATE. @@ -171,7 +177,8 @@ active, or else the entire buffer." (replace-match "\n\n")) ;; Insert a newline at the end. (goto-char (point-max)) - (unless (= (line-beginning-position) (line-end-position)) + (unless (or (buffer-narrowed-p) + (= (line-beginning-position) (line-end-position))) (insert "\n"))))) (defun +open-paragraph () -- cgit 1.4.1-21-gabe81