unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* A smarter command history
@ 2014-01-25 16:53 Tom
  2014-01-25 21:55 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Tom @ 2014-01-25 16:53 UTC (permalink / raw)
  To: emacs-devel

After doing grep the command history contains this entry:

  (grep "grep -n -i test")

This is useful to repeat a previous grep command later, but 
you have to switch to the directory first if you want to 
run grep in the same directory as previously.

What if the code which updates command history had a hook
which the command could use to fix the history entry if
it loses some useful attribute of executing the command

For example, in grep's case the command history would look
like this after the fix:

  (let ((default-directory "/home/me/projx")) (grep "grep -n -i test"))

So the user could easily run grep again in the same directory.

grep-find is the same case and there must be similar cases
where simply storing the lisp function call in the history is
not enough, because the function arguments do not cover
all attributes of the command's execution.

Adding a hook to make it possible for the commands to add
the necessary info to the history entry would solve this problem.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-01-26 19:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-25 16:53 A smarter command history Tom
2014-01-25 21:55 ` Stefan Monnier
2014-01-26 16:53   ` Tom
2014-01-26 18:53     ` Drew Adams
2014-01-26 19:13       ` Tom

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