all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Anders Lindgren <andlind@gmail.com>
To: Glenn Morris <rgm@gnu.org>
Cc: Andreas Schwab <schwab@suse.de>,
	Keith David Bershatsky <esq@lawlist.com>,
	21104@debbugs.gnu.org
Subject: bug#21104: 25.0.50; relative paths are added to load-path without -nsl (bug#21104)
Date: Tue, 8 Dec 2015 21:03:01 +0100	[thread overview]
Message-ID: <CABr8ebZz08245znybREg+uaptTMe-GFc4SYfjn1abAu6j_-GAg@mail.gmail.com> (raw)
In-Reply-To: <9ttwnsn3v3.fsf@fencepost.gnu.org>


[-- Attachment #1.1: Type: text/plain, Size: 1798 bytes --]

Hi,

On Tue, Dec 8, 2015 at 8:21 PM, Glenn Morris <rgm@gnu.org> wrote:

> I think you've jumped outside the scope of this report.
> I would suggest just going with the simple solution, absent evidence of
> some other problem.
>

I have attached a simple solution that solves this specific problem. I'll
push it if it looks like an OK solution for you.


> Also, I haven't investigated the cases where there is nothing between path
> > separators, as in "foo::bar" (or when the string starts or ends with a
> > separator). Today, it looks like it returns either `("foo" "." "bar)' or
> > `("foo" nil "bar")' -- although I haven't verified this. A better
> solution
> > would be to simply return `("foo" "bar")' -- path separators without
> > anything in between are often simply a user mistake, we don't want to
> > pollute system variables like `load-path' because of them.
>
> The feature is intentional, see 17e0445be4a.
>
> I won't claim it's perfect, but IIRC I did test such things at the time.
>

Apparently, there is more to the code than I initially understood. I agree
with you, I no longer think we should change anything here on the short
term.

However, I think it behaves strange:

For example (on a Linux machine):
    env EMACSPATH=::/home::/bar:: emacs -q --batch --eval '(print
exec-path)'
   ("/usr/lib/lightdm/lightdm" "/usr/local/sbin" "/usr/local/bin"
"/use/sbin" "/usr/bin" "/sbin" "/bin" "/usr/games" "." "." "/home" "." "."
"/bar" "." ".")

Here, I don't think the ".":s should be included.

Another example (again on Linux):
    env EMACSLOADPATH=::/home::/bar:: emacs -q --batch --eval '(print
load-path)'
    The result is too long to print, as it duplicates the standard load
path five times.

Here, wouldn't it suffice to add the default load path once?

    -- Anders

[-- Attachment #1.2: Type: text/html, Size: 3380 bytes --]

[-- Attachment #2: path.diff --]
[-- Type: text/plain, Size: 849 bytes --]

diff --git a/src/lread.c b/src/lread.c
index 0da5819..74a5fdf 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -4353,7 +4353,7 @@ init_lread (void)
           load_path_check (default_lpath);
 
           /* Add the site-lisp directories to the front of the default.  */
-          if (!no_site_lisp)
+          if (!no_site_lisp && PATH_SITELOADSEARCH[0] != '\0')
             {
               Lisp_Object sitelisp;
               sitelisp = decode_env_path (0, PATH_SITELOADSEARCH, 0);
@@ -4384,7 +4384,7 @@ init_lread (void)
       load_path_check (Vload_path);
 
       /* Add the site-lisp directories at the front.  */
-      if (initialized && !no_site_lisp)
+      if (initialized && !no_site_lisp && PATH_SITELOADSEARCH[0] != '\0')
         {
           Lisp_Object sitelisp;
           sitelisp = decode_env_path (0, PATH_SITELOADSEARCH, 0);

  reply	other threads:[~2015-12-08 20:03 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-21 17:26 bug#21104: 25.0.50; relative paths are added to load-path without -nsl Sam Steingold
2015-07-21 17:41 ` bug#21104: workaround for the bug Sam Steingold
2015-07-22 18:02 ` bug#21104: 25.0.50; relative paths are added to load-path without -nsl Glenn Morris
2015-07-22 18:26   ` Sam Steingold
2015-07-22 18:37     ` Glenn Morris
2015-07-22 19:41       ` Sam Steingold
2015-07-22 21:58         ` Glenn Morris
2015-12-07 19:00 ` bug#21104: 25.0.50; relative paths are added to load-path without -nsl (bug#21104) Anders Lindgren
2015-12-07 19:33   ` Eli Zaretskii
2015-12-07 22:09     ` Anders Lindgren
2015-12-08  1:22       ` Glenn Morris
2015-12-08  1:32         ` Glenn Morris
2015-12-08 16:05         ` Eli Zaretskii
2015-12-08 17:06           ` Andreas Schwab
2015-12-08 17:40             ` Eli Zaretskii
2015-12-08 18:16               ` Andreas Schwab
2015-12-08 17:54           ` Glenn Morris
2015-12-08 18:20             ` Eli Zaretskii
2015-12-08 19:16               ` Anders Lindgren
2015-12-08 19:21                 ` Glenn Morris
2015-12-08 20:03                   ` Anders Lindgren [this message]
2015-12-09  8:49                     ` Andreas Schwab
2015-12-08 20:05                   ` Eli Zaretskii
2015-12-08  3:35       ` Eli Zaretskii
2015-12-09 10:33 ` bug#21104: Don't add "." to load-path -- fixed Anders Lindgren

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

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

  git send-email \
    --in-reply-to=CABr8ebZz08245znybREg+uaptTMe-GFc4SYfjn1abAu6j_-GAg@mail.gmail.com \
    --to=andlind@gmail.com \
    --cc=21104@debbugs.gnu.org \
    --cc=esq@lawlist.com \
    --cc=rgm@gnu.org \
    --cc=schwab@suse.de \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.