From 05a7d9d0871ad59045612726a29f80bdbc1fca16 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Fri, 31 May 2013 11:08:52 +0300 Subject: [PATCH] Re: [PATCH] emacs: show: change emacs interactive pipe message. --- a0/3d4a9ba7576b479b45536994a9c60a77503250 | 105 ++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 a0/3d4a9ba7576b479b45536994a9c60a77503250 diff --git a/a0/3d4a9ba7576b479b45536994a9c60a77503250 b/a0/3d4a9ba7576b479b45536994a9c60a77503250 new file mode 100644 index 000000000..94623ff69 --- /dev/null +++ b/a0/3d4a9ba7576b479b45536994a9c60a77503250 @@ -0,0 +1,105 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 1AF36431FD9 + for ; Fri, 31 May 2013 01:09:11 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id ytik9sNYotWA for ; + Fri, 31 May 2013 01:09:03 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 9757B431FC3 + for ; Fri, 31 May 2013 01:09:03 -0700 (PDT) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 90261100093; + Fri, 31 May 2013 11:08:52 +0300 (EEST) +From: Tomi Ollila +To: Mark Walters , notmuch@notmuchmail.org +Subject: Re: [PATCH] emacs: show: change emacs interactive pipe message. +In-Reply-To: <1369944667-22705-1-git-send-email-markwalters1009@gmail.com> +References: <1369944667-22705-1-git-send-email-markwalters1009@gmail.com> +User-Agent: Notmuch/0.15.2+115~g12cf6af (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 31 May 2013 08:09:11 -0000 + +On Thu, May 30 2013, Mark Walters wrote: + +> Previously the query string for piping a message to a command was +> "Pipe message to command: " regardless of whether the function was +> called with a prefix argument (which pipes all open messages to the +> command). This patch modifies the `interactive' command to reflect +> this. +> --- +> It has irritated me for a while that I couldn't tell if I had +> remembered to press c-u before piping messages to git am etc. This +> fixes that. There may be other better ways: suggestions welcome! + +Your implementation seems to match the lines in + +http://stackoverflow.com/questions/2215298/emacs-interactive-function-with-optional-numeric-prefix + +What is that extra space you added to the following line doing there ? ;/ + +> +> Best wishes +> +> Mark + +Tomi + + +> +> emacs/notmuch-show.el | 7 +++++-- +> 1 file changed, 5 insertions(+), 2 deletions(-) +> +> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el +> index 75fa7c8..2fc818f 100644 +> --- a/emacs/notmuch-show.el +> +++ b/emacs/notmuch-show.el +> @@ -1716,8 +1716,11 @@ to stdout or stderr will appear in the *notmuch-pipe* buffer. +> When invoked with a prefix argument, the command will receive all +> open messages in the current thread (formatted as an mbox) rather +> than only the current message." +> - (interactive "P\nsPipe message to command: ") +> - (let (shell-command) +> + (interactive (let ((query-string (if current-prefix-arg +> + "Pipe all open messages to command: " +> + "Pipe message to command: "))) +> + (list current-prefix-arg (read-string query-string)))) +> + (let (shell-command) +> (if entire-thread +> (setq shell-command +> (concat notmuch-command " show --format=mbox --exclude=false " +> -- +> 1.7.10.4 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2