From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: MON KEY Newsgroups: gmane.emacs.bugs Subject: bug#4819: file-truename's undocumented behavior Date: Fri, 6 Nov 2009 19:01:28 -0500 Message-ID: References: Reply-To: MON KEY , 4819@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1257553659 18984 80.91.229.12 (7 Nov 2009 00:27:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 Nov 2009 00:27:39 +0000 (UTC) Cc: 4819@emacsbugs.donarmstrong.com, bug-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Nov 07 01:27:32 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 1N6Z9O-0007hE-IZ for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Nov 2009 01:27:30 +0100 Original-Received: from localhost ([127.0.0.1]:51349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N6Z9O-0006Dg-2z for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Nov 2009 19:27:30 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N6Z9I-0006Co-F2 for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2009 19:27:24 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N6Z9E-0006Ak-Pv for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2009 19:27:24 -0500 Original-Received: from [199.232.76.173] (port=59572 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N6Z9E-0006AL-Iu for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2009 19:27:20 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:39889) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N6Z9D-0005CM-Nd for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2009 19:27:20 -0500 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 nA70RGOp014668; Fri, 6 Nov 2009 16:27:17 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nA70A7Uv012788; Fri, 6 Nov 2009 16:10:07 -0800 Resent-Date: Fri, 6 Nov 2009 16:10:07 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: MON KEY Original-Sender: stan@derbycityprints.com Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Sat, 07 Nov 2009 00:10:07 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4819 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125755209711430 (code B ref -1); Sat, 07 Nov 2009 00:10:07 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 7 Nov 2009 00:01:37 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nA701ZiO011423 for ; Fri, 6 Nov 2009 16:01:36 -0800 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N6YkJ-0004Az-5J for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2009 19:01:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N6YkE-0004AM-J8 for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2009 19:01:34 -0500 Original-Received: from [199.232.76.173] (port=37677 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N6YkE-0004AH-GI for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2009 19:01:30 -0500 Original-Received: from mail-gx0-f212.google.com ([209.85.217.212]:39454) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N6YkE-0001sW-3F for bug-gnu-emacs@gnu.org; Fri, 06 Nov 2009 19:01:30 -0500 Original-Received: by gxk4 with SMTP id 4so1604941gxk.8 for ; Fri, 06 Nov 2009 16:01:29 -0800 (PST) Original-Received: by 10.150.118.36 with SMTP id q36mr8885016ybc.277.1257552088940; Fri, 06 Nov 2009 16:01:28 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: 08b6f39a90f94703 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Fri, 06 Nov 2009 19:27:24 -0500 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:32458 Archived-At: Stefan, I'm very sorry for the delayed response things have been hectic of late. On Wed, Oct 28, 2009 at 7:37 PM, Stefan Monnier wrote: >> I assumed nil. > > That would be very unexpected, since file-truename otherwise always > returns a string when passed a string. Yes, understood; most likely my assumptions are predicated by these seemingly contradictory behaviors: (file-name-absolute-p "") ;=> nil (file-symlink-p "") ;=> nil > > It's the other way around: the few functions that preserve the > match-data should be documented as such (better yet: the byte-compiler > should be taught about them, so it can detect when we use the > match-data after it got clobbered). No argument there :) >>> Which part of the documentation do you think this behavior contradicts? > >> This part: >> (file-name-absolute-p "") ;=> nil >> (file-symlink-p "") ;=> nil > > That's not a part of the documentation. You're right. None the less, this behaviour does contradict behaviour indicated by said docs. > Elisp should generally not be w32-specific, so ratehr than use > w32-long-file-name we should maybe change > file-truename correspondingly. That doesn't mean I think it's the right > thing to do: I know next to nothing about this issue. Best I can gather the existing w32 conditional branch has been around for a long time. i.e. the email address in the comments carry a {...}@harlequin.co.uk domain. > >> ! ((and (string= (substring filename 0 1) "~") >> ! (string-match-p "~[^/]*/?" filename)) >> ! (string-match "~[^/]*/?" filename) >> ! (let ((first-part >> ! (substring filename 0 (match-end 0))) >> ! (rest (substring filename (match-end 0)))) > > What's the point? To avoid setting the match-data b/c it _is not_ necessarily going to be used per the conditional. > If you're going to use string-match in the end, you might as well do it right > away. This is wrong. Though, it may explain how/why the existing situation persists :) > Stefan > s_P