From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: repeat the last single shell command Date: Thu, 18 Jul 2013 10:45:58 -0400 Organization: A noiseless patient Spider Message-ID: References: <87fvvcxcn1.fsf@yahoo.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 X-Trace: ger.gmane.org 1374159023 4697 80.91.229.3 (18 Jul 2013 14:50:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Jul 2013 14:50:23 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 18 16:50:25 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 1UzpXF-0008Lg-4M for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jul 2013 16:50:25 +0200 Original-Received: from localhost ([::1]:49876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzpXE-0002mY-Qk for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jul 2013 10:50:24 -0400 X-Received: by 10.180.187.238 with SMTP id fv14mr14037615wic.0.1374158759034; Thu, 18 Jul 2013 07:45:59 -0700 (PDT) Original-Path: usenet.stanford.edu!mf3no2212361wib.1!news-out.google.com!b5ni67609wiz.1!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!195.71.90.67.MISMATCH!news.unit0.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!barmar.motzarella.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 28 Injection-Info: barmar.motzarella.org; posting-host="2be9e9f5dd9af768b8861af71b85fc28"; logging-data="14962"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+v9tS4+ibFOHzCMLRYuT5H" User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Cancel-Lock: sha1:SjQ0m1/05ONHjOU/Jg7abUjlyMk= Original-Xref: usenet.stanford.edu gnu.emacs.help:199971 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:92237 Archived-At: In article , Tassilo Horn wrote: > Nicolas Richard writes: > > >> 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) > > Nice idea, but then you can't enter ! anymore in a shell command. It's not too often that one needs that character in shell one-liners. But if you do, you can always type it with C-q !. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***