From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luca Ferrari Newsgroups: gmane.emacs.help Subject: Re: repeat the last single shell command Date: Thu, 18 Jul 2013 16:01:35 +0200 Message-ID: References: <878v14t3lp.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1374156122 1805 80.91.229.3 (18 Jul 2013 14:02:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Jul 2013 14:02:02 +0000 (UTC) To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 18 16:02:04 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 1UzomS-0005EN-ED for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jul 2013 16:02:04 +0200 Original-Received: from localhost ([::1]:47801 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UzomS-0006KH-1Z for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jul 2013 10:02:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39976) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uzom1-00067p-VP for help-gnu-emacs@gnu.org; Thu, 18 Jul 2013 10:01:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uzom0-0008Ml-U9 for help-gnu-emacs@gnu.org; Thu, 18 Jul 2013 10:01:37 -0400 Original-Received: from mail-wg0-x22b.google.com ([2a00:1450:400c:c00::22b]:62469) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uzom0-0008MV-FI for help-gnu-emacs@gnu.org; Thu, 18 Jul 2013 10:01:36 -0400 Original-Received: by mail-wg0-f43.google.com with SMTP id z11so2948576wgg.22 for ; Thu, 18 Jul 2013 07:01:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=PGNqMhp0IqzTN6nZrGCxpk+ZzAccMQizLc02oEaM0wU=; b=ajqLNfmMkaxm1FErJlm9SX0QD4Vkn0gyOXI4gGFX3m4E93loy+KPYQTf1/Rxcfr62C gn8CfBB5rhztCSdF4n7KBP11+3X6vFuObQjtqEFgXjAw/l/Sh4/+BB5ldTifienMoWF3 YBPZoOVtI1MFJ+VP19mOxWv1wtDf0SJEcqIncnP7q47WpndLzQSwWWKuURzpzZIDgdoA Ak32/Xce9CxKtXWuyPXoojwlmgsYtJgc7WAOsAXyNGZW+BzM+3I6/a+TwQ50qVxf8f8V L3k684EySj3haOv7xYg9dqF6a1ybY5i6w+3Rgvd71Xytn9vAKcXDkgOVdTIAGJvhl0B8 D0Jg== X-Received: by 10.194.87.9 with SMTP id t9mr9100888wjz.39.1374156095432; Thu, 18 Jul 2013 07:01:35 -0700 (PDT) Original-Received: by 10.194.8.39 with HTTP; Thu, 18 Jul 2013 07:01:35 -0700 (PDT) In-Reply-To: <878v14t3lp.fsf@thinkpad.tsdh.de> X-Google-Sender-Auth: WQPlHThQk2jUylecG1e0xya7oOk X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::22b 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:92233 Archived-At: On Thu, Jul 18, 2013 at 3:11 PM, Tassilo Horn wrote: > --8<---------------cut here---------------start------------->8--- > (defvar th-last-shell-command) > > (defadvice shell-command (before th-capture-shell-command > (command &optional output-buffer error-buffer) > activate) > (setq th-last-shell-command (list command output-buffer error-buffer))) > > (defun th-repeat-last-shell-command () > (interactive) > (if th-last-shell-command > (apply #'shell-command th-last-shell-command) > (message "There's no last shell command!"))) > --8<---------------cut here---------------end--------------->8--- > Thank you Tassilo and Nicolas, it is clear I have to customize myself the behavior and you both provided me good advices. Luca