aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs/notmuch-tree.el
Commit message (Collapse)AuthorAge
* emacs: tree/show remove duplicate functionGravatar Mark Walters2014-07-16
| | | | | | | tree overrides notmuch-show-get-prop so that it can use many of the utility function directly. Now that tree is in mainline the version from tree can be moved to show and the original overridden show version dropped.
* emacs: set default in notmuch-read-queryGravatar Mark Walters2014-07-15
| | | | | | | | | | | | | | This adds the current query as a "default value" to notmuch-read-qeury. The default value is available via a down-arrow as opposed to history which is available from the up arrow. Note if a user presses return in the minibuffer this value is not returned. The implementation is simple but notmuch-read-query could be called via notmuch-search/notmuch-tree etc from any buffer so it makes sense to put the decision of how to extract the current query in notmuch-read-query rather than in each of the callers.
* emacs: tree: use orig-tags in searchGravatar Mark Walters2014-03-24
| | | | | | | This uses the recent functionality to show the tag changes in the tree buffer. Currently this is only used to show changes the tree buffer makes itself: i.e., it does not make display any changes reflecting tagging done by other notmuch-buffers.
* emacs: show: mark tags changed since buffer loadedGravatar Mark Walters2014-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows (and requires) the original-tags to be passed along with the current-tags to be passed to notmuch-tag-format-tags. This allows the tag formatting to show added and deleted tags.By default a removed tag is displayed with strike-through in red (if strike-through is not available, eg on a terminal, inverse video is used instead) and an added tag is displayed underlined in green. If the caller does not wish to use the new feature it can pass current-tags for both arguments and, at this point, we do exactly that in the three callers of this function. Note, we cannot tidily allow original-tags to be optional because we would need to distinguish nil meaning "we are not specifying original-tags" from nil meaning there were no original-tags (an empty list). We use this in subsequent patches to make it clear when a message was unread when you first loaded a show buffer (previously the unread tag could be removed before a user realised that it had been unread). The code adds into the existing tag formatting code. The user can specify exactly how a tag should be displayed normally, when deleted, or when added. Since the formatting code matches regexps a user can match all deleted tags with a ".*" in notmuch-tag-deleted-formats. For example setting notmuch-tag-deleted-formats to '((".*" nil)) tells notmuch not to show deleted tags at all. All the variables are customizable; however, more complicated cases like changing the face depending on the type of display will require custom lisp. Currently this overrides notmuch-tag-deleted-formats for the tests setting it to '((".*" nil)) so that they get removed from the display and, thus, all tests still pass.
* Make keys of notmuch-tag-formats regexps and use cachingGravatar Austin Clements2014-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This modifies `notmuch-tag-format-tag' to treat the keys of `notmuch-tag-formats' as (anchored) regexps, rather than literal strings. This is clearly more flexible, as it allows for prefix matching, defining a fallback format, etc. This may cause compatibility problems if people have customized `notmuch-tag-formats' to match tags that contain regexp specials, but this seems unlikely. Regular expression matching has quite a performance hit over string lookup, so this also introduces a simple cache from exact tags to formatted strings. The number of unique tags is likely to be quite small, so this cache should have a high hit rate. In addition to eliminating the regexp lookup in the common case, this cache stores fully formatted tags, eliminating the repeated evaluation of potentially expensive, user-specified formatting code. This makes regexp lookup at least as fast as assoc for unformatted tags (e.g., inbox) and *faster* than the current code for formatted tags (e.g., unread): inbox (usec) unread (usec) assoc: 0.4 2.8 regexp: 3.2 7.2 regexp+caching: 0.4 0.4 (Though even at 7.2 usec, tag formatting is not our top bottleneck.) This cache must be explicitly cleared to keep it coherent, so this adds the appropriate clearing calls.
* emacs: Combine notmuch-combine-face-text-property{, -string}Gravatar Austin Clements2014-03-24
| | | | | | | | | This combines our two face combining functions into one, easy to use function with a much shorter name: `notmuch-apply-face'. This function takes the full set of arguments that `notmuch-combine-face-text-property' took, but takes them in a more convenient order and provides smarter defaults that make the function easy to use on both strings and buffers.
* emacs: tree: use tag-format-tagsGravatar Mark Walters2014-01-18
| | | | | | | | | | | | | | | | | Previously tree did not use tag-format-tags: since tree wants to distinguish matching messages from non-matching messages it is not a perfect fit. However, in preparation for allowing tag-changes to be shown (i.e., added or deleted tags to be indicated) it is convenient to make all places displaying tags call the same routines. We modify notmuch-tag-format-tags slightly so that it can take and argument for the default characteristics of the face before the special tag features are applied. This also means that things like the star symbol for flagged messages all work in tree.
* emacs: tree: default face for matching/non-matching messagesGravatar Mark Walters2014-01-18
| | | | | | | | | | | This adds default faces for matching and non-matching messages. This makes it easier for a user to do broad customization without having to customize every field. It also fits more neatly with the next patch which switches to using notmuch-tag-format-tags for tag formatting. We set the field specific face customization to nil for all the fields which use the message default face to make it clear to a user which fields customizations are being used.
* emacs: tree remove comma separator tagsGravatar Mark Walters2014-01-13
| | | | | | | | | | | | Previously the tags on each line in tree view were separarted by ", " not just " ". This is different from show and search views. This patch removes this comma. This is a large patch as essentially every line of each of the expected outputs in the tree tests needs updating. Apart from aesthetic reasons this simplifies the switch to notmuch-tag-format-tags in the next patch.
* emacs: tree: bare-id in treeGravatar Mark Walters2014-01-03
| | | | | | | | | Previously notmuch-tree-get-message-id always returned the id including the prefix "id:". Modify the function to take an optional `bare' argument saying to return the raw string. This will be useful later and brings the function in line with notmuch-show-get-message-id.
* emacs: tree: use remap for the over-ridden global bindingsGravatar Mark Walters2013-11-13
| | | | | | | | | | | Following a suggestion by Austin in id:20130915153642.GY1426@mit.edu we use remap for the over-riding bindings in pick. This means that if the user modifies the global keymap these modifications will happen in the tree-view versions of them too. [tree-view overrides these to do things like close the message pane before doing the action, so the functionality is very close to the original common keymap function.]
* emacs: move the show entry to tree into show.elGravatar Mark Walters2013-11-07
| | | | Move the keybinding and show specific helper from tree.el to show.el
* emacs: add z to common keymapGravatar Mark Walters2013-11-07
| | | | Add the main entry "z" to notmuch-tree to the common keymap.
* emacs: move search based tree functions to notmuch.elGravatar Mark Walters2013-11-07
| | | | | Move a couple of the search mode specifc caller helpers for tree from tree into notmuch.el.
* emacs: minimal change to load notmuch-tree by defaultGravatar Mark Walters2013-11-07
| | | | | | | | | | We want to load notmuch-tree when notmuch is loaded, so include it as a require in notmuch.el. To avoid circular dependency we need to move one keybinding from notmuch-tree.el to notmuch.el: it makes sense for it to be defined there anyway. Since tree is now loaded by default there is no need to print a message when it is loaded.
* emacs: move notmuch-tree from contrib to mainlineGravatar Mark Walters2013-11-07