commit 60f3268f6997ffa0a3d089dd0b7685182e5cc904
parent f019892c99b5a172ff4af4f340e345e63277b135
Author: Crazazy <crazazy@tilde.cafe>
Date: Mon, 21 Feb 2022 13:41:38 +0100
updated emenu
properly separate the reading and list function in emenu and
all-commands
Diffstat:
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/emacs.org b/emacs.org
@@ -491,10 +491,10 @@ Also, if you just stumbled accross this at random, there is an easy tangle butto
(not (file-executable-p fullpath)))))
(directory-files path nil directory-files-no-dot-files-regexp nil))))
(split-string (getenv "PATH") ":" t)))
- (alias-output (split-string (shell-command-to-string "alias -p | sed -E 's/^alias ([^=]*)=.*$/\1/'") "\n")))
- (ido-completing-read "Command: " (append ls-output alias-output))))
+ (alias-output (split-string (shell-command-to-string "alias -p | sed -E 's/^alias ([^=]*)=.*$/\\1/'") "\n")))
+ (append ls-output alias-output)))
- (defun emenu ()
+ (defun emenu (&optional command-list)
"A dmenu-inspired application launcher using a separate emacs frame"
(interactive)
(with-selected-frame (make-frame '((name . "emenu")
@@ -503,7 +503,12 @@ Also, if you just stumbled accross this at random, there is an easy tangle butto
(height . 1)))
(unwind-protect
(progn
- (call-process (all-commands) nil 0)
+ (call-process
+ (ido-completing-read "Command: " (or
+ command-list
+ (all-commands)))
+ nil
+ 0)
(keyboard-quit))
(delete-frame))))
#+end_src