From: David Bremner Date: Thu, 17 Nov 2016 12:25:08 +0000 (-0400) Subject: Merge branch 'release' X-Git-Tag: 0.24_rc0~87 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=60ac94fe58635f9c40724afa0f35965fc9ff1afc;hp=-c Merge branch 'release' Updates for 0.23.2 --- 60ac94fe58635f9c40724afa0f35965fc9ff1afc diff --combined emacs/Makefile.local index 6896ff90,dfa7c1f1..90a57cca --- a/emacs/Makefile.local +++ b/emacs/Makefile.local @@@ -3,6 -3,7 +3,7 @@@ dir := emacs emacs_sources := \ $(dir)/notmuch-lib.el \ + $(dir)/notmuch-compat.el \ $(dir)/notmuch-parser.el \ $(dir)/notmuch.el \ $(dir)/notmuch-query.el \ @@@ -20,14 -21,19 +21,20 @@@ $(dir)/notmuch-print.el \ $(dir)/notmuch-version.el \ $(dir)/notmuch-jump.el \ - $(dir)/notmuch-company.el + $(dir)/notmuch-company.el \ + $(dir)/notmuch-draft.el $(dir)/notmuch-version.el: $(dir)/Makefile.local version.stamp $(dir)/notmuch-version.el: $(srcdir)/$(dir)/notmuch-version.el.tmpl @sed -e 's/%AG%/Generated file (from $( $@ + $(dir)/notmuch-pkg.el: $(srcdir)/$(dir)/notmuch-pkg.el.tmpl + @sed -e 's/%AG%/Generated file (from $( $@ + + all: $(dir)/notmuch-pkg.el + install-emacs: $(dir)/notmuch-pkg.el emacs_images := \ $(srcdir)/$(dir)/notmuch-logo.png @@@ -85,4 -91,4 +92,4 @@@ endi mkdir -p "$(DESTDIR)$(emacsetcdir)" install -m0644 $(emacs_images) "$(DESTDIR)$(emacsetcdir)" - CLEAN := $(CLEAN) $(emacs_bytecode) $(dir)/notmuch-version.el + CLEAN := $(CLEAN) $(emacs_bytecode) $(dir)/notmuch-version.el $(dir)/notmuch-pkg.el diff --combined emacs/notmuch-address.el index 5b2beefe,34793dbe..b3c56cfa --- a/emacs/notmuch-address.el +++ b/emacs/notmuch-address.el @@@ -98,17 -98,6 +98,17 @@@ to know how address selection is made b :group 'notmuch-send :group 'notmuch-external) +(defcustom notmuch-address-post-completion-functions nil + "Functions called after completing address. + +The completed address is passed as an argument to each function. +Note that this hook will be invoked for completion in headers +matching `notmuch-address-completion-headers-regexp'. +" + :type 'hook + :group 'notmuch-address + :group 'notmuch-hooks) + (defun notmuch-address-selection-function (prompt collection initial-input) "Call (`completing-read' PROMPT COLLECTION nil nil INITIAL-INPUT 'notmuch-address-history)" @@@ -147,11 -136,11 +147,11 @@@ toggles the setting in this buffer. (interactive) (if (local-variable-p 'notmuch-address-command) (kill-local-variable 'notmuch-address-command) - (setq-local notmuch-address-command 'internal)) + (notmuch-setq-local notmuch-address-command 'internal)) (if (boundp 'company-idle-delay) (if (local-variable-p 'company-idle-delay) (kill-local-variable 'company-idle-delay) - (setq-local company-idle-delay nil)))) + (notmuch-setq-local company-idle-delay nil)))) (defun notmuch-address-matching (substring) "Returns a list of completion candidates matching SUBSTRING. @@@ -205,20 -194,12 +205,20 @@@ external commands. (t (funcall notmuch-address-selection-function (format "Address (%s matches): " num-options) - (cdr options) (car options)))))) + ;; We put the first match as the initial + ;; input; we put all the matches as + ;; possible completions, moving the + ;; first match to the end of the list + ;; makes cursor up/down in the list work + ;; better. + (append (cdr options) (list (car options))) + (car options)))))) (if chosen (progn (push chosen notmuch-address-history) (delete-region beg end) - (insert chosen)) + (insert chosen) + (run-hook-with-args 'notmuch-address-post-completion-functions chosen)) (message "No matches.") (ding)))) (t nil))) diff --combined emacs/notmuch-company.el index b0f97821,5d75c145..ebe2c084 --- a/emacs/notmuch-company.el +++ b/emacs/notmuch-company.el @@@ -28,6 -28,7 +28,7 @@@ ;;; Code: (eval-when-compile (require 'cl)) + (require 'notmuch-lib) (defvar notmuch-company-last-prefix nil) (make-variable-buffer-local 'notmuch-company-last-prefix) @@@ -53,7 -54,7 +54,7 @@@ ;; internal completion) can still be accessed via standard company ;; functions, e.g., company-complete. (unless (eq notmuch-address-command 'internal) - (setq-local company-idle-delay nil))) + (notmuch-setq-local company-idle-delay nil))) ;;;###autoload (defun notmuch-company (command &optional arg &rest _ignore) @@@ -86,7 -87,6 +87,7 @@@ (match (if (string-match notmuch-company-last-prefix arg) (match-end 0) 0)) + (post-completion (run-hook-with-args 'notmuch-address-post-completion-functions arg)) (no-cache t)))) diff --combined emacs/notmuch-lib.el index 1f0d1678,23bd81c1..5dc67970 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@@ -27,6 -27,7 +27,7 @@@ (require 'mm-view) (require 'mm-decode) (require 'cl) + (require 'notmuch-compat) (unless (require 'notmuch-version nil t) (defconst notmuch-emacs-version "unknown" @@@ -57,10 -58,6 +58,10 @@@ (custom-add-to-group 'notmuch-send 'message 'custom-group) +(defgroup notmuch-tag nil + "Tags and tagging in Notmuch." + :group 'notmuch) + (defgroup notmuch-crypto nil "Processing and display of cryptographic MIME parts." :group 'notmuch) @@@ -151,7 -148,6 +152,7 @@@ For example, if you wanted to remove a (define-key map "z" 'notmuch-tree) (define-key map "m" 'notmuch-mua-new-mail) (define-key map "=" 'notmuch-refresh-this-buffer) + (define-key map (kbd "M-=") 'notmuch-refresh-all-buffers) (define-key map "G" 'notmuch-poll-and-refresh-this-buffer) (define-key map "j" 'notmuch-jump-search) map) @@@ -418,8 -414,10 +419,8 @@@ of its command symbol. "Refresh the current buffer." (interactive) (when notmuch-buffer-refresh-function - (if (commandp notmuch-buffer-refresh-function) - ;; Pass prefix argument, etc. - (call-interactively notmuch-buffer-refresh-function) - (funcall notmuch-buffer-refresh-function)))) + ;; Pass prefix argument, etc. + (call-interactively notmuch-buffer-refresh-function))) (defun notmuch-poll-and-refresh-this-buffer () "Invoke `notmuch-poll' to import mail, then refresh the current buffer." @@@ -427,21 -425,6 +428,21 @@@ (notmuch-poll) (notmuch-refresh-this-buffer)) +(defun notmuch-refresh-all-buffers () + "Invoke `notmuch-refresh-this-buffer' on all notmuch major-mode buffers. + +The buffers are silently refreshed, i.e. they are not forced to +be displayed." + (interactive) + (dolist (buffer (buffer-list)) + (let ((buffer-mode (buffer-local-value 'major-mode buffer))) + (when (memq buffer-mode '(notmuch-show-mode + notmuch-tree-mode + notmuch-search-mode + notmuch-hello-mode)) + (with-current-buffer buffer + (notmuch-refresh-this-buffer)))))) + (defun notmuch-prettify-subject (subject) ;; This function is used by `notmuch-search-process-filter' which ;; requires that we not disrupt its' matching state.