unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: MON KEY <monkey@sandpframing.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 4819@emacsbugs.donarmstrong.com, bug-gnu-emacs@gnu.org
Subject: bug#4819: file-truename's undocumented behavior
Date: Fri, 6 Nov 2009 19:01:28 -0500	[thread overview]
Message-ID: <d2afcfda0911061601s4c2bac93qf07d263ec737fe6b@mail.gmail.com> (raw)
In-Reply-To: <jwvljivca9q.fsf-monnier+emacsbugreports@gnu.org>

Stefan,
I'm very sorry for the delayed response things have been hectic of late.

On Wed, Oct 28, 2009 at 7:37 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>> I assumed nil.
>
> That would be very unexpected, since file-truename otherwise always
> returns a string when passed a string.

Yes, understood; most likely my assumptions are predicated by these seemingly
contradictory behaviors:

(file-name-absolute-p "") ;=> nil
(file-symlink-p "")       ;=> nil

>
> It's the other way around: the few functions that preserve the
> match-data should be documented as such (better yet: the byte-compiler
> should be taught about them, so it can detect when we use the
> match-data after it got clobbered).

No argument there :)

>>> Which part of the documentation do you think this behavior contradicts?
>
>> This part:
>>  (file-name-absolute-p "") ;=> nil
>>  (file-symlink-p "")       ;=> nil
>
> That's not a part of the documentation.

You're right. None the less, this behaviour does contradict behaviour indicated
by said docs.

> Elisp should generally not be w32-specific, so ratehr than use
> w32-long-file-name we should maybe change
> file-truename correspondingly.  That doesn't mean I think it's the right
> thing to do: I know next to nothing about this issue.

Best I can gather the existing w32 conditional branch has been around for a long
time.  i.e. the email address in the comments carry a {...}@harlequin.co.uk
domain.

>
>> !         ((and (string= (substring filename 0 1) "~")
>> !               (string-match-p "~[^/]*/?" filename))
>> !          (string-match "~[^/]*/?" filename)
>> !          (let ((first-part
>> !                 (substring filename 0 (match-end 0)))
>> !                (rest (substring filename (match-end 0))))
>
> What's the point?

To avoid setting the match-data b/c it _is not_ necessarily going to be used per
the conditional.

> If you're going to use string-match in the end, you might as well do it right
> away.

This is wrong.
Though, it may explain how/why the existing situation persists :)

>        Stefan
>
s_P






  parent reply	other threads:[~2009-11-07  0:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-28  0:28 bug#4819: file-truename's undocumented behavior MON KEY
2009-10-28  1:52 ` Stefan Monnier
2009-10-28 20:01   ` MON KEY
2009-10-29  0:37     ` Stefan Monnier
2009-10-29  0:56       ` Lennart Borgman
2009-11-07  0:01       ` MON KEY [this message]
2011-07-09  5:51       ` Glenn Morris

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=d2afcfda0911061601s4c2bac93qf07d263ec737fe6b@mail.gmail.com \
    --to=monkey@sandpframing.com \
    --cc=4819@emacsbugs.donarmstrong.com \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).