From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Newsgroups: gmane.emacs.devel Subject: A smarter command history Date: Sat, 25 Jan 2014 16:53:32 +0000 (UTC) Message-ID: 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 1390668856 13323 80.91.229.3 (25 Jan 2014 16:54:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Jan 2014 16:54:16 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 25 17:54:23 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 1W76Uw-0000QJ-UB for ged-emacs-devel@m.gmane.org; Sat, 25 Jan 2014 17:54:23 +0100 Original-Received: from localhost ([::1]:51800 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W76Uw-0002UM-Ix for ged-emacs-devel@m.gmane.org; Sat, 25 Jan 2014 11:54:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W76Um-0002UF-Rc for emacs-devel@gnu.org; Sat, 25 Jan 2014 11:54:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W76Uf-0005cE-IX for emacs-devel@gnu.org; Sat, 25 Jan 2014 11:54:12 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:33720) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W76Uf-0005c4-B8 for emacs-devel@gnu.org; Sat, 25 Jan 2014 11:54:05 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1W76Uc-0000Hq-Po for emacs-devel@gnu.org; Sat, 25 Jan 2014 17:54:02 +0100 Original-Received: from 195-38-103-201.pool.digikabel.hu ([195.38.103.201]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 25 Jan 2014 17:54:02 +0100 Original-Received: from adatgyujto by 195-38-103-201.pool.digikabel.hu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 25 Jan 2014 17:54:02 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 27 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: 195.38.103.201 (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:169065 Archived-At: 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.