From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#4708: 23.1; completion-try-completion adds an extra $: $$HOMj Date: Tue, 13 Oct 2009 16:13:25 -0400 Message-ID: References: Reply-To: Stefan Monnier , 4708@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1255465866 13305 80.91.229.12 (13 Oct 2009 20:31:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 Oct 2009 20:31:06 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org, 4708@emacsbugs.donarmstrong.com To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 13 22:30:55 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mxo19-0000nH-FN for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Oct 2009 22:30:48 +0200 Original-Received: from localhost ([127.0.0.1]:34326 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mxo17-0005ZK-H5 for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Oct 2009 16:30:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mxnxp-0003bd-Ek for bug-gnu-emacs@gnu.org; Tue, 13 Oct 2009 16:27:21 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mxnxk-0003ZM-HX for bug-gnu-emacs@gnu.org; Tue, 13 Oct 2009 16:27:20 -0400 Original-Received: from [199.232.76.173] (port=34455 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mxnxk-0003ZH-Dm for bug-gnu-emacs@gnu.org; Tue, 13 Oct 2009 16:27:16 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:60078) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mxnxj-0000eo-C8 for bug-gnu-emacs@gnu.org; Tue, 13 Oct 2009 16:27:15 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9DKRAhj007175; Tue, 13 Oct 2009 13:27:12 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n9DKKA4O005920; Tue, 13 Oct 2009 13:20:10 -0700 Resent-Date: Tue, 13 Oct 2009 13:20:10 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Tue, 13 Oct 2009 20:20:09 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4708 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4708-submit@emacsbugs.donarmstrong.com id=B4708.12554648144718 (code B ref 4708); Tue, 13 Oct 2009 20:20:09 +0000 Original-Received: (at 4708) by emacsbugs.donarmstrong.com; 13 Oct 2009 20:13:34 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from chene.dit.umontreal.ca (chene.dit.umontreal.ca [132.204.246.20]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9DKDTmO004715 for <4708@emacsbugs.donarmstrong.com>; Tue, 13 Oct 2009 13:13:30 -0700 Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id n9DKDPbf020281; Tue, 13 Oct 2009 16:13:26 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id D9BED3A07F; Tue, 13 Oct 2009 16:13:25 -0400 (EDT) In-Reply-To: (Drew Adams's message of "Mon, 12 Oct 2009 12:05:32 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3383=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Tue, 13 Oct 2009 16:27:20 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31882 Archived-At: >>>>> "Drew" == Drew Adams writes: > emacs -Q > M-: (completion-try-completion "c:/some-dir/$HOMj" nil 16) > correctly returns: (c:/some-dir/$HOMEj" . 17) > M-: (completion-try-completion "c:/some-dir/$HOMj" nil 17) > returns: ("c:/some-dir/$$HOMj" . 18) > That doesn't seem correct. Is it correct to have $$ here? If so, can > you please explain it a bit (why)? File name entry assigns a special meaning to $ for envvars, but in order to be able to refer to the file "$HOME", it offers an escape system where you write "$$HOME". Since Emacs-21 or so, I've made this escape unnecessary in the case where the $ is used unambiguously (because there is no envvar of this name), so if you enter "$HOMj", Emacs know you don't refer to the file name contained in the envvar `HOMj', but to the file named $HOMj. The completion code need to do such unescape/reescaping in order to work properly and it currently re-escapes in a conservative way (i.e. it re-escapes $HOMj into $$HOMj even tho it's not strictly necessary). File name completion is designed to result a string appropriate for substitute-in-file-name, and indeed (substitute-in-file-name "c:/some-dir/$$HOMj") -> "c:/some-dir/$HOMj" > Also, if this is correct behavior, then please explain this in the doc > string of `completion-try-completion'. It can't be described there, because that function applies to any kind of completion, whereas the above only applies to completions using read-file-name-internal. Stefan