From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: repeat the last single shell command Date: Thu, 18 Jul 2013 16:18:58 +0200 Message-ID: <87vc48rlwt.fsf@thinkpad.tsdh.de> References: <87fvvcxcn1.fsf@yahoo.fr> <874nbst2zs.fsf@thinkpad.tsdh.de> <877ggox9e9.fsf@yahoo.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1374157153 14809 80.91.229.3 (18 Jul 2013 14:19:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Jul 2013 14:19:13 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Nicolas Richard Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 18 16:19:14 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 1Uzp34-0006fh-Hd for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jul 2013 16:19:14 +0200 Original-Received: from localhost ([::1]:34178 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uzp34-000747-4M for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jul 2013 10:19:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uzp2t-00073o-07 for help-gnu-emacs@gnu.org; Thu, 18 Jul 2013 10:19:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uzp2q-0005qQ-7n for help-gnu-emacs@gnu.org; Thu, 18 Jul 2013 10:19:02 -0400 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:37225) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uzp2q-0005pv-21 for help-gnu-emacs@gnu.org; Thu, 18 Jul 2013 10:19:00 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id 864603D600C; Thu, 18 Jul 2013 16:18:59 +0200 (CEST) X-Virus-Scanned: amavisd-new at uni-koblenz.de Original-Received: from deliver.uni-koblenz.de ([127.0.0.1]) by localhost (deliver.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kZGcco4X6KXN; Thu, 18 Jul 2013 16:18:59 +0200 (CEST) X-CHKRCPT: Envelopesender noch tsdh@gnu.org Original-Received: from thinkpad.tsdh.de (tsdh.uni-koblenz.de [141.26.67.142]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTPSA id 3B0CF3D6006; Thu, 18 Jul 2013 16:18:59 +0200 (CEST) In-Reply-To: <877ggox9e9.fsf@yahoo.fr> (Nicolas Richard's message of "Thu, 18 Jul 2013 15:52:46 +0200") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 141.26.64.15 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:92235 Archived-At: Nicolas Richard writes: >> Here's an improved version that does handle ! (or whatever char >> you've bound `yf/last-history-element-and-exit' to) only special if >> it's the first char entered at the prompt. > > Agreed. Perhaps one of (eq last-command 'shell-command) or (equal "" > (minibuffer-contents-no-properties)) might be used as a more specific > test too, e.g. : That ties it to `shell-command'. You could bind the other version also in `minibuffer-local-map', and then `M-: !' would reevaluate the last lisp expression, `M-! !' would reexecute the last shell command, `M-x !' would execute the last complex command, `C-x C-f !' would find the last found file, `C-x b !' would switch to the last switched to buffer, etc. Bye, Tassilo