]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: fix notmuch-search-line-faces defcustom
authorMark Walters <markwalters1009@gmail.com>
Sat, 15 Oct 2016 09:40:48 +0000 (10:40 +0100)
committerDavid Bremner <david@tethera.net>
Wed, 19 Oct 2016 11:39:36 +0000 (08:39 -0300)
In commit 2a7b11b064233afc4feead876fa396e3c18a6b91 the default value
for notmuch-search-line-faces was changed so that it didn't match the
specification in the corresponding defcustom. This meant that it was
difficult for the user to customize this variable as they got a type
mismatch error.

Note anyone who had already customised this variable would not see
this bug as their customisation would match the defcustom.

emacs/notmuch.el

index 8e14692429ecc8e5740571a96a2d73fcf10f7f52..a7e0f2c178408eef2a98c8692281d40e4d6e7c97 100644 (file)
@@ -669,9 +669,16 @@ of the result."
                  (goto-char (point-min))
                  (forward-line (1- notmuch-search-target-line)))))))))
 
                  (goto-char (point-min))
                  (forward-line (1- notmuch-search-target-line)))))))))
 
+(define-widget 'notmuch--custom-face-edit 'lazy
+  "Custom face edit with a tag Edit Face"
+  ;; I could not persuage custom-face-edit to respect the :tag
+  ;; property so create a widget specially
+  :tag "Manually specify face"
+  :type 'custom-face-edit)
+
 (defcustom notmuch-search-line-faces
 (defcustom notmuch-search-line-faces
-  '(("unread" 'notmuch-search-unread-face)
-    ("flagged" 'notmuch-search-flagged-face))
+  '(("unread" notmuch-search-unread-face)
+    ("flagged" notmuch-search-flagged-face))
   "Alist of tags to faces for line highlighting in notmuch-search.
 Each element looks like (TAG . FACE).
 A thread with TAG will have FACE applied.
   "Alist of tags to faces for line highlighting in notmuch-search.
 Each element looks like (TAG . FACE).
 A thread with TAG will have FACE applied.
@@ -689,7 +696,9 @@ matching tags are merged, with earlier attributes overriding
 later. A message having both \"deleted\" and \"unread\" tags with
 the above settings would have a green foreground and blue
 background."
 later. A message having both \"deleted\" and \"unread\" tags with
 the above settings would have a green foreground and blue
 background."
-  :type '(alist :key-type (string) :value-type (custom-face-edit))
+  :type '(alist :key-type (string)
+               :value-type (radio (face :tag "Face name")
+                                   (notmuch--custom-face-edit)))
   :group 'notmuch-search
   :group 'notmuch-faces)
 
   :group 'notmuch-search
   :group 'notmuch-faces)