unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Matt Armstrong <marmstrong@google.com>
To: notmuch@notmuchmail.org
Subject: [PATCH] emacs: implement notmuch-search-color-line with dolist.
Date: Sun, 14 Aug 2016 15:13:00 -0700	[thread overview]
Message-ID: <1471212780-11993-1-git-send-email-marmstrong@google.com> (raw)

While passing a lambda to mapc is idiomatic elisp, dolist is easier
to understand, and there are a few other calls to it in this file.
---
 emacs/notmuch.el | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index 43d56f7..6307b37 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -700,13 +700,12 @@ background."
 
 (defun notmuch-search-color-line (start end line-tag-list)
   "Colorize lines in `notmuch-show' based on tags."
-  (mapc (lambda (elem)
-	  (let ((tag (car elem))
-		(attributes (cdr elem)))
-	    (when (member tag line-tag-list)
-	      (notmuch-apply-face nil attributes nil start end))))
-	;; Reverse the list so earlier entries take precedence
-	(reverse notmuch-search-line-faces)))
+  ;; Reverse the list so earlier entries take precedence
+  (dolist (elem (reverse notmuch-search-line-faces))
+    (let ((tag (car elem))
+	  (face (cdr elem)))
+      (when (member tag line-tag-list)
+	(notmuch-apply-face nil face nil start end)))))
 
 (defun notmuch-search-author-propertize (authors)
   "Split `authors' into matching and non-matching authors and
-- 
2.8.0.rc3.226.g39d4020

             reply	other threads:[~2016-08-14 22:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-14 22:13 Matt Armstrong [this message]
2016-09-12 11:13 ` [PATCH] emacs: implement notmuch-search-color-line with dolist David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1471212780-11993-1-git-send-email-marmstrong@google.com \
    --to=marmstrong@google.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).