notmuch.el: Use let to avoid assigning to a free variable.

The dynamic scoping of emacs lisp is such that we never want to assign
to any variable unless it's something we've defined with `defvar' or
else something we're using locally via `let'.
This commit is contained in:
Carl Worth 2009-11-30 23:14:11 -08:00
parent a708ea627e
commit 7a63942577

View file

@ -1081,12 +1081,11 @@ Complete list of currently available key bindings:
(if (not notmuch-tag-face-alist) (if (not notmuch-tag-face-alist)
(add-to-list 'notmuch-search-font-lock-keywords (list (add-to-list 'notmuch-search-font-lock-keywords (list
"(\\([^)]*\\))$" '(1 'notmuch-tag-face))) "(\\([^)]*\\))$" '(1 'notmuch-tag-face)))
(progn (let ((notmuch-search-tags (mapcar 'car notmuch-tag-face-alist)))
(setq notmuch-search-tags (mapcar 'car notmuch-tag-face-alist)) (loop for notmuch-search-tag in notmuch-search-tags
(loop for notmuch-search-tag in notmuch-search-tags do (add-to-list 'notmuch-search-font-lock-keywords (list
do (add-to-list 'notmuch-search-font-lock-keywords (list (concat "([^)]*\\(" notmuch-search-tag "\\)[^)]*)$")
(concat "([^)]*\\(" notmuch-search-tag "\\)[^)]*)$") `(1 ,(cdr (assoc notmuch-search-tag notmuch-tag-face-alist))))))))
`(1 ,(cdr (assoc notmuch-search-tag notmuch-tag-face-alist))))))))
(set (make-local-variable 'font-lock-defaults) (set (make-local-variable 'font-lock-defaults)
'(notmuch-search-font-lock-keywords t))) '(notmuch-search-font-lock-keywords t)))