From cab4697d79e9f6af82bcaa9e182eb28aba8b36f0 Mon Sep 17 00:00:00 2001 From: Crazazy Date: Fri, 1 Dec 2023 18:11:39 +0100 Subject: modularized emenu a bit better --- emenu.el | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/emenu.el b/emenu.el index 9d464e4..8d8b92a 100644 --- 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 ;; 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)))) -- cgit 1.4.1-2-gfad0