all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <Michael.Albinus@alcatel.de>
Cc: emacs-devel@gnu.org
Subject: Re: substitute-in-file-name and "$"
Date: Sun, 06 Jul 2003 01:16:44 +0200	[thread overview]
Message-ID: <nqllvcmun7.fsf@alcatel.de> (raw)
In-Reply-To: <200307051829.h65IT4d05636@raven.dms.auburn.edu> (Luc Teirlinck's message of "Sat, 5 Jul 2003 13:29:04 -0500 (CDT)")

Luc Teirlinck <teirllm@dms.auburn.edu> writes:

> Michael Albinus wrote:
>
>    There is no rule that substitute-in-file-name must be called only
>    once.
>
> Even if this rule is not stated explicitly, this just seems to be
> common sense.  It would appear that this is just a special case of the
> general rule that one should avoid bugs.

At least the examples in the Elisp manual give the feeling that
substitute-in-file-name could be called without special attention. The
trap with the "$" char isn't obvious.

>    For example, if you use partial-completion-mode, the filename in
>    the minibuffer will be passed through substitute-in-file-name by
>    PC-do-completion. Later file name operations which call internally
>    substitute-in-file-name will fail therefore.
>
> To me, it would seem obvious that this is a bug in `PC-do-completion'.
> It can not handle filenames containing a literal `$'.

It takes any file name you offer. But at least it should perform a
special handling for "$" (requoting), as Stefan mentioned already in
the original thread in gnu.emacs.help.

> You say "for example".  Are you aware of tons of similar bugs
> throughout the Emacs code or is `PC-do-completion' an isolated
> example?

At least I've done the same bug in tramp-smb.el (corrected). No, for
the time being that's the only case I know. But I fear that there are
other cases, because occasionally I get such reports for tramp-smb I
couldn't catch the origin. I'll investigate harder.

>    What I'ld like to know: Is it a general rule, that
>    substitute-in-file-name can be called only once for a given file name?
>    Then it should be documented in the Elisp manual, and it is a bug in
>    PC-do-completion. Or is it a more general design problem?
>
> It might actually be good to mention this potential trap in the Elisp
> manual.  However, this is a matter of avoiding bugs, not a matter of
> following some stylistic "rule".

Not only a stylistic "rule" but a design constraint. So it is worth a
note in the manual.

And, btw, if substitute-in-file-name can be called only once, how do I
know it where to perform this call? And what shall the others do, if
they would like to perform substitute-in-file-name?  Requote "$"? Or
apply an optional parameter (to be introduced), which forces this?

> Sincerely,
>
> Luc.

Best regards, Michael.

  reply	other threads:[~2003-07-05 23:16 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-05 16:44 substitute-in-file-name and "$" Michael Albinus
2003-07-05 18:29 ` Luc Teirlinck
2003-07-05 23:16   ` Michael Albinus [this message]
2003-07-05 23:58     ` Luc Teirlinck
2003-07-06 12:20       ` Kai Großjohann
2003-07-06 12:44         ` Miles Bader
2003-07-06 14:30       ` Michael Albinus
2003-07-06 16:24         ` Luc Teirlinck
2003-07-06 16:53           ` Kai Großjohann
2003-07-07 15:48           ` Michael Albinus
2003-07-06  0:07     ` Miles Bader
2003-07-06 12:07       ` Kim F. Storm
2003-07-06 14:37         ` Michael Albinus
2003-07-06 17:06           ` Stefan Monnier
2003-07-06 17:20         ` Stefan Monnier
2003-07-07 11:50           ` Michael Albinus
2003-07-07 14:34             ` Stefan Monnier
2003-07-07 16:10               ` Michael Albinus
2003-07-09 23:47                 ` Richard Stallman
2003-07-07  3:39         ` Richard Stallman
2003-07-07 21:33         ` Kevin Rodgers
2003-07-08 20:02           ` Richard Stallman
2003-07-06 18:53 ` Richard Stallman
2003-07-06 23:46   ` Kim F. Storm
2003-07-06 21: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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nqllvcmun7.fsf@alcatel.de \
    --to=michael.albinus@alcatel.de \
    --cc=emacs-devel@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 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.