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#4654: 23.1; Elisp manual doc of abbreviate-file-name Date: Wed, 07 Oct 2009 10:09:12 -0400 Message-ID: References: <2C5117E03B57417289F8B3E16B1B8B61@us.oracle.com> <0F408BF94DA24CFCB960917D03E903BA@us.oracle.com> Reply-To: Stefan Monnier , 4654@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 1254926961 19999 80.91.229.12 (7 Oct 2009 14:49:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 7 Oct 2009 14:49:21 +0000 (UTC) Cc: 4654@emacsbugs.donarmstrong.com To: "Drew Adams" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 07 16:49:11 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 1MvXot-0007Bj-0d for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Oct 2009 16:48:47 +0200 Original-Received: from localhost ([127.0.0.1]:34969 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvXos-0003nd-IB for geb-bug-gnu-emacs@m.gmane.org; Wed, 07 Oct 2009 10:48:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MvXU5-0000A6-6j for bug-gnu-emacs@gnu.org; Wed, 07 Oct 2009 10:27:17 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MvXU0-00007T-0y for bug-gnu-emacs@gnu.org; Wed, 07 Oct 2009 10:27:16 -0400 Original-Received: from [199.232.76.173] (port=40864 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MvXTz-00007H-QV for bug-gnu-emacs@gnu.org; Wed, 07 Oct 2009 10:27:11 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:50531) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MvXTz-00068f-8q for bug-gnu-emacs@gnu.org; Wed, 07 Oct 2009 10:27:11 -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 n97ER9An027772; Wed, 7 Oct 2009 07:27:09 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n97EF4Zx025901; Wed, 7 Oct 2009 07:15:04 -0700 Resent-Date: Wed, 7 Oct 2009 07:15:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Wed, 07 Oct 2009 14:15:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4654 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4654-submit@emacsbugs.donarmstrong.com id=B4654.125492456025103 (code B ref 4654); Wed, 07 Oct 2009 14:15:04 +0000 Original-Received: (at 4654) by emacsbugs.donarmstrong.com; 7 Oct 2009 14:09:20 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from ironport2-out.pppoe.ca (ironport2-out.teksavvy.com [206.248.154.181]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n97E9Idx025100 for <4654@emacsbugs.donarmstrong.com>; Wed, 7 Oct 2009 07:09:20 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlMFAFM+zEpMCqug/2dsb2JhbACBUtULhCoEhzQ X-IronPort-AV: E=Sophos;i="4.44,519,1249272000"; d="scan'208";a="47233192" Original-Received: from 76-10-171-160.dsl.teksavvy.com (HELO pastel.home) ([76.10.171.160]) by ironport2-out.pppoe.ca with ESMTP; 07 Oct 2009 10:09:12 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 50C3281F0; Wed, 7 Oct 2009 10:09:12 -0400 (EDT) In-Reply-To: <0F408BF94DA24CFCB960917D03E903BA@us.oracle.com> (Drew Adams's message of "Wed, 7 Oct 2009 00:50:41 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Wed, 07 Oct 2009 10:27:16 -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:31761 Archived-At: >> so it would be wrong for abbreviate-file-name to do such a >> replacement, since it wouldn't abbreviate. > That's being a bit too black-and-white, don't you think? Not really. Clearly abbreviate-file-name does not guarantee that the returned file name will be shorter. But it *should* aim to "do no harm", i.e. not make file names longer (although it doesn't guarantee that either, IIUC, since it depends on directory-abbrev-alist which is free to lengthen at the user's heart's content). > In that case, it is even more "wrong" to return c:\\foo instead of > ~/foo, which is what we do now on Windows. That's 3 chars longer, > a threefold worsening of your non-shortening problem. ;-) No: the relevant question is not "does it make it shorter", but "does it make it longer". So it's OK (tho suboptimal) to keep "C:\\foo" as is, but it's not OK to turn "/foo" into "~/foo". I wouldn't mind if someone wants to change that behavior in w32, but I'll leave that to people who actually care about w32. > The stated feature of "abbreviation" for this function has two > aspects: (1) substituting a defined "abbreviation" from > `directory-abbrev-list' - which is _not_ necessarily shorter than what > it replaces, in fact, and (2) substituting `~' for the home dir. I think that's the core of the misunderstanding. The purpose of abbreviate-file-name is not to apply the above two steps. Those steps are just the current way to reach the real goal, which is to abbreviate the file name. Admittedly, "abbreviate" is not exactly meant here as "shorten" but rather as "make it more concise/easy/pretty for the user", but still to a first approximation "not longer" is a very good design guideline. Stefan