commit e9b379838e442b4a9e867d020a394a6c798b83f2
parent a714b699bb38cb4a6c18b4327571a397889a8891
Author: Erik Oosting <crazazy@tilde.cafe>
Date: Sun, 15 Oct 2023 14:40:44 +0200
modularized emenu a bit better
Diffstat:
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/emenu.el b/emenu.el
@@ -1,6 +1,6 @@
;;; emenu.el --- An emacs dmenu clone -*- lexical-binding: t; -*-
-;; Copyright © 2022 Erik Oosting
+;; Copyright © 2023 Erik Oosting
;; Author: Erik Oosting <crazazy@tilde.cafe>
;; Keywords: application-launcher, misc
@@ -39,21 +39,20 @@
(append ls-output alias-output)))
;;;###autoload
-(defun emenu (&optional command-list)
+(defun emenu (action &optional command-list)
"A dmenu-inspired application launcher using a separate emacs frame"
- (interactive)
+ (interactive (list (lambda (command) (call-process command nil 0))))
(with-selected-frame (make-frame '((name . "emenu")
(minibuffer . only)
(width . 151)
(height . 1)))
(unwind-protect
(progn
- (call-process
- (ido-completing-read "Command: " (or
- command-list
- (emenu--all-commands)))
- nil
- 0)
+ (funcall action
+ (ido-completing-read
+ "Command: " (or
+ command-list
+ (emenu--all-commands))))
(keyboard-quit))
(delete-frame))))