From: Philipp Stephani <p.stephani2@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>, Paul Eggert <eggert@cs.ucla.edu>
Cc: michael.albinus@gmx.de, 28156@debbugs.gnu.org
Subject: bug#28156: Emacs quietly munges symlink contents
Date: Sun, 20 Aug 2017 15:09:01 +0000 [thread overview]
Message-ID: <CAArVCkStL43w7AorvAk_=6b=vWRqA=pb89qAo8nuyNfSFJbhYA@mail.gmail.com> (raw)
In-Reply-To: <83pobqcnlf.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2128 bytes --]
Eli Zaretskii <eliz@gnu.org> schrieb am So., 20. Aug. 2017 um 16:38 Uhr:
> > From: Paul Eggert <eggert@cs.ucla.edu>
> > Date: Sun, 20 Aug 2017 03:28:04 -0700
> > Cc: Michael Albinus <michael.albinus@gmx.de>
> >
> > The attached patch fixes some Emacs behavior that disagrees with the
> > documentation. Although the user manual says that make-symbolic-link
> "does
> > not expand the argument TARGET", Emacs expands leading "~" in the
> target. Also,
> > file-symlink-p quietly munges symlink contents if they appear to be a
> Tramp file
> > name. This behavior makes it impossible to write Emacs code that deals
> with
> > arbitrary local symbolic links, and Emacs mishandles copying of some
> symlinks
> > for this reason. At the operating system level, symlink targets are
> merely
> > strings, and are not file names that are interpreted (any interpretation
> occurs
> > later, only when the symlinks are followed), and Emacs should be
> consistent with
> > that.
>
> Sorry, I'm probably missing something here, but doesn't Emacs behave
> here like Unix shell commands do? For example, I just did
>
> $ ln -s ~/bin/etags ttt
>
> and the following 'ls' command shows this:
>
> $ ls -l ttt
> lrwxrwxrwx 1 eliz eliz 22 Aug 20 10:27 ttt -> /home/e/eliz/bin/etags*
>
> AFAIU, this means the shell expanded "~" when it passed it to 'ln'.
> And Emacs tries to behave like the shell does in this case (and in
> other similar cases). Why is that wrong?
>
It makes it impossible to use '~' as a directory name. Higher-level
interactive interfaces such as Shell and Dired can live with such a
restriction, but library APIs need to be able to work with arbitrary inputs.
>
> Moreover, unless I again misunderstand something important, if
> make-symbolic-link would create a link like this:
>
> ttt -> ~/bin/etags
>
> (which is what your proposed change does, right?), then programs which
> follow the link will probably fail, because AFAIK most programs don't
> expand "~" (with the notable exception of the shell).
>
> What am I missing here?
Callers of `make-symbolic-link' will need to expand the target themselves.
[-- Attachment #2: Type: text/html, Size: 2909 bytes --]
next prev parent reply other threads:[~2017-08-20 15:09 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-20 10:28 bug#28156: Emacs quietly munges symlink contents Paul Eggert
2017-08-20 13:48 ` Michael Albinus
2017-08-20 14:37 ` Eli Zaretskii
2017-08-20 15:09 ` Philipp Stephani [this message]
2017-08-20 15:38 ` Eli Zaretskii
2017-08-20 17:54 ` Paul Eggert
2017-08-20 18:28 ` Michael Albinus
2017-08-20 18:53 ` Paul Eggert
2017-08-20 19:15 ` Michael Albinus
2017-08-20 21:47 ` Paul Eggert
2017-08-21 7:36 ` Michael Albinus
2017-08-20 19:21 ` Eli Zaretskii
2017-08-20 21:31 ` Paul Eggert
2017-08-21 2:34 ` Eli Zaretskii
2017-08-21 8:34 ` Paul Eggert
2017-08-21 14:25 ` Eli Zaretskii
2017-08-21 15:58 ` Paul Eggert
2017-08-20 19:16 ` Eli Zaretskii
2017-08-21 17:34 ` Paul Eggert
2017-08-21 17:59 ` Eli Zaretskii
2017-08-21 20:30 ` Paul Eggert
2017-08-22 7:28 ` Michael Albinus
2017-08-22 16:03 ` Paul Eggert
2017-08-24 11:38 ` Michael Albinus
2017-08-25 5:12 ` Paul Eggert
2017-08-25 12:45 ` Michael Albinus
2017-08-26 13:16 ` Michael Albinus
2017-08-27 1:53 ` Paul Eggert
2017-08-20 22:19 ` npostavs
2017-08-20 23:00 ` Paul Eggert
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='CAArVCkStL43w7AorvAk_=6b=vWRqA=pb89qAo8nuyNfSFJbhYA@mail.gmail.com' \
--to=p.stephani2@gmail.com \
--cc=28156@debbugs.gnu.org \
--cc=eggert@cs.ucla.edu \
--cc=eliz@gnu.org \
--cc=michael.albinus@gmx.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).