summary refs log tree commit diff stats
path: root/lisp/acdw.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/acdw.el')
-rw-r--r--lisp/acdw.el13
1 files changed, 10 insertions, 3 deletions
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
114 (funcall function) 114 (funcall function)
115 (add-hook 'after-init-hook function))) 115 (add-hook 'after-init-hook function)))
116 116
117(defmacro +with-ensure-after-init (&rest body)
118 "Ensure BODY forms run after init.
119Convenience macro wrapper around `+ensure-after-init'."
120 (declare (indent 0) (debug (def-body)))
121 `(+ensure-after-init (lambda () ,@body)))
122
117(defun +remember-prefix-arg (p-arg P-arg) 123(defun +remember-prefix-arg (p-arg P-arg)
118 "Display prefix ARG, in \"p\" and \"P\" `interactive' types. 124 "Display prefix ARG, in \"p\" and \"P\" `interactive' types.
119I keep forgetting how they differ." 125I keep forgetting how they differ."
120 (interactive "p\nP") 126 (interactive "p\nP")
121 (message "p: %S P: %S" p-arg P-arg)) 127 (message "p: %S P: %S" p-arg P-arg))
122 128
123(defmacro +defvar (var value &optional _) 129(defmacro +defvar (var value &rest _)
124 "Quick way to `setq' a variable from a `defvar' form." 130 "Quick way to `setq' a variable from a `defvar' form."
125 (declare (doc-string 3)) 131 (declare (doc-string 3))
126 `(setq ,var ,value)) 132 `(setq ,var ,value))
@@ -133,7 +139,7 @@ If body executes without errors, MESSAGE...Done will be displayed."
133 `(let ((,msg ,message)) 139 `(let ((,msg ,message))
134 (unwind-protect (progn (message "%s..." ,msg) 140 (unwind-protect (progn (message "%s..." ,msg)
135 ,@body) 141 ,@body)
136 (message "%s... Done." ,msg))))) 142 (message "%s...done" ,msg)))))
137 143
138(defun +mapc-some-buffers (func &optional predicate) 144(defun +mapc-some-buffers (func &optional predicate)
139 "Perform FUNC on all buffers satisfied by PREDICATE. 145 "Perform FUNC on all buffers satisfied by PREDICATE.
@@ -171,7 +177,8 @@ active, or else the entire buffer."
171 (replace-match "\n\n")) 177 (replace-match "\n\n"))
172 ;; Insert a newline at the end. 178 ;; Insert a newline at the end.
173 (goto-char (point-max)) 179 (goto-char (point-max))
174 (unless (= (line-beginning-position) (line-end-position)) 180 (unless (or (buffer-narrowed-p)
181 (= (line-beginning-position) (line-end-position)))
175 (insert "\n"))))) 182 (insert "\n")))))
176 183
177(defun +open-paragraph () 184(defun +open-paragraph ()