unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: sds@gnu.org, emacs-devel@gnu.org
Subject: Re: convert-standard-filename
Date: Sun, 07 Aug 2011 11:33:53 -0400	[thread overview]
Message-ID: <jwvr54xnt22.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83hb5vvwdp.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 06 Aug 2011 10:20:50 +0300")

>> But how should it decide what is relative and what is not, e.g. in the
>> case of "c:/foo" (or worse "c:foo") mentioned in the docstring?
> Why by file-name-absolute-p, of course ;-)

This would mean that the input is interpreted in an OS-dependent way.
It would seem to make more sense to say that the arg to
convert-filename-argument (or its new replacement) should be
a Unix-style filename, i.e. "C:<foo>" is always interpreted as
a relative file name, even under Window or DOS.

>> AFAICT, there are the following different needs:
>> - The original intention: convert a standard name such as "~/.emacs" so
>> it works everywhere.  The argument should come from within Emacs.
>> This should pretty much only be used with a constant argument.
>> Maybe (a big maybe) it can be used for things like generating
>> a filename from some other piece of data, but I think even that should
>> be discouraged in favor of `md5'.
>> - Take a filename from outside Emacs and convert it into something Emacs
>> can use internally.  Can do things like cygwin handling.  Can assume
>> that the provided filename is valid, so it doesn't need to be careful
>> to drop invalid filename characters.  Can convert backslashes into
>> slashes on Windows.
>> - Take an internal filename and convert it to something that can be used
>> outside of Emacs.  E.g. convert slashes into backslashes.  Again, this
>> can probably assume that the file name is already valid and doesn't
>> need to drop funny chars.
> Something like that.  There's also dos-8+3-filename, which is needed
> when one compares with string= internal file names with those found on
> disk, but that's DOS-specific, or maybe it can be merged into the last
> category.

How 'bout a file-name-equal, which could also try to account for
case-sensitivity?
Hmm... I didn't check all uses of doc-8+3-filename, but at least the one
in files.el can't be replaced by file-name-equal.


        Stefan



  reply	other threads:[~2011-08-07 15:33 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1QjaPL-0003HL-TM@colonialone.fsf.org>
2011-08-02  3:39 ` [Emacs-diffs] /srv/bzr/emacs/trunk r105295: * lisp/progmodes/etags.el (etags-file-of-tag, etags-tags-table-files) Stefan Monnier
2011-08-02  4:34   ` Sam Steingold
2011-08-02  4:51   ` Eli Zaretskii
2011-08-02 18:57     ` Stefan Monnier
2011-08-02 19:12       ` Eli Zaretskii
2011-08-02 20:24         ` Stefan Monnier
2011-08-03  9:05           ` Eli Zaretskii
2011-08-05 17:18             ` convert-standard-filename (was: [Emacs-diffs] /srv/bzr/emacs/trunk r105295: * lisp/progmodes/etags.el (etags-file-of-tag, etags-tags-table-files)) Stefan Monnier
2011-08-06  7:20               ` Eli Zaretskii
2011-08-07 15:33                 ` Stefan Monnier [this message]
2011-08-07 15:43                   ` convert-standard-filename Lennart Borgman
2011-08-07 19:43                     ` convert-standard-filename Stefan Monnier
2011-08-07 22:05                       ` convert-standard-filename Lennart Borgman
2011-08-08  2:54                         ` convert-standard-filename Eli Zaretskii
2011-08-08  3:23                           ` convert-standard-filename Lennart Borgman
2011-08-08  4:19                             ` convert-standard-filename Eli Zaretskii
2011-08-08  4:26                               ` convert-standard-filename Lennart Borgman
2011-08-08  4:38                                 ` convert-standard-filename Eli Zaretskii
2011-08-08 10:37                                   ` convert-standard-filename Lennart Borgman
2011-08-08 11:31                                     ` convert-standard-filename Eli Zaretskii
2011-08-08 17:15                                       ` convert-standard-filename Lennart Borgman
2011-08-07 16:18                   ` convert-standard-filename Eli Zaretskii
2011-08-07 16:22                     ` convert-standard-filename Lennart Borgman
2011-08-07 20:19                     ` convert-standard-filename Stefan Monnier
2011-08-07 20:35                       ` convert-standard-filename Eli Zaretskii
2011-08-07 21:20                         ` convert-standard-filename Sam Steingold
2011-08-08  2:53                           ` convert-standard-filename Eli Zaretskii
2011-08-08  3:24                           ` convert-standard-filename Stefan Monnier
2011-08-08  4:14                             ` convert-standard-filename Eli Zaretskii
2011-08-08 18:20                               ` convert-standard-filename Stefan Monnier
2011-08-08 19:14                                 ` convert-standard-filename Eli Zaretskii
2011-08-08 21:24                                   ` convert-standard-filename Stefan Monnier
2011-08-09  5:19                                     ` convert-standard-filename Eli Zaretskii
2011-08-09 18:33                                       ` convert-standard-filename Stefan Monnier
2011-08-09 18:36                                       ` convert-standard-filename Stefan Monnier
2011-08-08  7:33                       ` convert-standard-filename Michael Albinus
2011-08-02  8:11   ` [Emacs-diffs] /srv/bzr/emacs/trunk r105295: * lisp/progmodes/etags.el (etags-file-of-tag, etags-tags-table-files) Francesco Potortì
2011-08-02 15:33     ` Sam Steingold
2011-08-02 18:55       ` Stefan Monnier

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=jwvr54xnt22.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=sds@gnu.org \
    /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).