X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=emacs%2Fnotmuch-lib.el;h=20d990dfc19ab73d2c49e6c2436af19c161ac7bd;hp=aa25513a3b6500b1f36ab12e16d252f2cce2aca5;hb=d5dcfc714e13256cb2084b30d3506a4abc990a51;hpb=889dda3731dcdf779cef347576c5d59d1923d26b diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index aa25513a..20d990df 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'.") @@ -269,6 +283,21 @@ current buffer, if possible." (loop for (key value . rest) on plist by #'cddr collect (cons (intern (substring (symbol-name key) 1)) value))) +(defun notmuch-combine-face-text-property (start end face) + "Combine FACE into the 'face text property between START and END. + +This function combines FACE with any existing faces between START +and END. Attributes specified by FACE take precedence over +existing attributes. FACE must be a face name (a symbol or +string), a property list of face attributes, or a list of these." + + (let ((pos start)) + (while (< pos end) + (let ((cur (get-text-property pos 'face)) + (next (next-single-property-change pos 'face nil end))) + (put-text-property pos next 'face (cons face cur)) + (setq pos next))))) + ;; Compatibility functions for versions of emacs before emacs 23. ;; ;; Both functions here were copied from emacs 23 with the following copyright: