unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Anders Lindgren <andlind@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 21104@debbugs.gnu.org, Keith David Bershatsky <esq@lawlist.com>,
	Andreas Schwab <schwab@suse.de>
Subject: bug#21104: 25.0.50; relative paths are added to load-path without -nsl (bug#21104)
Date: Tue, 8 Dec 2015 20:16:29 +0100	[thread overview]
Message-ID: <CABr8ebZ91EsGM5xMhXRzH0uYYo60uXr6S62wBc+Wb6=v7gS1nQ@mail.gmail.com> (raw)
In-Reply-To: <83wpsoby4s.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1428 bytes --]

Hi!

I tries both solutions. Passing "1" as the last argument to
`decode_env_path' doesn't work. When inspecting the code, it looks like it
runs at least one iteration in the loop (see the `while (1)'), so the
return value is either `(".")' or `(nil)', which is not what we want.

> But like Andreas, my guess would be that "." and nil are equivalent here.
> > Maybe you could just special-case it so that PATH_SITELOADSEARCH empty
> > acts like no_site_lisp is set?
>
> Yes, that would also work.  Anders, can you try that?
>

Yes, this works.


However, I think it's a better solution to correct `decode_env_path' so
that it returns nil when the string is empty and the `empty' parameter is 1.

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.

I would suggest that we rewrite the loop so that it ignores empty parts of
the string (at the start, between two separators, and at the end). After
the loop, if `lpath' is nil and `empty' is 0, add a single "." to `lpath'.

    -- Anders

[-- Attachment #2: Type: text/html, Size: 2268 bytes --]

  reply	other threads:[~2015-12-08 19:16 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 [this message]
2015-12-08 19:21                 ` Glenn Morris
2015-12-08 20:03                   ` Anders Lindgren
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

  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='CABr8ebZ91EsGM5xMhXRzH0uYYo60uXr6S62wBc+Wb6=v7gS1nQ@mail.gmail.com' \
    --to=andlind@gmail.com \
    --cc=21104@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=esq@lawlist.com \
    --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 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).