aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs/notmuch.el
Commit message (Collapse)AuthorAge
* emacs: fix a bug introduced by the recent search cleanups.Gravatar Mark Walters2012-08-02
| | | | | | | In commit 5d0883e the function notmuch-search-next-thread was changed. In particular it only goes to the next message if there is a next message. This breaks notmuch-show-archive-thread-then-next. Fix this by going to the "next" message whenever we are on a current message.
* emacs: Fix navigation of multi-line search result formatsGravatar Austin Clements2012-07-24
| | | | | | | | | | | At this point, the only remaining functions that don't support multi-line search result formats are the thread navigation functions. This patch fixes that by rewriting them in terms of notmuch-search-result-{beginning,end}. This changes the behavior of notmuch-search-previous-thread slightly so that if point isn't at the beginning of a result, it first moves point to the beginning of the result.
* emacs: Allow custom tags formattingGravatar Austin Clements2012-07-24
| | | | | | | | | | | | Previously we ignored any notmuch-search-result-format customizations for tag formatting because we needed to be able to parse back in the result line and update the tags in place. We no longer do either of these things, so we can allow customization of this format. (Coincidentally, previously we still allowed too much customization of the tags format, since moving it earlier on the line or removing it from the line would interfere with the tagging mechanism. There is now no problem with doing such things.)
* emacs: Replace other search text properties with result propertyGravatar Austin Clements2012-07-24
| | | | | | Since the result object contains everything that the other text properties recorded, we can remove the other text properties and simply look in the plist of the appropriate result object.
* emacs: Use result text properties for search result iterationGravatar Austin Clements2012-07-24
| | | | | | | | | | | | This simplifies the traversal of regions of results and eliminates the need for save-excursions (which tend to get in the way of maintaining point when we make changes to the buffer). It also fixes some strange corner cases in the old line-based code where results that bordered the region but were not included in it could be affected by region commands. Coincidentally, this also essentially enables multi-line search result formats; the only remaining non-multi-line-capable functions are notmuch-search-{next,previous}-thread, which are only used for interactive navigation.
* emacs: Update tags by rewriting the search result line in placeGravatar Austin Clements2012-07-24
| | | | | | | | | Now that we keep the full thread result object, we can refresh a result after any changes by simply deleting and reconstructing the result line from scratch. A convenient side-effect of this wholesale replacement is that search now re-applies notmuch-search-line-faces when tags change.
* emacs: Use text properties instead of overlays for tag coloringGravatar Austin Clements2012-07-24
| | | | | | | | | | | | | | | | | | | 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: Record thread search result object in a text propertyGravatar Austin Clements2012-07-24
| | | | | This also provides utility functions for working with this text property that get its value, find its start, and find its end.
* emacs: Switch from text to JSON format for search resultsGravatar Austin Clements2012-07-12
| | | | | | | | | | | | | | | | | | | | | | | | | | The JSON format eliminates the complex escaping issues that have plagued the text search format. This uses the incremental JSON parser so that, like the text parser, it can output search results incrementally. This slows down the parser by about ~4X, but puts us in a good position to optimize either by improving the JSON parser (evidence suggests this can reduce the overhead to ~40% over the text format) or by switching to S-expressions (evidence suggests this will more than double performance over the text parser). [1] This also fixes the incremental search parsing test. This has one minor side-effect on search result formatting. Previously, the date field was always padded to a fixed width of 12 characters because of how the text parser's regexp was written. The JSON format doesn't do this. We could pad it out in Emacs before formatting it, but, since all of the other fields are variable width, we instead fix notmuch-search-result-format to take the variable-width field and pad it out. For users who have customized this variable, we'll mention in the NEWS how to fix this slight format change. [1] id:"20110720205007.GB21316@mit.edu"
* emacs: Pass plist to `notmuch-search-show-result'Gravatar Austin Clements2012-07-12
| | | | | | | Rather than passing lots of arguments and then further passing those to `notmuch-search-insert-field', pass a plist containing all of the search result information. This plist is compatible with the JSON format search results.
* emacs: Move search-target logic to `notmuch-search-show-result'Gravatar Austin Clements2012-07-12
| | | | | | | | | | | | | This is a simpler place to do this, since we can avoid any point motion and hence any save-excursions in `notmuch-search-process-filter', which in turn lets us put all of the search-target logic outside of any save-excursions. `notmuch-search-show-{result,error}' are now responsible for their own point motion. `notmuch-search-process-filter' could use some reindentation after this, but we're about to rewrite it entirely, so we won't bother.
* emacs: Helper for reporting search parsing errorsGravatar Austin Clements2012-07-12
| | | | | | This removes the last bit of direct output from the parsing function. With the parser now responsible solely for parsing, we can swap it out for another parser.
* emacs: Separate search line parsing and displayGravatar Austin Clements2012-07-12
| | | | | | | Previously, much of the display of search lines was done in the same function that parsed the CLI's output. Now the parsing function only parses, and notmuch-search-show-result fully inserts the search result in the search buffer.
* emacs: Clean up notmuch-search-show-resultGravatar Austin Clements2012-07-12
| | | | | This simplifies the code and makes it no longer cubic in the number of result fields.
* emacs: eliminate search-tag-thread in favor of just search-tagGravatar Jameson Graef Rollins2012-04-29
| | | | | notmuch-search-tag-thread is now completely redundant with notmuch-search-tag so we eliminate it to simplify the interface.
* emacs: modify search tag functions to use new notmuch-tag interfaceGravatar Jameson Graef Rollins2012-04-29
| | | | | | The main change here is to modify argument parsing so as to not force tag-changes to be a list, and to let notmuch-tag handle prompting the user when required. doc strings are also updated and cleaned up.
* emacs: create notmuch-tag.el, and move appropriate functions from notmuch.elGravatar Jameson Graef Rollins2012-04-29
| | | | | | | | Tagging functions are used in notmuch.el, notmuch-show.el, and notmuch-message.el. There are enough common functions for tagging that it makes sense to put them all in their own library. No code is modified, just moved around.
* emacs: do not modify subject in search or showGravatar Jameson Graef Rollins2012-04-28
| | | | | | | | | | | | | A previous patch [0] replaced blank subject lines with '[No Subject]' in search and show mode. Apparently this was needed to circumvent some bug in the printing code, but there was no need for it search or show, and it is definitely not desirable, so we undo it here (a revert is no longer feasible). We should not be modifying strings in the original message without good reason, or without a clear indication that we are doing so, neither of which apply in this case. For further discussion see [0]. [0] id:"1327918561-16245-3-git-send-email-dme@dme.org"
* emacs: modify help message for notmuch-search-line-faces to reflect ↵Gravatar Jameson Graef Rollins2012-04-24
| | | | | | | | preferred "deleted" tag name. No functional change here. The help message previously referred to the "delete" tag, but "deleted" is now preferred, so hopefully this will reduce any potential confusion.
* emacs: have tag-completion return all tags for nil inputGravatar Jameson Graef Rollins2012-04-12
| | | | | | Previously the function would fail if the initial input was nil. Now it will return a list of all tags, which obviously makes much more sense.
* emacs: include tags from excluded messages in tag tab completionGravatar Jameson Graef Rollins2012-04-12
| | | | | | | The new message exclude functionality will hide tags that only exist on excluded messages. However, one might very well want to manually modify excluded tags. This makes sure tags from excluded messages are always available in tab completion.
* emacs: update call in tag-completion functionGravatar Jameson Graef Rollins2012-04-12
| | | | | "search-tags" is deprecated, so use the more modern and supported "search --output=tags".
* emacs: Fix search tab completion in terminalsGravatar Austin Clements2012-03-18
| | | | | | | | | | | | | | In X, Emacs distinguishes the tab key, which produces a 'tab event; from C-i, which produces a ?\t event. However, in a terminal, these are indistinguishable and only produce a ?\t event. In order to simplify things, Emacs automatically translates from 'tab to ?\t (see "Function key translations" in M-x describe-bindings), so functions only need to be bound to ?\t to work in all situations. Previously, the search tab completion code usedq (kbd "<tab>"), which produced the event sequence [tab], which only matched the 'tab event and hence only worked in X. This patch changes it to (kbd "TAB"), which matches the general ?\t event and works in all situations.
* emacs: notmuch.el ignore excluded matchesGravatar Mark Walters2012-03-02
| | | | | | | | This is a small change to make notmuch.el ignore excluded matches. In the future it could do something better like add a button for rerunning the search with the excludes (particularly if nothing matches with the excludes) or having them invisible and allowing the visibility to be toggled.
* emacs: Fix display of highlighted line in notmuch-searchGravatar Michal Sojka2012-02-17
| | | | | | | When notmuch-search-line-faces is used to set background color in search results, the highlight of the current line is not always displayed correctly. This patch fixes that by increasing the priority property of the highlight overlay.
* emacs: Rework crypto switch toggle.Gravatar David Edmondson2012-02-12
| | | | | | | | | | | | | | Re-work the existing crypto switch toggle to be based on a persistant buffer-local variable. To allow this, modify `notmuch-show-refresh-view' to erase and re-draw in the current buffer rather than killing the current buffer and creating a new one. (This will also allow more per-buffer behaviour in future patches.) Add a binding ('$') to toggle crypto processing of the current buffer and remove the prefix argument approach that achieves a similar result.
* emacs: add default value to notmuch-search-line-facesGravatar Jani Nikula2012-02-12
| | | | | | | | | | | | | | Add default value to notmuch-search-line-faces to show "unread" messages in bold, and "flagged" messages in blue, to have some visual indication of important messages in search results. This should be helpful for new users. "unread" tag is quite obvious, and handled specially both in the lib and emacs ui. "flagged" is synced to maildir F flag in the lib. If one syncs the maildir to IMAP, this also translates to corresponding IMAP flag. (This is "starred" in GMail and Android.) Signed-off-by: Jani Nikula <jani@nikula.org>
* emacs: s/tags/tag-changes/ for arguments of tagging functionsGravatar Dmitry Kurochkin2012-02-08
| | | | | | | This makes the argument names more consistent and clear. The following functions changed: `notmuch-tag', `notmuch-search-tag-thread', `notmuch-search-tag-region' and `notmuch-search-tag-all'.
* emacs: accept empty tag list in `notmuch-tag'Gravatar Dmitry Kurochkin2012-02-08
| | | | | | | Since `notmuch-tag' is a non-interactive function and hence is meant to be invoked programmatically, it should accept zero tags. Also, the tagging operations (bound to "*", "+", "-") would accept empty input without an error.
* emacs: relax tag syntax check in `notmuch-tag' functionGravatar Dmitry Kurochkin2012-02-08
| | | | | | | | The tag syntax check in `notmuch-tag' function was too strict and did not allow nmbug tags with "::". Since the check is done for all tagging operations in Emacs UI, this basically means that no nmbug tags can be changed. The patch relaxes the tag syntax check to allow any tag names that do not include whitespace characters.
* emacs: separate history for operations which accept single and multiple tagsGravatar Dmitry Kurochkin2012-02-08
| | | | | | | | | | | | Some tag-related operations accept a single tag without prefix (`notmuch-select-tag-with-completion'), others accept multiple tags prefixed with '+' or '-' (`notmuch-read-tag-changes'). Before the change, both functions used a single default minibuffer history. This is inconvenient because you have to skip options with incompatible format when going through the history. The patch adds separate history lists for the two functions. Note that functions that accept the same input format (e.g. "+", "-", "*") share the history list as before.
* emacs: rename `notmuch-search-operate-all' to `notmuch-search-tag-all'Gravatar Dmitry Kurochkin2012-02-08
| | | | | `Notmuch-search-tag-all' is more clear and consistent with other tagging function names.
* emacs: make "+" and "-" tagging operations in notmuch-search more flexibleGravatar Dmitry Kurochkin2012-02-08
| | | | | | | | | | | Before the change, "+" and "-" tagging operations in notmuch-search view accepted only a single tag. The patch makes them use the recently added `notmuch-read-tag-changes' function (renamed `notmuch-select-tags-with-completion'), which allows to enter multiple tags with "+" and "-" prefixes. So after the change, "+" and "-" bindings in notmuch-search view allow to both add and remove multiple tags. The only difference between "+" and "-" is the minibuffer initial input ("+" and "-" respectively).
* emacs: remove text properties from `notmuch-search-get-tags' resultGravatar Dmitry Kurochkin2012-02-08
|
* emacs: move tag format validation to `notmuch-tag' functionGravatar Dmitry Kurochkin2012-02-08
| | | | | | | Before the change, tag format validation was done in `notmuch-search-operate-all' function only. The patch moves it down to `notmuch-tag', so that all users of that function get input validation.
* emacs: Prefer '[No Subject]' to blank subjects.Gravatar David Edmondson2012-02-03
|
* emacs: Stop the `truncate-string-to-width' madness.Gravatar David Edmondson2012-02-03
| | | | | There's no need to call `truncate-string-to-width' twice in this code path.
* emacs: globally replace non-branching "(if COND (progn ..." with "(when ..."Gravatar Pieter Praet2012-02-01
| | | | Less code, same results, without sacrificing readability.
* emacs: `notmuch-search-operate-all' code cleanup, no functional changesGravatar Dmitry Kurochkin2012-01-27
|
* emacs: add completion to "tag all" operation ("*" binding)Gravatar Dmitry Kurochkin2012-01-27
| | | | | The patch adds <tab> completion to "tag all" operation bound to "*" (`notmuch-search-operate-all' function).
* emacs: use a single history for all searchesGravatar Dmitry Kurochkin2012-01-25
| | | | | | | | There are two ways to do search in Emacs UI: search widget in notmuch-hello buffer and `notmuch-search' function bound to "s". Before the change, these search mechanisms used different history lists. The patch makes notmuch-hello search use the same history list as `notmuch-search' function.
* emacs: have notmuch-search-archive-thread use -next-thread functionGravatar Jameson Graef Rollins2012-01-25
| | | | Use this standard function, to keep thread navigation in one place.
* emacs/*.el: changed one-char comment prefix ';' to two; ';;'Gravatar Tomi Ollila2012-01-21
| | | | | In order for emacs (indent-region) to (re)indent emacs lisp properly there needs to be at least 2 comment characters (;;).
* emacs: globally replace non-branching "(if (not ..." with "(unless ..."Gravatar Pieter Praet2012-01-21
| | | | Less code, same results, without sacrificing readability.
* emacs: logically group def{custom,face}sGravatar Pieter Praet2012-01-19
| | | | | | | | | | | | | | | | | | | | | To allow for expansion whilst keeping everything tidy and organized, move all defcustom/defface variables to the following subgroups, defined in notmuch-lib.el: - Hello - Search - Show - Send - Crypto - Hooks - External Commands - Appearance As an added benefit, defcustom keyword args are now consistently ordered as they appear @ defcustom's docstring (OCD much?). Proper defgroup docstrings and various other improvements by courtesy of Austin Clements.
* emacs: Cycle through notmuch buffers rather than jumping to the last.Gravatar David Edmondson2012-01-15
| | | | | | | | As suggested by j4ni in #notmuch, rename `notmuch-jump-to-recent-buffer' as `notmuch-cycle-notmuch-buffers' and have it behave accordingly. Consider `message-mode' buffers to be of interest.
* emacs: bind 'r' to reply-to-sender and 'R' to reply-to-allGravatar Jani Nikula2012-01-14
| | | | | | | Change the default reply key bindings, making 'r' reply-to-sender and 'R' reply-to-all. Signed-off-by: Jani Nikula <jani@nikula.org>
* emacs: add support for replying just to the senderGravatar Jani Nikula2012-01-14
| | | | | | | | Provide reply to sender counterparts to the search and show reply functions. Add key binding 'R' to reply to sender, while keeping 'r' as reply to all, both in search and show views. Signed-off-by: Jani Nikula <jani@nikula.org>
* emacs: Better handling of inherited keymaps for `nomuch-help'.Gravatar David Edmondson2012-01-09
| | | | | | | | `notmuch-hello-mode' inherits the keymap for widgets, which confused `notmuch-substitute-command-keys'. Fix the confusion. Simplify `notmuch-substitute-command-keys' a little to make it easier to read.
* emacs: Don't signal an error when reaching the end of the search results.Gravatar David Edmondson2012-01-09
| | | | | | | | | With the default configuration ('space' moves through the messages matching the search and back to the results index at the end) it's unnecessary to signal an error when the last message has been read, as this is the common case. Moreover, it's very annoying when `debug-on-error' is t.