patch: notmuch-mua.el -- message-hidden-headers

Subject: patch: notmuch-mua.el -- message-hidden-headers

Date: Sun, 31 Jul 2011 00:46:57 +0300

To: notmuch@notmuchmail.org

Cc:

From: Tomi Ollila


notmuch-mua.el fails to byte-compile on emacs 22.2.1

The reason is bug in function notmuch-mua-add-more-hidden-headers;
on emacs 23.x it compiles ok, but works incorrectly: The check
which check whether the header is there already always returns nil.
Examples:

(setq foo (list "x" "foo" "bar"))

(member "foo" 'foo)

returns nil,

(member "foo" foo)

returns list ("foo" bar"), as expected.

the former on emacs 22.2.1; backtrace buffer appears with content:

Debugger entered--Lisp error: (wrong-type-argument listp foo)
  member("foo" foo)
  eval((member "foo" (quote foo)))
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp)

patch to fix this:

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 274c5da..8824b08 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -65,7 +65,7 @@ list."
 (defun notmuch-mua-add-more-hidden-headers ()
   "Add some headers to the list that are hidden by default."
   (mapc (lambda (header)
-         (when (not (member header 'message-hidden-headers))
+         (when (not (member header message-hidden-headers))
            (push header message-hidden-headers)))
        notmuch-mua-hidden-headers))

Tomi

Thread: