commit cab4697d79e9f6af82bcaa9e182eb28aba8b36f0
parent f48fbcbbdaa694bdba1857483c293494b65ff879
Author: Crazazy <crazazy@tilde.cafe>
Date: Fri, 1 Dec 2023 18:11:39 +0100
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))))