From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 6DFC56DE1452 for ; Sat, 24 Oct 2015 10:44:23 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.098 X-Spam-Level: X-Spam-Status: No, score=0.098 tagged_above=-999 required=5 tests=[AWL=0.098] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LHlEEV5coH3H for ; Sat, 24 Oct 2015 10:44:21 -0700 (PDT) Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224]) by arlo.cworth.org (Postfix) with ESMTPS id 9F07A6DE1034 for ; Sat, 24 Oct 2015 10:44:21 -0700 (PDT) Received: from remotemail by gitolite.debian.net with local (Exim 4.80) (envelope-from ) id 1Zq2q4-0001Im-An; Sat, 24 Oct 2015 17:42:44 +0000 Received: (nullmailer pid 32260 invoked by uid 1000); Sat, 24 Oct 2015 17:41:28 -0000 From: David Bremner To: Mark Walters , notmuch@notmuchmail.org Subject: [PATCH 1/3] emacs: replace use of notmuch-address-message-insinuate Date: Sat, 24 Oct 2015 14:41:22 -0300 Message-Id: <1445708484-32189-2-git-send-email-david@tethera.net> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1445708484-32189-1-git-send-email-david@tethera.net> References: <1445702019-10638-1-git-send-email-markwalters1009@gmail.com> <1445708484-32189-1-git-send-email-david@tethera.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.20 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: Sat, 24 Oct 2015 17:44:23 -0000 This allows e.g. Gnus users to load this file without changing message-mode behaviour. This will disable completion for those that did not customize the variable but relied on the existence of a file named "notmuch-addresses" in their path. In the next commit the default behaviour will change to use a "workalike" internal completion mechanism. --- emacs/notmuch-address.el | 20 +++++--------------- emacs/notmuch-mua.el | 7 +++++-- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el index fde3c1b..39200ef 100644 --- a/emacs/notmuch-address.el +++ b/emacs/notmuch-address.el @@ -23,11 +23,13 @@ ;; -(defcustom notmuch-address-command "notmuch-addresses" +(defcustom notmuch-address-command nil "The command which generates possible addresses. It must take a single argument and output a list of possible matches, one per -line." - :type 'string +line. The default value of nil disables address completion." + :type '(radio + (const :tag "Disable address completion" nil) + (string :tag "Use external completion command" "notmuch-addresses")) :group 'notmuch-send :group 'notmuch-external) @@ -54,11 +56,6 @@ to know how address selection is made by default." (defvar notmuch-address-history nil) -(defun notmuch-address-message-insinuate () - (unless (memq notmuch-address-message-alist-member message-completion-alist) - (setq message-completion-alist - (push notmuch-address-message-alist-member message-completion-alist)))) - (defun notmuch-address-options (original) (process-lines notmuch-address-command original)) @@ -109,11 +106,4 @@ to know how address selection is made by default." (not (file-directory-p bin)))) (throw 'found-command bin)))))))) -;; If we can find the program specified by `notmuch-address-command', -;; insinuate ourselves into `message-mode'. -(when (notmuch-address-locate-command notmuch-address-command) - (notmuch-address-message-insinuate)) - -;; - (provide 'notmuch-address) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 57465b2..6cc9656 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -269,7 +269,11 @@ Note that these functions use `mail-citation-hook' if that is non-nil." (set-buffer-modified-p nil)) (define-derived-mode notmuch-message-mode message-mode "Message[Notmuch]" - "Notmuch message composition mode. Mostly like `message-mode'") + "Notmuch message composition mode. Mostly like `message-mode'" + (when notmuch-address-command + (unless (memq notmuch-address-message-alist-member message-completion-alist) + (setq message-completion-alist + (push notmuch-address-message-alist-member message-completion-alist))))) (define-key notmuch-message-mode-map (kbd "C-c C-c") #'notmuch-mua-send-and-exit) (define-key notmuch-message-mode-map (kbd "C-c C-s") #'notmuch-mua-send) @@ -296,7 +300,6 @@ OTHER-ARGS are passed through to `message-mail'." (message-hide-headers) (set-buffer-modified-p nil) (notmuch-mua-maybe-set-window-dedicated) - (message-goto-to)) (defcustom notmuch-identities nil -- 2.6.1