]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch-lib.el
emacs: Add support for PGP/MIME verification/decryption
[notmuch] / emacs / notmuch-lib.el
index 74b3d6d2ab9c996090934cc4f162e5a9035ec3a1..a21dc14558ffa0d982960a80e61cbcaeabc55b13 100644 (file)
@@ -87,6 +87,10 @@ the user hasn't set this variable with the old or new value."
   "Return the user.primary_email value from the notmuch configuration."
   (notmuch-config-get "user.primary_email"))
 
+(defun notmuch-user-other-email ()
+  "Return the user.primary_email value (as a list) from the notmuch configuration."
+  (split-string (notmuch-config-get "user.other_email") "\n"))
+
 (defun notmuch-kill-this-buffer ()
   "Kill the current buffer."
   (interactive)
@@ -116,6 +120,15 @@ within the current window."
       (or (memq prop buffer-invisibility-spec)
          (assq prop buffer-invisibility-spec)))))
 
+(defun notmuch-remove-if-not (predicate list)
+  "Return a copy of LIST with all items not satisfying PREDICATE removed."
+  (let (out)
+    (while list
+      (when (funcall predicate (car list))
+        (push (car list) out))
+      (setq list (cdr list)))
+    (nreverse out)))
+
 ; This lets us avoid compiling these replacement functions when emacs
 ; is sufficiently new enough to supply them alone. We do the macro
 ; treatment rather than just wrapping our defun calls in a when form
@@ -152,5 +165,10 @@ was called."
    "Return non-nil if OBJECT is a mouse click event."
    (memq (event-basic-type object) '(mouse-1 mouse-2 mouse-3 mouse-movement))))
 
+;; This variable is used only buffer local, but it needs to be
+;; declared globally first to avoid compiler warnings.
+(defvar notmuch-show-process-crypto nil)
+(make-variable-buffer-local 'notmuch-show-process-crypto)
+
 (provide 'notmuch-lib)