unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tom <adatgyujto@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: A smarter command history
Date: Sun, 26 Jan 2014 19:13:02 +0000 (UTC)	[thread overview]
Message-ID: <loom.20140126T200451-359@post.gmane.org> (raw)
In-Reply-To: 8cbefaa1-b801-4274-b279-ea75ee8bcd30@default

Drew Adams <drew.adams <at> oracle.com> writes:

> 
> Sounds like a reason _not_ to implement what you asked for:
> YAGNI, if you typically run the same grep query in the same dir.
> 

Yes, in the same directory where I ran that grep was previously.
I do a grep, check something, then do other things, then later
I want to check that grep result again (when the grep buffer
may already be gone and I'm in a different directory).

> Your reason for the request was that it is a nuisance to change
> directory:


Yes, because it's two operations then:

First, I change to that directory (usually by visiting a file
in that directory or visiting the directory). Then I retrieve
the previous grep command with C-x ESC ESC.

My point is that the directory where grep was run belongs
to the context of that operation (grep implicitly uses the
default directory when run), so if we store this operation
in the history then that important context info should be
stored as well.

This way rerunning the previous grep is simply a matter of
C-x ESC ESC. There is no need to visit a file in that 
directory first. So it's one operation instead of two.

And if I want to run that specific grep in an other directory
(not usual) then it's easy to delete the 
(let ((default-directory ...  part from the history item.




      reply	other threads:[~2014-01-26 19:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

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=loom.20140126T200451-359@post.gmane.org \
    --to=adatgyujto@gmail.com \
    --cc=emacs-devel@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).