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: should `minibuffer-complete' use `abbreviate-file-name'? Date: Fri, 12 Oct 2007 13:34:05 -0700 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 1192221884 7609 80.91.229.12 (12 Oct 2007 20:44:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 12 Oct 2007 20:44:44 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org To: "Stefan Monnier" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 12 22:44:31 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 1IgRDQ-0006yo-K2 for ged-emacs-devel@m.gmane.org; Fri, 12 Oct 2007 22:34:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IgRDK-0001TF-AX for ged-emacs-devel@m.gmane.org; Fri, 12 Oct 2007 16:34:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IgRDF-0001SQ-Bs for emacs-devel@gnu.org; Fri, 12 Oct 2007 16:34:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IgRDD-0001SE-FU for emacs-devel@gnu.org; Fri, 12 Oct 2007 16:34:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IgRDD-0001S2-8B for emacs-devel@gnu.org; Fri, 12 Oct 2007 16:34:23 -0400 Original-Received: from rgminet01.oracle.com ([148.87.113.118]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IgRD8-0000ud-7T; Fri, 12 Oct 2007 16:34:19 -0400 Original-Received: from agmgw1.us.oracle.com (agmgw1.us.oracle.com [152.68.180.212]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id l9CKYFem022098; Fri, 12 Oct 2007 14:34:15 -0600 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by agmgw1.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id l9CKYELc002761; Fri, 12 Oct 2007 14:34:14 -0600 Original-Received: from dhcp-amer-csvpn-gw2-141-144-72-178.vpn.oracle.com by acsmt350.oracle.com with ESMTP id 3288630051192221237; Fri, 12 Oct 2007 13:33:57 -0700 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.3198 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:80744 Archived-At: > >> For file-name completion, apply `abbreviate-file-name' to the > >> user's input. This would let a user take advantage of a customized > >> `directory-abbrev-alist' during completion. > >> > >> Would there be any downside to that? > >> > >> I don't think Emacs should alter the names that the user enters. > > > `directory-abbrev-alist' is nil by default. Users customize it. > > It lets them substitute their own abbreviations for directories. > > > Why shouldn't completion respect the user's preference for such > > abbreviations (e.g. symlinks)? > > I must say I do not understand what you're asking for. Can you spell out > a concrete example? `directory-abbrev-alist' substitutes matches of its regexps against directory names with their corresponding directory-name "abbreviations". The doc shows only examples where the resulting directory names are shorter, but the reverse relation can be useful as well: expand instead of contract. The point is to substitute one directory name for another that is more convenient in some way. The symlink case is only one use case, IIUC. Here is the original feature request I received, describing a use case. The user requests that the cars of `directory-abbrev-alist' entries be completed to the cdrs. I've been using Icicles about over 1 year (but still i'm a sort of newbie). recently, i found i can use 'directory-abbrev-alist' not to type very long path that is hard to remember in 'find-file'. But I also found that Icicles' completion mechanism (including default Emacs' one) does not handle this abbrev consistently. for example, when i set my directory-abbrev-alist up like (("^/exe" . "/very-long-path-here/exe")) and, when i enter in minibuffer after 'find-file', "/exe", and TAB no expansion occurred. How can i utilize abbreviation to long path in Icicle ways? IOW, `find-file /exe RET' correctly expands the abbreviation. But the same is not true of `find-file /exe TAB'. The user requests that the latter feature be added. To implement this, i just call `abbreviate-file-name' on the user's current file-name input. Then, in the example above, both `C-x C-f /exe TAB' and `C-x C-f /whatever/you/might/have//exe TAB' complete to `/very-long-path-here/exe'. Seems useful to me. Again, does anyone see a downside to such behavior? The abbreviation list is under user control (customization), so I don't see the point of Richard's complaint that Emacs completion would then be altering what the user entered. That's the whole point of completion, no?