From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.help Subject: Re: repeat the last single shell command Date: Thu, 18 Jul 2013 14:42:42 +0200 Message-ID: <87fvvcxcn1.fsf@yahoo.fr> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1374151370 9054 80.91.229.3 (18 Jul 2013 12:42:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Jul 2013 12:42:50 +0000 (UTC) Cc: yi lu , help-gnu-emacs To: Luca Ferrari Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 18 14:42:50 2013 Return-path: Envelope-to: geh-help-gnu-emacs@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 1UznXk-0000pY-Pl for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jul 2013 14:42:48 +0200 Original-Received: from localhost ([::1]:57035 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UznXk-0000Mj-AR for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jul 2013 08:42:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UznXR-0000F3-DV for help-gnu-emacs@gnu.org; Thu, 18 Jul 2013 08:42:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UznXQ-00069u-0H for help-gnu-emacs@gnu.org; Thu, 18 Jul 2013 08:42:29 -0400 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:52996) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UznXP-00069f-RB for help-gnu-emacs@gnu.org; Thu, 18 Jul 2013 08:42:27 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap8EAFjh51GkD4Nx/2dsb2JhbABaxEeBJXSCIwEBBAF5BQsIAw4KCSUPAQQNPBOHfQEDCQalcodLAUoNA4hbjRCCageDewOVc4FphhCGF4UmgxQ6 Original-Received: from geodiff-mac3.ulb.ac.be (HELO geodiff-mac3) ([164.15.131.113]) by smtp.ulb.ac.be with ESMTP; 18 Jul 2013 14:42:25 +0200 In-Reply-To: (Luca Ferrari's message of "Thu, 18 Jul 2013 11:55:40 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 164.15.128.112 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:92228 Archived-At: Luca Ferrari writes: > On Thu, Jul 18, 2013 at 11:31 AM, yi lu wrote: >> Will "Up" arrow instead of "M-p" work? >> > > Yes, it works, but that's pretty much the same of M-p. I'd like to > know if there's some shortcut, let's say like M-!!, to immediatly > repeat the last command. Otherwise I have to define a function. I think M-! M-p RET is simple enough, but you can do this: (defun yf/last-history-element-and-exit () "Select the last history element." (interactive) (goto-history-element 1) (exit-minibuffer)) (define-key minibuffer-local-shell-command-map (kbd "!") 'yf/last-history-element-and-exit) then M-! ! does what M-! M-p RET would do. -- Nico.