From 455cec85f8e68279eedbcbd2dae947e7c4b8b61f Mon Sep 17 00:00:00 2001 From: Sebastian Fischmeister Date: Wed, 17 Sep 2014 08:47:53 +2000 Subject: [PATCH] Better support for helm in the address completion --- 70/e952aec630bd10a23f78a5f31086e592a197aa | 102 ++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 70/e952aec630bd10a23f78a5f31086e592a197aa diff --git a/70/e952aec630bd10a23f78a5f31086e592a197aa b/70/e952aec630bd10a23f78a5f31086e592a197aa new file mode 100644 index 000000000..29cbe996c --- /dev/null +++ b/70/e952aec630bd10a23f78a5f31086e592a197aa @@ -0,0 +1,102 @@ +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 85BC5431FBC + for ; Tue, 16 Sep 2014 05:53:15 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -2.3 +X-Spam-Level: +X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_MED=-2.3] 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 lBUQcDxCs3O2 for ; + Tue, 16 Sep 2014 05:53:09 -0700 (PDT) +X-Greylist: delayed 312 seconds by postgrey-1.32 at olra; + Tue, 16 Sep 2014 05:53:09 PDT +Received: from connect.uwaterloo.ca (connhub2.connect.uwaterloo.ca + [129.97.149.119]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 99E9E431FAE + for ; Tue, 16 Sep 2014 05:53:09 -0700 (PDT) +Received: from CONNHUB4.connect.uwaterloo.ca (129.97.149.122) by + connhub2.connect.uwaterloo.ca (129.97.149.119) with Microsoft SMTP + Server (TLS) id 14.3.195.1; Tue, 16 Sep 2014 08:47:54 -0400 +Received: from uwaterloo.ca (188.20.152.214) by connhub4.connect.uwaterloo.ca + (129.97.149.122) with Microsoft SMTP Server (TLS) id 14.3.195.1; + Tue, 16 Sep 2014 08:47:53 -0400 +From: Sebastian Fischmeister +To: +Subject: Better support for helm in the address completion +User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.3.1 + (x86_64-unknown-linux-gnu) +X-Homepage: http://esg.uwaterloo.ca +Date: Tue, 16 Sep 2014 08:47:53 -0400 +Message-ID: <87vbonhgwe.fsf@uwaterloo.ca> +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +Reply-To: sfischme@uwaterloo.ca +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Tue, 16 Sep 2014 12:53:15 -0000 + +Hi, + +I noticed that the completing-read in notmuch-address-selection-function +was eating the first returned address when using helm. Here's a patch +that fixes it. The defaults are as they used to be. + +For helm use: + +(setq notmuch-address-suggest-initial-match nil) + +If you don't want to enter a new address in the selection (with helm) +use: + +(setq notmuch-address-require-match t) + + Sebastian + +diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el +index fa65cd5..d9b66cd 100644 +--- a/emacs/notmuch-address.el ++++ b/emacs/notmuch-address.el +@@ -42,11 +42,25 @@ to know how address selection is made by default." + :group 'notmuch-send + :group 'notmuch-external) + ++(defcustom notmuch-address-suggest-initial-match t ++ "Pass an initial match to the address completing read." ++ :type 'boolean ++ :group 'notmuch-send) ++ ++(defcustom notmuch-address-require-match nil ++ "Require a match in the address selection in `notmuch-address-selection-function'." ++ :type 'boolean ++ :group 'notmuch-send) ++ + (defun notmuch-address-selection-function (prompt collection initial-input) + "Call (`completing-read' + PROMPT COLLECTION nil nil INITIAL-INPUT 'notmuch-address-history)" + (completing-read +- prompt collection nil nil initial-input 'notmuch-address-history)) ++ prompt ++ (if notmuch-address-suggest-initial-match 'collection (list initial-input collection)) ++ nil notmuch-address-require-match ++ (if notmuch-address-suggest-initial-match 'initial-input nil) ++ 'notmuch-address-history)) + + (defvar notmuch-address-message-alist-member + '("^\\(Resent-\\)?\\(To\\|B?Cc\\|Reply-To\\|From\\|Mail-Followup-To\\|Mail-Copies-To\\):" -- 2.26.2