bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20330: Do not capture build-time $PATH in 'emacs' binary


From: Glenn Morris
Subject: bug#20330: Do not capture build-time $PATH in 'emacs' binary
Date: Thu, 16 Apr 2015 15:25:10 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Eli Zaretskii wrote:

> That'd need to be platform-dependent.

No, it wouldn't. I'm only concerned with providing a syntactically valid
value, rather than nil. It doesn't actually do anything.

But, it has long bugged me that exec-path always shows up in
customize-rogue output. The following patch takes care of that, and
means I have no problem with setting exec-path to nil in loadup, since
it really does become about nothing more than keeping the build-time
value out of the binary.

(The callproc part is because I noticed that running uninstalled puts the
eventual installation directory's libexec into exec-path, which is wrong.)


--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -169,7 +169,12 @@ Leaving \"Default\" unchecked is equivalent with 
specifying a default of
             (shell-file-name execute file)
             (exec-path execute
                        (repeat (choice (const :tag "default directory" nil)
-                                       (directory :format "%v"))))
+                                       (directory :format "%v")))
+                        nil
+                        :standard
+                        (mapcar 'directory-file-name
+                                (append (parse-colon-path (getenv "PATH"))
+                                        (list exec-directory))))
             (exec-suffixes execute (repeat string))
             ;; charset.c
             (charset-map-path installation
diff --git a/src/callproc.c b/src/callproc.c
index e1fe8ed..8c1f910 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -1595,12 +1595,12 @@ init_callproc (void)
 #ifdef HAVE_NS
          const char *path_exec = ns_exec_path ();
 #endif
+          /* Running uninstalled, so default to tem rather than PATH_EXEC.  */
          Vexec_path = decode_env_path ("EMACSPATH",
 #ifdef HAVE_NS
                                        path_exec ? path_exec :
 #endif
-                                       PATH_EXEC, 0);
-         Vexec_path = Fcons (tem, Vexec_path);
+                                       SSDATA (tem), 0);
          Vexec_path = nconc2 (decode_env_path ("PATH", "", 0), Vexec_path);
        }
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]