]> git.notmuchmail.org Git - notmuch/commit
emacs: Use text properties instead of overlays for tag coloring
authorAustin Clements <amdragon@MIT.EDU>
Sat, 21 Jul 2012 17:37:06 +0000 (13:37 -0400)
committerDavid Bremner <bremner@debian.org>
Tue, 24 Jul 2012 12:04:38 +0000 (09:04 -0300)
commit60ebc84945731e37d6cbec19ce51c08c408b49e8
tree91bfcdc57c1323ca3100370786f99390e5840646
parentae30f33093ebca63f8a18fff7054ac147898af94
emacs: Use text properties instead of overlays for tag coloring

Previously, tag-based search result highlighting was done by creating
an overlay over each search result.  However, overlays have annoying
front- and rear-advancement semantics that make it difficult to
manipulate text at their boundaries, which the next patch will do.
They also have performance problems (creating an overlay is linear in
the number of overlays between point and the new overlay, making
highlighting a search buffer quadratic in the number of results).

Text properties have neither problem.  However, text properties make
it more difficult to apply multiple faces since, unlike with overlays,
a given character can only have a single 'face text property.  Hence,
we introduce a utility function that combines faces into any existing
'face text properties.

Using this utility function, it's straightforward to apply all of the
appropriate tag faces in notmuch-search-color-line.
emacs/notmuch-lib.el
emacs/notmuch.el