From e586f57cb0b1a65dacbaca14364766d4f542ebf1 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 30 Jan 2023 12:08:51 -0600 Subject: Correct choose-executable --- lisp/acdw.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/acdw.el b/lisp/acdw.el index 3b178db..46079f6 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -34,9 +34,12 @@ be created." Each of PROGRAMS can be a single string, or a list. If it's a list then its car will be tested with `executable-find', and the entire list returned. This enables passing arguments to a calling function." - (seq-find (lambda (x) - (executable-find (car (ensure-list x)))) - programs)) + (catch 'found + (dolist (prog programs) + (let ((exec (executable-find (car (ensure-list prog)))) + (args (cdr-safe prog))) + (when exec + (throw 'found (if args (cons exec args) exec))))))) (defun file-string (file) "Return the contents of FILE as a string." -- cgit 1.4.1-21-gabe81