* bug#17073: 24.3.50; file-symlink-p doesn't return t as described in the doc
@ 2014-03-23 19:33 Michael Heerdegen
2014-03-23 23:34 ` Glenn Morris
0 siblings, 1 reply; 18+ messages in thread
From: Michael Heerdegen @ 2014-03-23 19:33 UTC (permalink / raw)
To: 17073
Hello,
the doc of `file-symlink-p' says:
This function returns t when given the name of a symlink that
points to a nonexistent file.
But this is not the case here. Instead, it returns the resolved file
name, which is a nonexisting file.
This is with emacs -Q, and with all Emacs versions I tried, which were
23, 24 that come with Debian testing, and a recent built from trunk.
Tested on Debian testing.
Thanks,
Michael.
In GNU Emacs 24.3.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.7)
of 2014-03-14 on drachen
Windowing system distributor `The X.Org Foundation', version 11.0.11500000
System Description: Debian GNU/Linux testing (jessie)
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#17073: 24.3.50; file-symlink-p doesn't return t as described in the doc
2014-03-23 19:33 bug#17073: 24.3.50; file-symlink-p doesn't return t as described in the doc Michael Heerdegen
@ 2014-03-23 23:34 ` Glenn Morris
2014-03-23 23:39 ` Glenn Morris
0 siblings, 1 reply; 18+ messages in thread
From: Glenn Morris @ 2014-03-23 23:34 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: 17073
Michael Heerdegen wrote:
> the doc of `file-symlink-p' says:
>
> This function returns t when given the name of a symlink that
> points to a nonexistent file.
>
> But this is not the case here. Instead, it returns the resolved file
> name, which is a nonexisting file.
Then I guess it means t in the sense of non-nil.
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#17073: 24.3.50; file-symlink-p doesn't return t as described in the doc
2014-03-23 23:34 ` Glenn Morris
@ 2014-03-23 23:39 ` Glenn Morris
2014-03-24 0:25 ` Juanma Barranquero
0 siblings, 1 reply; 18+ messages in thread
From: Glenn Morris @ 2014-03-23 23:39 UTC (permalink / raw)
To: 17073-done
Version: 24.4
Doc fixed.
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#17073: 24.3.50; file-symlink-p doesn't return t as described in the doc
2014-03-23 23:39 ` Glenn Morris
@ 2014-03-24 0:25 ` Juanma Barranquero
2014-03-24 3:52 ` Eli Zaretskii
0 siblings, 1 reply; 18+ messages in thread
From: Juanma Barranquero @ 2014-03-24 0:25 UTC (permalink / raw)
To: 17073, Glenn Morris, Michael Heerdegen
Perhaps it's me, but I don't find the doc for this function (in the
elisp reference) particularly clear
-- Function: file-symlink-p filename
If the file FILENAME is a symbolic link, the `file-symlink-p'
function returns the (non-recursive) link target as a string.
Here it agrees with your interpretation, so at least that is clear.
(Determining the file name that the link points to from the target
is nontrivial.) First, this function recursively follows symbolic
links at all levels of parent directories.
IIUC, it's saying (above) that it does not follow symbolic links to
files recursively. But (below) that it does follow recursively
symbolic links to directories, until it finds a file (or a symbolic
link to a file). Is that?
J
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#17073: 24.3.50; file-symlink-p doesn't return t as described in the doc
2014-03-24 0:25 ` Juanma Barranquero
@ 2014-03-24 3:52 ` Eli Zaretskii
2014-03-24 4:00 ` Juanma Barranquero
0 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2014-03-24 3:52 UTC (permalink / raw)
To: Juanma Barranquero; +Cc: michael_heerdegen, 17073
> From: Juanma Barranquero <lekktu@gmail.com>
> Date: Mon, 24 Mar 2014 01:25:36 +0100
>
> Perhaps it's me, but I don't find the doc for this function (in the
> elisp reference) particularly clear
>
> -- Function: file-symlink-p filename
> If the file FILENAME is a symbolic link, the `file-symlink-p'
> function returns the (non-recursive) link target as a string.
>
> Here it agrees with your interpretation, so at least that is clear.
>
> (Determining the file name that the link points to from the target
> is nontrivial.) First, this function recursively follows symbolic
> links at all levels of parent directories.
>
> IIUC, it's saying (above) that it does not follow symbolic links to
> files recursively. But (below) that it does follow recursively
> symbolic links to directories, until it finds a file (or a symbolic
> link to a file). Is that?
The difference is between the file (a.k.a. "basename") part of the
file name, and the leading directories part. And yes, it is true.
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#17073: 24.3.50; file-symlink-p doesn't return t as described in the doc
2014-03-24 3:52 ` Eli Zaretskii
@ 2014-03-24 4:00 ` Juanma Barranquero
2014-03-24 4:02 ` Juanma Barranquero
2014-03-24 16:49 ` Eli Zaretskii
0 siblings, 2 replies; 18+ messages in thread
From: Juanma Barranquero @ 2014-03-24 4:00 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Michael Heerdegen, 17073
On Mon, Mar 24, 2014 at 4:52 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> The difference is between the file (a.k.a. "basename") part of the
> file name, and the leading directories part. And yes, it is true.
Well, as I said, I think that docstring could benefit from a little love.
J
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#17073: 24.3.50; file-symlink-p doesn't return t as described in the doc
2014-03-24 4:00 ` Juanma Barranquero
@ 2014-03-24 4:02 ` Juanma Barranquero
2014-03-24 16:49 ` Eli Zaretskii
1 sibling, 0 replies; 18+ messages in thread
From: Juanma Barranquero @ 2014-03-24 4:02 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Michael Heerdegen, 17073
On Mon, Mar 24, 2014 at 5:00 AM, Juanma Barranquero <lekktu@gmail.com> wrote:
> Well, as I said, I think that docstring could benefit from a little love.
s/docstring/manual entry/
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#17073: 24.3.50; file-symlink-p doesn't return t as described in the doc
2014-03-24 4:00 ` Juanma Barranquero
2014-03-24 4:02 ` Juanma Barranquero
@ 2014-03-24 16:49 ` Eli Zaretskii
2014-03-24 17:01 ` Juanma Barranquero
1 sibling, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2014-03-24 16:49 UTC (permalink / raw)
To: Juanma Barranquero; +Cc: michael_heerdegen, 17073
> From: Juanma Barranquero <lekktu@gmail.com>
> Date: Mon, 24 Mar 2014 05:00:34 +0100
> Cc: 17073@debbugs.gnu.org, Glenn Morris <rgm@gnu.org>,
> Michael Heerdegen <michael_heerdegen@web.de>
>
> On Mon, Mar 24, 2014 at 4:52 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>
> > The difference is between the file (a.k.a. "basename") part of the
> > file name, and the leading directories part. And yes, it is true.
>
> Well, as I said, I think that docstring could benefit from a little love.
Not sure which part needs love. Could you perhaps point out the
unclear parts?
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#17073: 24.3.50; file-symlink-p doesn't return t as described in the doc
2014-03-24 16:49 ` Eli Zaretskii
@ 2014-03-24 17:01 ` Juanma Barranquero
2014-03-25 16:10 ` Eli Zaretskii
0 siblings, 1 reply; 18+ messages in thread
From: Juanma Barranquero @ 2014-03-24 17:01 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Michael Heerdegen, 17073
On Mon, Mar 24, 2014 at 5:49 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> Not sure which part needs love. Could you perhaps point out the
> unclear parts?
First, this function recursively follows symbolic
links at all levels of parent directories.
On one hand, though I suppose "First, this function recursively
follows..." means "This function, first of all, recursively
follows...", my instinct is that it is the start of an enumeration, so
I expect a "Second, it ...".
On the other hand, you've explained that this:
If the file FILENAME is a symbolic link, the `file-symlink-p'
function returns the (non-recursive) link target as a string.
talks about the 'file (a.k.a. "basename") part of the file name', and this
First, this function recursively follows symbolic
links at all levels of parent directories.
talks about the 'leading directories part'. Well, I don't find that clear.
J
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#17073: 24.3.50; file-symlink-p doesn't return t as described in the doc
2014-03-24 17:01 ` Juanma Barranquero
@ 2014-03-25 16:10 ` Eli Zaretskii
2014-03-25 16:29 ` Juanma Barranquero
0 siblings, 1 reply; 18+ messages in thread
From: Eli Zaretskii @ 2014-03-25 16:10 UTC (permalink / raw)
To: Juanma Barranquero; +Cc: michael_heerdegen, 17073
> From: Juanma Barranquero <lekktu@gmail.com>
> Date: Mon, 24 Mar 2014 18:01:04 +0100
> Cc: Michael Heerdegen <michael_heerdegen@web.de>, 17073@debbugs.gnu.org
>
> On Mon, Mar 24, 2014 at 5:49 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>
> > Not sure which part needs love. Could you perhaps point out the
> > unclear parts?
>
> First, this function recursively follows symbolic
> links at all levels of parent directories.
>
> On one hand, though I suppose "First, this function recursively
> follows..." means "This function, first of all, recursively
> follows...", my instinct is that it is the start of an enumeration, so
> I expect a "Second, it ...".
>
> On the other hand, you've explained that this:
>
> If the file FILENAME is a symbolic link, the `file-symlink-p'
> function returns the (non-recursive) link target as a string.
>
> talks about the 'file (a.k.a. "basename") part of the file name', and this
>
> First, this function recursively follows symbolic
> links at all levels of parent directories.
>
> talks about the 'leading directories part'. Well, I don't find that clear.
I tried to clarify and improve the documentation in revision 116859 on
the emacs-24 branch, please take a look.
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#17073: 24.3.50; file-symlink-p doesn't return t as described in the doc
2014-03-25 16:10 ` Eli Zaretskii
@ 2014-03-25 16:29 ` Juanma Barranquero
2014-03-25 18:03 ` Eli Zaretskii
0 siblings, 1 reply; 18+ messages in thread
From: Juanma Barranquero @ 2014-03-25 16:29 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Michael Heerdegen, 17073
On Tue, Mar 25, 2014 at 5:10 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> I tried to clarify and improve the documentation in revision 116859 on
> the emacs-24 branch, please take a look.
Superb! Thanks.
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#17073: 24.3.50; file-symlink-p doesn't return t as described in the doc
2014-03-25 16:29 ` Juanma Barranquero
@ 2014-03-25 18:03 ` Eli Zaretskii
2014-03-25 18:04 ` Juanma Barranquero
2014-03-25 18:37 ` Michael Heerdegen
0 siblings, 2 replies; 18+ messages in thread
From: Eli Zaretskii @ 2014-03-25 18:03 UTC (permalink / raw)
To: Juanma Barranquero; +Cc: michael_heerdegen, 17073
> From: Juanma Barranquero <lekktu@gmail.com>
> Date: Tue, 25 Mar 2014 17:29:26 +0100
> Cc: Michael Heerdegen <michael_heerdegen@web.de>, 17073@debbugs.gnu.org
>
> On Tue, Mar 25, 2014 at 5:10 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>
> > I tried to clarify and improve the documentation in revision 116859 on
> > the emacs-24 branch, please take a look.
>
> Superb! Thanks.
Thanks. Can this be closed, then?
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#17073: 24.3.50; file-symlink-p doesn't return t as described in the doc
2014-03-25 18:03 ` Eli Zaretskii
@ 2014-03-25 18:04 ` Juanma Barranquero
2014-03-25 18:37 ` Michael Heerdegen
1 sibling, 0 replies; 18+ messages in thread
From: Juanma Barranquero @ 2014-03-25 18:04 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Michael Heerdegen, 17073-done
Version: 24.3.50
> Can this be closed, then?
Sure. Done.
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#17073: 24.3.50; file-symlink-p doesn't return t as described in the doc
2014-03-25 18:03 ` Eli Zaretskii
2014-03-25 18:04 ` Juanma Barranquero
@ 2014-03-25 18:37 ` Michael Heerdegen
2014-03-25 19:02 ` Eli Zaretskii
1 sibling, 1 reply; 18+ messages in thread
From: Michael Heerdegen @ 2014-03-25 18:37 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Juanma Barranquero, 17073
Eli Zaretskii <eliz@gnu.org> writes:
> Thanks. Can this be closed, then?
The changes in the manual look great, thanks.
Sorry if this is a dumb question, but:
If the leading directories of @var{filename} include symbolic links,
this function recursively follows them.
Is this obvious? If not - doesn't it also belong in the docstring?
Thanks,
Michael.
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#17073: 24.3.50; file-symlink-p doesn't return t as described in the doc
2014-03-25 18:37 ` Michael Heerdegen
@ 2014-03-25 19:02 ` Eli Zaretskii
2014-03-25 19:21 ` Michael Heerdegen
2014-03-26 0:41 ` Stefan Monnier
0 siblings, 2 replies; 18+ messages in thread
From: Eli Zaretskii @ 2014-03-25 19:02 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: lekktu, 17073
> From: Michael Heerdegen <michael_heerdegen@web.de>
> Cc: Juanma Barranquero <lekktu@gmail.com>, 17073@debbugs.gnu.org
> Date: Tue, 25 Mar 2014 19:37:43 +0100
>
> If the leading directories of @var{filename} include symbolic links,
> this function recursively follows them.
>
> Is this obvious?
Hard to say. I think it's pretty obvious to those who are used to
semantics of symlinks (I actually find strange and even confusing the
fact that the manual insists on telling which functions follow links
and in which parts of the filename). For those who are not used to
symlinks, I'm pretty sure even the above sentence does not say enough.
> If not - doesn't it also belong in the docstring?
Well, we don't normally say about each file-related function whether
it does or doesn't follow symlinks. So why this one?
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#17073: 24.3.50; file-symlink-p doesn't return t as described in the doc
2014-03-25 19:02 ` Eli Zaretskii
@ 2014-03-25 19:21 ` Michael Heerdegen
2014-03-26 0:41 ` Stefan Monnier
1 sibling, 0 replies; 18+ messages in thread
From: Michael Heerdegen @ 2014-03-25 19:21 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: lekktu, 17073
Eli Zaretskii <eliz@gnu.org> writes:
> > If the leading directories of @var{filename} include symbolic links,
> > this function recursively follows them.
> >
> > Is this obvious?
>
> Hard to say. I think it's pretty obvious to those who are used to
> semantics of symlinks
I understand it now after thinking about it a bit. Yes, it's quite
obvious.
> > If not - doesn't it also belong in the docstring?
>
> Well, we don't normally say about each file-related function whether
> it does or doesn't follow symlinks. So why this one?
Ok, I agree. So I too think we are ready here.
Thanks,
Michael.
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#17073: 24.3.50; file-symlink-p doesn't return t as described in the doc
2014-03-25 19:02 ` Eli Zaretskii
2014-03-25 19:21 ` Michael Heerdegen
@ 2014-03-26 0:41 ` Stefan Monnier
2014-03-26 3:53 ` Eli Zaretskii
1 sibling, 1 reply; 18+ messages in thread
From: Stefan Monnier @ 2014-03-26 0:41 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Michael Heerdegen, lekktu, 17073
>> If the leading directories of @var{filename} include symbolic links,
>> this function recursively follows them.
>> Is this obvious?
> Hard to say. I think it's pretty obvious to those who are used to
> semantics of symlinks (I actually find strange and even confusing the
> fact that the manual insists on telling which functions follow links
> and in which parts of the filename). For those who are not used to
> symlinks, I'm pretty sure even the above sentence does not say enough.
I think the sentence is more confusing than helpful. To me it makes it
sound like there something special going on, whereas it's just business
as usual. And as you say, for people not used to the semantics of
symlinks it's not helpful either (and putting it in file-symlink-p is
confusing since it gives the impression that symlinks only affect
file-symlink-p).
Stefan
^ permalink raw reply [flat|nested] 18+ messages in thread
* bug#17073: 24.3.50; file-symlink-p doesn't return t as described in the doc
2014-03-26 0:41 ` Stefan Monnier
@ 2014-03-26 3:53 ` Eli Zaretskii
0 siblings, 0 replies; 18+ messages in thread
From: Eli Zaretskii @ 2014-03-26 3:53 UTC (permalink / raw)
To: Stefan Monnier; +Cc: michael_heerdegen, lekktu, 17073
> From: Stefan Monnier <monnier@IRO.UMontreal.CA>
> Cc: Michael Heerdegen <michael_heerdegen@web.de>, lekktu@gmail.com,
> 17073@debbugs.gnu.org
> Date: Tue, 25 Mar 2014 20:41:53 -0400
>
> >> If the leading directories of @var{filename} include symbolic links,
> >> this function recursively follows them.
> >> Is this obvious?
> > Hard to say. I think it's pretty obvious to those who are used to
> > semantics of symlinks (I actually find strange and even confusing the
> > fact that the manual insists on telling which functions follow links
> > and in which parts of the filename). For those who are not used to
> > symlinks, I'm pretty sure even the above sentence does not say enough.
>
> I think the sentence is more confusing than helpful. To me it makes it
> sound like there something special going on, whereas it's just business
> as usual.
But the same is true for all the other places in files.texi which
document what functions follow symlinks and in which part(s) of their
arguments. This one is just one such place, one of many.
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2014-03-26 3:53 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-23 19:33 bug#17073: 24.3.50; file-symlink-p doesn't return t as described in the doc Michael Heerdegen
2014-03-23 23:34 ` Glenn Morris
2014-03-23 23:39 ` Glenn Morris
2014-03-24 0:25 ` Juanma Barranquero
2014-03-24 3:52 ` Eli Zaretskii
2014-03-24 4:00 ` Juanma Barranquero
2014-03-24 4:02 ` Juanma Barranquero
2014-03-24 16:49 ` Eli Zaretskii
2014-03-24 17:01 ` Juanma Barranquero
2014-03-25 16:10 ` Eli Zaretskii
2014-03-25 16:29 ` Juanma Barranquero
2014-03-25 18:03 ` Eli Zaretskii
2014-03-25 18:04 ` Juanma Barranquero
2014-03-25 18:37 ` Michael Heerdegen
2014-03-25 19:02 ` Eli Zaretskii
2014-03-25 19:21 ` Michael Heerdegen
2014-03-26 0:41 ` Stefan Monnier
2014-03-26 3:53 ` Eli Zaretskii
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.