From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: 4654@emacsbugs.donarmstrong.com
Subject: bug#4654: 23.1; Elisp manual doc of abbreviate-file-name
Date: Wed, 07 Oct 2009 10:09:12 -0400 [thread overview]
Message-ID: <jwvbpkjwbnr.fsf-monnier+emacsbugreports@gnu.org> (raw)
In-Reply-To: <0F408BF94DA24CFCB960917D03E903BA@us.oracle.com> (Drew Adams's message of "Wed, 7 Oct 2009 00:50:41 -0700")
>> so it would be wrong for abbreviate-file-name to do such a
>> replacement, since it wouldn't abbreviate.
> That's being a bit too black-and-white, don't you think?
Not really. Clearly abbreviate-file-name does not guarantee that the
returned file name will be shorter. But it *should* aim to "do no
harm", i.e. not make file names longer (although it doesn't guarantee
that either, IIUC, since it depends on directory-abbrev-alist which is
free to lengthen at the user's heart's content).
> In that case, it is even more "wrong" to return c:\\foo instead of
> ~/foo, which is what we do now on Windows. That's 3 chars longer,
> a threefold worsening of your non-shortening problem. ;-)
No: the relevant question is not "does it make it shorter", but "does
it make it longer". So it's OK (tho suboptimal) to keep "C:\\foo" as
is, but it's not OK to turn "/foo" into "~/foo". I wouldn't mind if
someone wants to change that behavior in w32, but I'll leave that to
people who actually care about w32.
> The stated feature of "abbreviation" for this function has two
> aspects: (1) substituting a defined "abbreviation" from
> `directory-abbrev-list' - which is _not_ necessarily shorter than what
> it replaces, in fact, and (2) substituting `~' for the home dir.
I think that's the core of the misunderstanding. The purpose of
abbreviate-file-name is not to apply the above two steps. Those steps
are just the current way to reach the real goal, which is to abbreviate the
file name. Admittedly, "abbreviate" is not exactly meant here as
"shorten" but rather as "make it more concise/easy/pretty for the user",
but still to a first approximation "not longer" is a very good
design guideline.
Stefan
next prev parent reply other threads:[~2009-10-07 14:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <83ab03mrlo.fsf@gnu.org>
2009-10-06 17:54 ` bug#4654: 23.1; Elisp manual doc of abbreviate-file-name Drew Adams
2009-10-06 20:21 ` Stefan Monnier
2009-10-06 21:12 ` Drew Adams
2009-10-07 5:47 ` Stefan Monnier
2009-10-07 7:50 ` Drew Adams
2009-10-07 14:09 ` Stefan Monnier [this message]
2009-10-07 15:21 ` Drew Adams
2009-10-07 10:30 ` bug#4654: marked as done (23.1; Elisp manual doc of abbreviate-file-name) Emacs bug Tracking System
[not found] ` <1E8768BDE1464D019FC9EED701E222F4@us.oracle.com>
2009-10-07 17:44 ` bug#4654: 23.1; Elisp manual doc of abbreviate-file-name Eli Zaretskii
2009-10-07 17:55 ` Drew Adams
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvbpkjwbnr.fsf-monnier+emacsbugreports@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=4654@emacsbugs.donarmstrong.com \
--cc=drew.adams@oracle.com \
/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 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.