From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Newsgroups: gmane.emacs.devel Subject: Re: A smarter command history Date: Sun, 26 Jan 2014 19:13:02 +0000 (UTC) Message-ID: References: <8cbefaa1-b801-4274-b279-ea75ee8bcd30@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1390763612 762 80.91.229.3 (26 Jan 2014 19:13:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Jan 2014 19:13:32 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 26 20:13:40 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W7V9H-0007H4-0J for ged-emacs-devel@m.gmane.org; Sun, 26 Jan 2014 20:13:39 +0100 Original-Received: from localhost ([::1]:55936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7V9G-0005jw-HO for ged-emacs-devel@m.gmane.org; Sun, 26 Jan 2014 14:13:38 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7V99-0005ha-2f for emacs-devel@gnu.org; Sun, 26 Jan 2014 14:13:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7V93-0005YI-Nr for emacs-devel@gnu.org; Sun, 26 Jan 2014 14:13:31 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:44259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7V93-0005Y5-GQ for emacs-devel@gnu.org; Sun, 26 Jan 2014 14:13:25 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1W7V91-0007BF-T9 for emacs-devel@gnu.org; Sun, 26 Jan 2014 20:13:24 +0100 Original-Received: from 94-21-154-77.pool.digikabel.hu ([94.21.154.77]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 26 Jan 2014 20:13:23 +0100 Original-Received: from adatgyujto by 94-21-154-77.pool.digikabel.hu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 26 Jan 2014 20:13:23 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 94.21.154.77 (Opera/9.80 (Windows NT 6.1) Presto/2.12.388 Version/12.16) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:169139 Archived-At: Drew Adams 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.