From 152daf82ef2bdfe8d7a863d4d87fec02cb5a7465 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 21 Apr 2021 17:54:29 -0500 Subject: Add macro `with-message' --- lisp/acdw.el | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lisp') diff --git a/lisp/acdw.el b/lisp/acdw.el index 483bf60..1a699bb 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -70,6 +70,15 @@ each hook in HOOKS." file nil))) +(defmacro with-message (message &rest body) + "Execute BODY, messaging 'MESSAGE...' before and 'MESSAGE... Done.' after." + (declare (indent 1)) + ;; Wrap a progn inside a prog1 to return the return value of the body. + `(prog1 + (progn (message "%s..." ,message) + ,@body) + (message "%s... Done." ,message))) + (defun acdw/dir (&optional file make-directory) "Place Emacs files in one place. -- cgit 1.4.1-21-gabe81