X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-lib.el;h=69867ada9a6a68ff7cb7851e25cbb7b232c1d10c;hb=b7f7b573e4bf3d00d9e887bc1aee264722d22778;hp=30db58ffbff32c2d703c22f3a21427402a08b20d;hpb=60ebc84945731e37d6cbec19ce51c08c408b49e8;p=notmuch diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 30db58ff..69867ada 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -24,7 +24,7 @@ (require 'mm-view) (require 'mm-decode) (require 'json) -(eval-when-compile (require 'cl)) +(require 'cl) (defvar notmuch-command "notmuch" "Command to run the notmuch binary.") @@ -82,6 +82,20 @@ :type '(alist :key-type string :value-type string) :group 'notmuch-hello) +(defcustom notmuch-archive-tags '("-inbox") + "List of tag changes to apply to a message or a thread when it is archived. + +Tags starting with \"+\" (or not starting with either \"+\" or +\"-\") in the list will be added, and tags starting with \"-\" +will be removed from the message or thread being archived. + +For example, if you wanted to remove an \"inbox\" tag and add an +\"archived\" tag, you would set: + (\"-inbox\" \"+archived\")" + :type '(repeat string) + :group 'notmuch-search + :group 'notmuch-show) + (defvar notmuch-folders nil "Deprecated name for what is now known as `notmuch-saved-searches'.") @@ -240,6 +254,19 @@ the given type." (or (plist-get part :content) (notmuch-get-bodypart-internal (notmuch-id-to-query (plist-get msg :id)) nth process-crypto))) +;; Workaround: The call to `mm-display-part' below triggers a bug in +;; Emacs 24 if it attempts to use the shr renderer to display an HTML +;; part with images in it (demonstrated in 24.1 and 24.2 on Debian and +;; Fedora 17, though unreproducable in other configurations). +;; `mm-shr' references the variable `gnus-inhibit-images' without +;; first loading gnus-art, which defines it, resulting in a +;; void-variable error. Hence, we advise `mm-shr' to ensure gnus-art +;; is loaded. +(if (>= emacs-major-version 24) + (defadvice mm-shr (before load-gnus-arts activate) + (require 'gnus-art nil t) + (ad-disable-advice 'mm-shr 'before 'load-gnus-arts))) + (defun notmuch-mm-display-part-inline (msg part nth content-type process-crypto) "Use the mm-decode/mm-view functions to display a part in the current buffer, if possible."