From dd71083752fbd65c438ccccd0f413ab462cd6edb Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Wed, 9 Oct 2013 21:01:25 +0100 Subject: [PATCH] [PATCH 1/2] emacs: show: use interactive instead of current-prefix-arg --- 03/f17eb0a30cd6e21fc78c9240f060c9405b5925 | 141 ++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 03/f17eb0a30cd6e21fc78c9240f060c9405b5925 diff --git a/03/f17eb0a30cd6e21fc78c9240f060c9405b5925 b/03/f17eb0a30cd6e21fc78c9240f060c9405b5925 new file mode 100644 index 000000000..72c6649fa --- /dev/null +++ b/03/f17eb0a30cd6e21fc78c9240f060c9405b5925 @@ -0,0 +1,141 @@ +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 854DF431FC4 + for ; Wed, 9 Oct 2013 13:01:42 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.201 +X-Spam-Level: +X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, + RCVD_IN_DNSWL_LOW=-0.7] 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 Fn8C9v9jJtD1 for ; + Wed, 9 Oct 2013 13:01:36 -0700 (PDT) +Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com + [209.85.212.169]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id AFE39431FAE + for ; Wed, 9 Oct 2013 13:01:35 -0700 (PDT) +Received: by mail-wi0-f169.google.com with SMTP id cb5so1223185wib.4 + for ; Wed, 09 Oct 2013 13:01:33 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:in-reply-to:references; + bh=29xBVgZO5h8kdtTeJ1+Y5RqqWEv0MkX+r+ghEW1ixGg=; + b=oZMRkDNDFQZ2sag+LrJGn4wDM7mm6CrAmV8FsoehBcfdc8AFmoqZLkmJBubj/zadmM + nLOXMadLcwlc0aIi8n51eA0+mTCgjfqKsmfvADNWIMvjEgOMKKxto9jdeEZs+9MVOiyK + mUK57jeFciOE/ZG90XYZR2Po6irHJn5iYRqwEJCKtxLpK4ouwebWpZguUlS6yGeXPU0I + CN5huRG7N1a4rYeDLtXubCBZ1oi7f2JA5n2zExD4bXnjdO7jXyKuPpyW9DJTrnlkr9Pm + 1bjnTiSWBSjQB5WwBXU7Qoo0ntup44vidvo7xFRq0UrHj8fRCF1O+nCv2Lwxpd2/R4XC + 9i3Q== +X-Received: by 10.194.75.165 with SMTP id d5mr8408684wjw.18.1381348893343; + Wed, 09 Oct 2013 13:01:33 -0700 (PDT) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id + sh5sm18481451wic.11.1969.12.31.16.00.00 + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Wed, 09 Oct 2013 13:01:33 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH 1/2] emacs: show: use interactive instead of + current-prefix-arg +Date: Wed, 9 Oct 2013 21:01:25 +0100 +Message-Id: <1381348886-5673-2-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1381348886-5673-1-git-send-email-markwalters1009@gmail.com> +References: <1381348886-5673-1-git-send-email-markwalters1009@gmail.com> +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: Wed, 09 Oct 2013 20:01:43 -0000 + +Currently notmuch-show looks at the prefix-arg directly via +current-prefix-arg. This changes it to use the interactive +specification. +--- + emacs/notmuch-show.el | 12 +++++++----- + emacs/notmuch.el | 5 +++-- + 2 files changed, 10 insertions(+), 7 deletions(-) + +diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el +index 5d7e24b..15f9ce6 100644 +--- a/emacs/notmuch-show.el ++++ b/emacs/notmuch-show.el +@@ -1080,15 +1080,17 @@ buttons for a corresponding notmuch search." + (make-text-button (first link) (second link) + :type 'notmuch-button-type + 'action `(lambda (arg) +- (notmuch-show ,(third link))) ++ (notmuch-show ,(third link) current-prefix-arg)) + 'follow-link t + 'help-echo "Mouse-1, RET: search for this message" + 'face goto-address-mail-face))))) + + ;;;###autoload +-(defun notmuch-show (thread-id &optional parent-buffer query-context buffer-name) ++(defun notmuch-show (thread-id &optional elide-toggle parent-buffer query-context buffer-name) + "Run \"notmuch show\" with the given thread ID and display results. + ++The optional ELIDE-TOGGLE inverts the default elide behaviour. ++ + The optional PARENT-BUFFER is the notmuch-search buffer from + which this notmuch-show command was executed, (so that the + next thread from that buffer can be show when done with this +@@ -1102,7 +1104,7 @@ The optional BUFFER-NAME provides the name of the buffer in + which the message thread is shown. If it is nil (which occurs + when the command is called interactively) the argument to the + function is used." +- (interactive "sNotmuch show: ") ++ (interactive "sNotmuch show: \nP") + (let ((buffer-name (generate-new-buffer-name + (or buffer-name + (concat "*notmuch-" thread-id "*"))))) +@@ -1112,9 +1114,9 @@ function is used." + (setq notmuch-show-process-crypto notmuch-crypto-process-mime) + ;; Set the default value for + ;; `notmuch-show-elide-non-matching-messages' in this buffer. If +- ;; there is a prefix argument, invert the default. ++ ;; elide-toggle is set, invert the default. + (setq notmuch-show-elide-non-matching-messages notmuch-show-only-matching-messages) +- (if current-prefix-arg ++ (if elide-toggle + (setq notmuch-show-elide-non-matching-messages (not notmuch-show-elide-non-matching-messages))) + + (setq notmuch-show-thread-id thread-id +diff --git a/emacs/notmuch.el b/emacs/notmuch.el +index 0ff248b..7124d0a 100644 +--- a/emacs/notmuch.el ++++ b/emacs/notmuch.el +@@ -486,13 +486,14 @@ If BARE is set then do not prefix with \"thread:\"" + "Return a list of authors for the current region" + (notmuch-search-properties-in-region :subject beg end)) + +-(defun notmuch-search-show-thread () ++(defun notmuch-search-show-thread (&optional elide-toggle) + "Display the currently selected thread." +- (interactive) ++ (interactive "P") + (let ((thread-id (notmuch-search-find-thread-id)) + (subject (notmuch-search-find-subject))) + (if (> (length thread-id) 0) + (notmuch-show thread-id ++ elide-toggle + (current-buffer) + notmuch-search-query-string + ;; Name the buffer based on the subject. +-- +1.7.9.1 + -- 2.26.2