From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Herbert Euler" Newsgroups: gmane.emacs.devel Subject: Re: find-file-noselect needs save-match-data Date: Fri, 15 Jun 2007 23:55:51 +0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: sea.gmane.org 1181922976 13148 80.91.229.12 (15 Jun 2007 15:56:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 15 Jun 2007 15:56:16 +0000 (UTC) Cc: rms@gnu.org, miles.bader@necel.com, schwab@suse.de, emacs-devel@gnu.org, juri@jurta.org, miles@gnu.org To: monnier@iro.umontreal.ca, rudalics@gmx.at Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 15 17:56:14 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HzE9k-00061V-P8 for ged-emacs-devel@m.gmane.org; Fri, 15 Jun 2007 17:56:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HzE9k-0001Cv-5i for ged-emacs-devel@m.gmane.org; Fri, 15 Jun 2007 11:56:12 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HzE9f-0001CX-1M for emacs-devel@gnu.org; Fri, 15 Jun 2007 11:56:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HzE9c-0001Bx-8q for emacs-devel@gnu.org; Fri, 15 Jun 2007 11:56:06 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HzE9c-0001Bt-6f for emacs-devel@gnu.org; Fri, 15 Jun 2007 11:56:04 -0400 Original-Received: from bay0-omc3-s27.bay0.hotmail.com ([65.54.246.227]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HzE9Z-0002wA-Lu; Fri, 15 Jun 2007 11:56:01 -0400 Original-Received: from hotmail.com ([65.55.154.107]) by bay0-omc3-s27.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2668); Fri, 15 Jun 2007 08:56:00 -0700 Original-Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 15 Jun 2007 08:55:57 -0700 Original-Received: from 65.55.154.123 by by143fd.bay143.hotmail.msn.com with HTTP; Fri, 15 Jun 2007 15:55:51 GMT X-Originating-IP: [221.223.221.87] X-Originating-Email: [herberteuler@hotmail.com] X-Sender: herberteuler@hotmail.com In-Reply-To: X-OriginalArrivalTime: 15 Jun 2007 15:55:57.0288 (UTC) FILETIME=[A9745680:01C7AF65] X-detected-kernel: Windows 2000 SP4, XP SP1+ X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:72963 Archived-At: >PS: By the way, the above code looks odd. The comment seems to imply that >the MS-DOS check just reproduces the preceding / check, but it's not >the case: the / check makes sure that if HOME is / then /a/b will not be >changed to ~/a/b, whereas the MS-DOS check will only prevent changing A:/ >to >~ but it will not prevent changing A:/b/c to ~/b/c. I noticed this when >I considered replacing those two checks with > > ;; If the home dir is just /, don't change it. > ;; Same thing for A:/ under FreeDOS. > (let ((home (directory-file-name (match-string 0)))) > (equal home (file-name-directory home))) But the behavior is correct for another reason. `abbreviate-file-name' appends a slash at the end of abbreviated home directory: ;; Compute and save the abbreviated homedir name. ;; We defer computing this until the first time it's needed, to ;; give time for directory-abbrev-alist to be set properly. ;; We include a slash at the end, to avoid spurious matches ;; such as `/usr/foobar' when the home dir is `/usr/foo'. (or abbreviated-home-dir (setq abbreviated-home-dir (let ((abbreviated-home-dir "$foo")) (concat "^" (abbreviate-file-name (expand-file-name "~")) "\\(/\\|\\'\\)")))) So on Windows with root directories e.g. "A:/" as home directory, the value of `abbreviated-home-dir' is "^A:/\\(/\\|\\'\\)". So file names such as "A:/b/c" even can't satisfy the first condition. Although the outcome is that "A:/b/c" is not changed to "~", it's not good to get this outcome in the current way. Regards, Guanpeng Xu _________________________________________________________________ FREE pop-up blocking with the new MSN Toolbar - get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/