[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A smarter command history

From: Tom
Subject: A smarter command history
Date: Sat, 25 Jan 2014 16:53:32 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]