unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#15017: 24.3.50; `read-from-minibuffer' to allow transforming input before adding to HIST
@ 2013-08-03 16:53 Drew Adams
  0 siblings, 0 replies; only message in thread
From: Drew Adams @ 2013-08-03 16:53 UTC (permalink / raw)
  To: 15017

(`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'





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-08-03 16:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-03 16:53 bug#15017: 24.3.50; `read-from-minibuffer' to allow transforming input before adding to HIST Drew Adams

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).