branch: elpa/racket-mode
commit ba49efe21b16a2cb110b17265b3b811d9fe2a671
Author: Björn Lindström <b...@elektrubadur.se>
Commit: Greg Hendershott <g...@greghendershott.com>

    Show correct name for error about not finding executable
    
    When failing to find the executable indicated either by `racket-program` or 
the
    backend `:racket-program`, in case of failure the error message would always
    show the value of `racket-program`, even when it was overridden by a backend
    configuration.
---
 racket-back-end.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/racket-back-end.el b/racket-back-end.el
index 7d01069da2..abad379f0c 100644
--- a/racket-back-end.el
+++ b/racket-back-end.el
@@ -454,12 +454,13 @@ a possibly slow remote connection."
 (defun racket--back-end-args->command (back-end racket-command-args)
   "Given RACKET-COMMAND-ARGS, prepend path to racket for BACK-END."
   (if (racket--back-end-local-p back-end)
-      (cons (or (executable-find (or (plist-get back-end :racket-program)
-                                     racket-program))
-                (error
-                 "Cannot executable-find Racket:\n  racket-program: %S\n  
exec-path: %S"
-                 racket-program
-                 exec-path))
+      (cons (let ((racket-program (or (plist-get back-end :racket-program)
+                                      racket-program)))
+              (or (executable-find racket-program)
+                  (error
+                   "Cannot executable-find Racket:\n  racket-program: %S\n  
exec-path: %S"
+                   racket-program
+                   exec-path)))
             racket-command-args)
     (pcase-let ((`(,host ,user ,port ,_name)
                  (racket--file-name->host+user+port+name

Reply via email to