summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2025-03-15 15:44:34 +0200
committerThanos Apollo <[email protected]>2025-03-15 15:44:34 +0200
commitd01ebcdf1af7e1afd861e6f020d0bd2a99ff5a65 (patch)
tree0e1ff612e0517b8a56f2347597675f5d98201219
parentaea72a46ff2be9f930a97b1566ad60ea5478a719 (diff)
emacs: refactor thanos/make-frame.
-rw-r--r--.config/emacs/init.el26
1 files changed, 13 insertions, 13 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el
index d0ba477..a1468c1 100644
--- a/.config/emacs/init.el
+++ b/.config/emacs/init.el
@@ -1387,19 +1387,19 @@ Useful if you write in langs like Greek :)."
(apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts)))))
(defmacro thanos/make-frame (name &rest body)
- "Create temporary frame as NAME.
-
-Create a temporary frame to execute BODY, which will then be deleted."
- `(unwind-protect
- (with-selected-frame
- (make-frame '((name . ,name)
- (fullscreen . 0)
- (undecorated . t)
- (minibuffer . only)
- (width . 70)
- (height . 15)))
- ,@body
- (delete-frame))))
+ "Execute BODY in a temporary frame named NAME.
+Frame is automatically deleted after BODY execution."
+ (declare (indent 1))
+ `(let ((frame (make-frame '((name . ,name)
+ (fullscreen . 0)
+ (undecorated . t)
+ (minibuffer . only)
+ (width . 70)
+ (height . 15)))))
+ (unwind-protect
+ (with-selected-frame frame
+ ,@body)
+ (delete-frame frame))))
(defun create-text-scratch ()
"Create a scratch buffer."