unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: ludo@gnu.org, 20330@debbugs.gnu.org
Subject: bug#20330: Do not capture build-time $PATH in 'emacs' binary
Date: Thu, 16 Apr 2015 15:25:10 -0400	[thread overview]
Message-ID: <qg1tjj510p.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <87twwjexmg.fsf@gnu.org>

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	other threads:[~2015-04-16 19:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-14 11:51 bug#20330: Do not capture build-time $PATH in 'emacs' binary Ludovic Courtès
2015-04-14 14:39 ` Eli Zaretskii
2015-04-14 16:10   ` Ludovic Courtès
2015-04-14 16:38     ` Eli Zaretskii
2015-04-15  7:45       ` Ludovic Courtès
2015-04-15 16:12         ` Eli Zaretskii
2015-04-15 16:37           ` Ludovic Courtès
2015-04-15 16:49             ` Eli Zaretskii
2015-04-15 17:07 ` Glenn Morris
2015-04-15 19:45   ` Ludovic Courtès
2015-04-16 15:37     ` Glenn Morris
2015-04-16 15:49       ` Eli Zaretskii
2015-04-16 19:25         ` Glenn Morris [this message]
2015-04-16 19:33           ` Eli Zaretskii
2015-04-20 21:48           ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=qg1tjj510p.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=20330@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).