aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs/notmuch.el
Commit message (Collapse)AuthorAge
...
* emacs: Rename incremental JSON internal variablesGravatar Mark Walters2012-10-28
| | | | | | This patch just renames the internal variables for the JSON parser now it is no longer specific to search mode. It also fixes up the white space after the previous patch. There should be no functional changes.
* emacs: Split out the incremental json parser into its own functionGravatar Mark Walters2012-10-28
| | | | | | | | | | | | | | | | | This patch splits out the incremental json parser into its own function. It moves the main logic of the parser to happen inside the parse buffer rather than inside the results buffer, but makes sure all results and all errors are displayed in the results buffer. It also changes the local parser variables from being buffer local to the results buffer to being buffer local to the parse buffer, and sets them up automatically so the caller does not need to. Finally to keep the diff small this patch does not fix the whitespace, nor complete the code movement (these are done in subsequent patches) but it should contain all the functional changes.
* emacs: Escape tag queries suggested by tab completionGravatar Austin Clements2012-10-27
|
* emacs: add support for reversing notmuch-search-archive-thread tag changesGravatar Jani Nikula2012-09-19
| | | | | | | Since archiving a thread can now be a user customized set of tag changes, make reversing this easier. Allow a prefix argument to notmuch-search-archive-thread to reverse the archiving, similar to the unarchiving in notmuch-show-archive-message.
* emacs: add support for custom tag changes on message/thread archiveGravatar Jani Nikula2012-09-19
| | | | | | | Add support for customization of the tag changes that are applied when a message or a thread is archived. Instead of hard-coded removal of the "inbox" tag, the user can now specify a list of tag changes to perform.
* emacs: correct `notmuch-search-mode's docstring wrt `notmuch-search-tag-all'Gravatar Pieter Praet2012-09-01
| | | | | | | * emacs/notmuch.el (notmuch-search-mode): `notmuch-search-tag-all' currently uses the current query string instead of `notmuch-search-find-thread-id-region-search', which might cause a race condition.
* emacs: notmuch search bugfixGravatar Mark Walters2012-08-12
| | | | | | | | | | | | | | The recent change to use json for notmuch-search.el introduced a bug in the code for keeping position on refresh. The problem is a comparison between (plist-get result :thread) and a thread-id returned by notmuch-search-find-thread-id: the latter is prefixed with "thread:" We fix this by adding an option to notmuch-search-find-thread-id to return the bare thread-id. It appears that notmuch-search-refresh-view is the only caller of notmuch-search that supplies a thread-id so this change should be safe (but could theoretically break users .emacs functions).
* 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 (;;).