From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#15017: 24.3.50; `read-from-minibuffer' to allow transforming input before adding to HIST Date: Sat, 3 Aug 2013 09:53:40 -0700 (PDT) Message-ID: <592430da-2f45-412f-971f-753f7b31559d@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1375548908 12350 80.91.229.3 (3 Aug 2013 16:55:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 3 Aug 2013 16:55:08 +0000 (UTC) To: 15017@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Aug 03 18:55:09 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V5f6i-0004xK-O4 for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Aug 2013 18:55:08 +0200 Original-Received: from localhost ([::1]:47672 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5f6i-0003Um-7N for geb-bug-gnu-emacs@m.gmane.org; Sat, 03 Aug 2013 12:55:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5f6f-0003S8-2k for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2013 12:55:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V5f6d-0006RA-87 for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2013 12:55:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5f6d-0006Qj-4h for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2013 12:55:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1V5f6c-0006nb-4q for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2013 12:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 03 Aug 2013 16:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15017 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.137554886326031 (code B ref -1); Sat, 03 Aug 2013 16:55:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Aug 2013 16:54:23 +0000 Original-Received: from localhost ([127.0.0.1]:38429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V5f5y-0006lm-7E for submit@debbugs.gnu.org; Sat, 03 Aug 2013 12:54:22 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39358) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1V5f5v-0006lU-2X for submit@debbugs.gnu.org; Sat, 03 Aug 2013 12:54:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V5f5f-0005qW-EF for submit@debbugs.gnu.org; Sat, 03 Aug 2013 12:54:13 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:46991) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5f5f-0005qM-BN for submit@debbugs.gnu.org; Sat, 03 Aug 2013 12:54:03 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5f5V-0003Gs-H0 for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2013 12:54:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V5f5M-0005n9-V0 for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2013 12:53:53 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:21493) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5f5M-0005mx-OS for bug-gnu-emacs@gnu.org; Sat, 03 Aug 2013 12:53:44 -0400 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r73GrgMN002810 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 3 Aug 2013 16:53:43 GMT Original-Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r73Grfmp018390 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 3 Aug 2013 16:53:42 GMT Original-Received: from abhmt115.oracle.com (abhmt115.oracle.com [141.146.116.67]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r73Grf6u008798 for ; Sat, 3 Aug 2013 16:53:41 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6668.5000 (x86)] X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Spam-Score: -2.4 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-Spam-Score: -2.4 (--) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:76937 Archived-At: (`read-from-minibuffer' is still coded in C...) Enhancement request: Provide a global variable whose value would be nil or a function to transform the input chosen for `read-from-minibuffer', before adding it to the history variable. A use case: a command that uses `completing-read' to choose among absolute file names and uses `file-name-history' as the HIST argument. This means (intentionally) that the candidates are not abbreviated with `abbreviate-file-name', so a candidate might look like this: "/usr/foo/toto/bar.el" instead of, say, this: "~/toto/bar.el". But `read-file-name' puts abbreviated file names, such as "~/toto/bar.el" on `file-name-history' (as it should). Obviously, simple string comparisons (e.g., to avoid the cost of file access) on file names will not work: "/usr/foo/toto/bar.el" is not `equal' to "~/toto/bar.el", for instance. I would like to be able to let-bind a global variable around a call to `completing-read' to, say, function `abbreviate-file-name'. The completion candidates would still be absolute, unabbreviated file names, but when added to `file-name-history' they would be abbreviated. Other input transformations might also be useful before adding to a minibuffer history, besides the use case mentioned above. In GNU Emacs 24.3.50.1 (i686-pc-mingw32) of 2013-07-21 on ODIEONE Bzr revision: 113485 lekktu@gmail.com-20130722012547-e3b7qxn1dba5vf20 Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --prefix=3D/c/Devel/emacs/binary --enable-checking=3Dyes,glyphs CFLAGS=3D-O0 -g3 LDFLAGS=3D-Lc:/Devel/emacs/lib CPPFLAGS=3D-Ic:/Devel/emacs/include'