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

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

bug#28156: Emacs quietly munges symlink contents


From: Paul Eggert
Subject: bug#28156: Emacs quietly munges symlink contents
Date: Sun, 20 Aug 2017 10:54:45 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

Eli Zaretskii wrote:

We have quoting for these cases.

Quoting does not work for these cases. If I try to rename a symlink to the literal string '~eggert' on my machine, Emacs will misbehave as described and there is no way to quote the string naming the symlink to fix this.

doesn't Emacs behave here like Unix shell commands do?

They differ in many ways. Two examples. First, the Unix shell command 'ln -s ~/$$ def' expands both the "~" and the "$$", whereas (make-symbolic-link "~/$$" "def") expands only the "~". Second, the Unix shell command "ln -s def" creates a symlink to itself, whereas (make-symbolic-link "def") is an error. Briefly, the Unix shell commands are higher-level than the Emacs primitives.

The main points here are (1) Emacs functions should let users create and manipulate whatever symlinks they want to, and (2) the documentation has long said that symlinks are not expanded.

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

Yes, they will fail unless there is a directory named '~'. That is the intent. If I want to create a symlink to my home directory, I can use expand-file-name on the link target, before calling make-symbolic-link.

this text should be clarified.

Sure, that's easy. Revised patch attached.

Attachment: 0001-Do-not-munge-contents-of-local-symbolic-links.patch
Description: Text Data


reply via email to

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