From: Drew Adams <drew.adams@oracle.com>
To: 15017@debbugs.gnu.org
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) [thread overview]
Message-ID: <592430da-2f45-412f-971f-753f7b31559d@default> (raw)
(`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=/c/Devel/emacs/binary --enable-checking=yes,glyphs
CFLAGS=-O0 -g3 LDFLAGS=-Lc:/Devel/emacs/lib
CPPFLAGS=-Ic:/Devel/emacs/include'
reply other threads:[~2013-08-03 16:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=592430da-2f45-412f-971f-753f7b31559d@default \
--to=drew.adams@oracle.com \
--cc=15017@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).