From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: abbreviate-file-name on Windows seems incorrect Date: Sun, 7 Jan 2007 18:04:27 -0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1168221985 24626 80.91.229.12 (8 Jan 2007 02:06:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 8 Jan 2007 02:06:25 +0000 (UTC) Cc: Stephen Leake , Eli Zaretskii , Chris Moore , miles@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 08 03:06:23 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 1H3ju2-0002lw-3Q for ged-emacs-devel@m.gmane.org; Mon, 08 Jan 2007 03:06:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H3ju1-0003r7-F2 for ged-emacs-devel@m.gmane.org; Sun, 07 Jan 2007 21:06:21 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H3jtQ-0003Q6-UR for emacs-devel@gnu.org; Sun, 07 Jan 2007 21:05:45 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H3jtP-0003OL-8G for emacs-devel@gnu.org; Sun, 07 Jan 2007 21:05:44 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H3jtP-0003OB-3g for emacs-devel@gnu.org; Sun, 07 Jan 2007 21:05:43 -0500 Original-Received: from [148.87.113.118] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1H3jtH-00087a-DJ; Sun, 07 Jan 2007 21:05:35 -0500 Original-Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.186.111]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id l0825TVA013264; Sun, 7 Jan 2007 19:05:30 -0700 Original-Received: from rcsmt251.oracle.com (rcsmt251.oracle.com [148.87.90.196]) by rgmgw2.us.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l0825SVJ014384; Sun, 7 Jan 2007 19:05:28 -0700 Original-Received: from dhcp-amer-rmdc-csvpn-gw4-141-144-96-135.vpn.oracle.com by rcsmt251.oracle.com with ESMTP id 2344223211168221882; Sun, 07 Jan 2007 19:04:42 -0700 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE 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:64951 Archived-At: > The value of HOME is cached the first time abbreviate-file-name is > called, and never updated, using exactly the code you quoted here: > > > The code for `abbreviate-file-name' defines `abbreviated-home-dir' as > > follows, in order to be able to "substitute `~' for the user's home > > directory", as the doc string says: > > > > (or abbreviated-home-dir > > (setq abbreviated-home-dir > > (let ((abbreviated-home-dir "$foo")) > > (concat "^" (abbreviate-file-name > > (expand-file-name "~")) > > "\\(/\\|\\'\\)")))) > > > > The comment for this code is as follows, which indicates that a slash is > > added to distinguish the home dir from a file in that dir: > > If you look up 3 lines from that comment about the slash, you'll see: > > ;; Compute and save the abbreviated homedir name. > ;; We defer computing this until the first time it's needed, Right. I saw that (but forgot about it - thanks for reminding me). I think that's a mistake. What's gained by that? We already saw what is lost by it. BTW, the comment about deferring computation seems off base. I don't see any computation deferral, but I do see computation caching. That's what is important (and wrong), I think: `abbreviated-home-dir' is computed only once.