From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: substitute-in-file-name and "$" Date: Sun, 06 Jul 2003 01:16:44 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <200307051829.h65IT4d05636@raven.dms.auburn.edu> Reply-To: Michael Albinus NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1057447212 9917 80.91.224.249 (5 Jul 2003 23:20:12 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 5 Jul 2003 23:20:12 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun Jul 06 01:20:06 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19YwK5-0002ZU-00 for ; Sun, 06 Jul 2003 01:20:05 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19YwTB-0002OD-00 for ; Sun, 06 Jul 2003 01:29:29 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19YwJA-0000Ex-3H for emacs-devel@quimby.gnus.org; Sat, 05 Jul 2003 19:19:08 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19YwIS-0008S0-Qf for emacs-devel@gnu.org; Sat, 05 Jul 2003 19:18:24 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19YwHY-00085V-6d for emacs-devel@gnu.org; Sat, 05 Jul 2003 19:17:31 -0400 Original-Received: from mailrelay3.alcatel.de ([194.113.59.71] helo=mailrelay1.alcatel.de) by monty-python.gnu.org with esmtp (Exim 4.20) id 19YwHW-0007lI-0E for emacs-devel@gnu.org; Sat, 05 Jul 2003 19:17:26 -0400 Original-Received: from slbh00.bln.sel.alcatel.de (mailhost.bln.sel.alcatel.de [149.204.49.8]) by mailrelay1.alcatel.de (8.9.3/8.9.3) with ESMTP id BAA04786; Sun, 6 Jul 2003 01:16:26 +0200 (MET DST) Original-Received: from slbwba.bln.sel.alcatel.de (albinus@slbwba [149.204.93.83]) by slbh00.bln.sel.alcatel.de (8.9.3/8.9.3) with ESMTP id BAA09500; Sun, 6 Jul 2003 01:16:47 +0200 (MET DST) Original-To: Luc Teirlinck In-Reply-To: <200307051829.h65IT4d05636@raven.dms.auburn.edu> (Luc Teirlinck's message of "Sat, 5 Jul 2003 13:29:04 -0500 (CDT)") User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/20.7 (hpux) X-Alcanet-MTA-scanned-and-authorized: yes X-Alcanet-MTA-scanned-and-authorized: yes X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:15401 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:15401 Luc Teirlinck 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.