aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs
Commit message (Collapse)AuthorAge
* emacs: rename `notmuch-show-toggle-headers' to ↵Gravatar Pieter Praet2012-10-20
| | | | | | | | | | | | | | | | | | | | | | | | `notmuch-show-toggle-visibility-headers' * emacs/notmuch-show.el (notmuch-show-toggle-headers): Rename to `notmuch-show-toggle-visibility-headers'. (notmuch-show-mode-map): Update "h" binding wrt renamed `notmuch-show-toggle-headers'. (notmuch-message-headers): Update docstring wrt renamed `notmuch-show-toggle-headers'. (notmuch-message-headers-visible): Update docstring wrt renamed `notmuch-show-toggle-headers'. Also fixed a small typo. * test/emacs: Update subtest wrt renamed `notmuch-show-toggle-headers': - "notmuch-show: hide message headers (w/ notmuch-show-toggle-headers)"
* emacs: Work around gnus-inhibit-images bug in mm-shrGravatar Austin Clements2012-09-30
| | | | | | | | | | | | | Emacs 24's mm-shr HTML email renderer fails to load gnus-art before referencing gnus-inhibit-images, resulting in a void-variable error when notmuch attempts to render an HTML email with inline images. This works around this bug by advising mm-shr to load gnus-art. mm-shr is the only function outside of gnus-art itself that references gnus-inhibit-images, so this workaround should be correct. If this ever changes, hopefully they will have fixed this bug upstream first. This fixes the "Rendering HTML mail with images" test for Emacs 24.
* emacs: simplify point placement in notmuch-hello refreshGravatar Jani Nikula2012-09-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | notmuch-hello (called also through notmuch-hello-update, bound to '=' by default) tries to find the widget under or following point before refresh, and put the point back to the widget afterwards. The code has grown quite complicated, and has at least the following issues: 1) All the individual section functions have to include code to support point placement. If there is no such support, point is dropped to the search box. Only saved searches and all tags sections support point placement. 2) Point placement is based on widget-value. If there are two widgets with the same widget-value (for example a saved search with the same name as a tag) the point is moved to the earlier one, even if point was on the later one. 3) When first entering notmuch-hello notmuch-hello-target is nil, and point is dropped to the search box. Moving the point to the search box is annoying because the user is required to move the point before being able to enter key bindings. Simplify the code by removing all point placement based on widgets, as it does not work properly, and trying to fix that would unnecessarily complicate the code. Save current line and column before refresh, and restore them afterwards. Sometimes, if notmuch-show-empty-saved-searches is nil, and the refresh adds or removes saved searches from the list, this has the appearance of moving the point relative to the nearest widgets. This is a much smaller and less frequent problem than the ones listed above.
* Run `notmuch-show-hook' after setting `header-line-format'Gravatar Damien Cassou2012-09-27
| | | | | | | This patch makes it possible for notmuch-show hooks to change the header line. Signed-off-by: Damien Cassou <damien.cassou@gmail.com>
* emacs: add support for reversing notmuch-show-mark-read tag changesGravatar Jani Nikula2012-09-19
| | | | | | | | | | Since marking a message as read can now be a user customized set of tag changes, make reversing this easier. Allow a prefix argument to notmuch-show-mark-read to reverse the marking as read, similar to the unarchiving in notmuch-show-archive-message. While at it, update the relevant documentation to match that of other automatic tagging (i.e. archive and reply).
* 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: use new tag change helper to mark messages as repliedGravatar Jani Nikula2012-09-19
| | | | Clarify documentation while at it.
* emacs: fix notmuch-message-replied-tags defcustom typeGravatar Jani Nikula2012-09-19
|
* emacs: add helper for tag change list manipulationGravatar Jani Nikula2012-09-19
| | | | Add a helper to create (and optionally reverse) a list of tag changes.
* 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: make notmuch-show return its bufferGravatar Mark Walters2012-09-01
| | | | | notmuch-pick uses the returned buffer to try and make sure it does not close the wrong buffer.
* notmuch-show: add notmuch-show-mark-read-tags optionGravatar Michal Nazarewicz2012-08-29
| | | | | | | | The `notmuch-show-mark-read-tags' lists tags that are to be applied when message is read. By default, the only value is "-unread" which will remove the unread tag. Among other uses, this variable can be used to stop notmuch-show from modifying tags when message is shown (by setting the variable to an empty list).
* emacs: Make moving to the previous message move to the previous boundaryGravatar Austin Clements2012-08-12
| | | | | | | | | | | Previously, notmuch-show-previous-message would move to the beginning of the message before the message containing point. This patch makes it instead move to the previous message *boundary*. That is, if point isn't already at the beginning of the message, it moves to the beginning of the current message. This is consistent with notmuch-show-next-message, which can be thought of as moving to the next message boundary. Several people have expressed a preference for this.
* 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 "not defined at runtime" warningGravatar Austin Clements2012-08-12
| | | | | | | | | | Previously, the Emacs byte compiler produced the warning the function `remove-if-not' might not be defined at runtime. because we only required cl at compile-time (not runtime). This fixes this warning by requiring cl at runtime, ensuring that the definition of remove-if-not is available.
* emacs: show: exclude bug fixGravatar Mark Walters2012-08-02
| | | | | | The pipe message function (when used with a prefix) uses a search of the form "id:<id1> or id:<id2>" etc. Since the user says precisely which messages are wanted by opening them it should not use excludes.
* 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: Fix notmuch-message-mark-replied.Gravatar Ingo Lohmar2012-07-24
| | | | | | | | | notmuch-message-mark-replied used "apply" to change message tags according to notmuch-message-replied-tags after sending a reply. This works if the latter is a single-element list. But with the recently changed format of tag changes, it breaks for multiple-element lists. Use "funcall" to properly pass the list of tag changes as a single argument.
* 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: Implement an incremental JSON parserGravatar Austin Clements2012-07-12
| | | | | | | | | | | | | | | | | | | | | | This parser is designed to read streaming JSON whose structure is known to the caller. Like a typical JSON parsing interface, it provides a function to read a complete JSON value from the input. However, it extends this with an additional function that requires the next value in the input to be a compound value and descends into it, allowing its elements to be read one at a time or further descended into. Both functions can return 'retry to indicate that not enough input is available. The parser supports efficient partial parsing, so there's no need to frame the input for correctness or performance. The bulk of the parsing is still done by Emacs' json.el, so any improvements or optimizations to that will benefit the incremental parser as well. Currently only descending into JSON lists is supported because that's all we need, but support for descending into JSON objects can be added in the future.
* 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: Add configurable wrapping width for notmuch-wash-wrap-long-linesGravatar Daniel Schoepe2012-06-29
| | | | | | This introduces a variable to control after how many characters a line is wrapped by notmuch-wash-wrap-long-lines (still wrapping at the window width if it is lower).
* emacs: make elide messages use notmuch-show for omitting messages.Gravatar Mark Walters2012-06-29
| | | | | | | | | Previously the elide messages code got the entire-thread from notmuch-show.c and then threw away all non-matching messages. This version calls notmuch-show.c without the --entire-thread flag so it never receives the non-matching messages in the first place. This makes it substantially faster.
* emacs: add pipe attachment commandGravatar Mark Walters2012-06-22
| | | | | | | Allow the user to pipe the attachment somewhere. Bound to '|' on the attachment button. Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
* emacs: derive correct timestamp in FCC unique nameGravatar Jesse Rosenthal2012-06-22
| | | | | | | | | | | | | | | | Previously, the timestamp at the beginning of the FCC unique maildir name was derived incorrectly, thanks to an integer overflow. This changes the derivation of timestamp to use a float, and so will get the number correct at least until 2038. (It is still formatted with "%d" so it will show up as an integer.) Should we need to change it in the next 26 years to take the unix millenium into account, it will be invisible to users. This change is mostly a question of consistency, since the unique name is arbitrary anyway. But since most people use timestamps, and that was the original intention here as well, we might as well. Signed-off-by: Jesse Rosenthal <jrosenthal@jhu.edu>
* emacs: only strip "re:" in the beginning of subjectGravatar Jani Nikula2012-06-07
| | | | | Fix notmuch-show-strip-re by matching "re:" only in the beginning of the input string.
* emacs: Suppress warnings about using cl at runtimeGravatar Austin Clements2012-06-03
| | | | | | | | | It was decided in the thread starting at [0] that it is okay for notmuch to use 'cl runtime functions. However, by default, these produce byte compiler warnings. This suppresses those using file-local variables. [0] id:"m262g864dz.fsf@wal122.wireless-pennnet.upenn.edu"
* emacs: use 'gnus-decoded in notmuch-mm-display-part-inline ()Gravatar Tomi Ollila2012-05-23
| | | | | | | | | | | | | | | | | | | | When mail message is read from emacs, the message structure obtained may contain parts which have content included (`text/plain` for example) and other parts where content is not included (`text/html` for example). In case content is included, the string is already available in emacs' internal format and therefore mm-... functions should not attempt to do further decoding for the data in temp buffer provided for it. Currently when reply buffer is created, notmuch-mm-display-part-inline () is used to provided quoted reply content. This change makes the mm-... functions called by it use 'gnus-decoded as charset whenever the content is already available. File .../emacs-23.3/lisp/gnus/mm-uu.el mentions: "`gnus-decoded' is a fake charset, which means no further decoding."
* emacs: fix custom queries section customization widget in notmuch-helloGravatar Dmitry Kurochkin2012-05-06
| | | | | | | The customization widget referred to a non-existing function `notmuch-hello-insert-query-list'. The patch changes it to the correct one - `notmuch-hello-insert-searches'. The relevant test is fixed now.
* emacs: Do not pass stderr of notmuch reply to JSON parserGravatar Michal Sojka2012-05-06
| | | | | | | | | | Sometimes, notmuch reply outputs something to stderr, for example: "Failed to verify signed part: Cannot verify multipart/signed part: unsupported signature protocol". When this happens, replying in emacs fails, because emacs cannot parse the error message as JSON. This patch causes emacs to ignore stderr when reading reply from notmuch.
* emacs: Let the user choose where to compose new mailsGravatar Thomas Jost2012-05-06
| | | | | | | | Introduce a new defcustom notmuch-mua-compose-in that allows users to specify where new mails are composed, either in the current window or in a new window or frame. Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
* emacs: Correctly quote non-text/plain parts in replyGravatar Adam Wolfe Gordon2012-05-06
| | | | | | | | | | Quote non-text parts nicely by displaying them with mm-display-part before calling message-cite-original to quote them. HTML-only emails can now be quoted correctly. We re-use some code from notmuch-show (notmuch-show-mm-display-part-inline), which has been moved to notmuch-lib.el. Mark the test for this feature as not broken.
* 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 show 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: 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: allow notmuch-tag to accept string inputs and prompt for tagsGravatar Jameson Graef Rollins2012-04-29
| | | | | | | | | | | notmuch-tag is extended to accept various formats of the tag changes. In particular, user prompting for tag changes is now incorporated here, so it is common for modes. The tag binary and the notmuch-{before,after}-tag-hooks are only called if tag changes is non-nil. In all cases tag-changes is returned as a list.
* 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: fix archive thread/message function documentation.Gravatar Jameson Graef Rollins2012-04-29
| | | | | This removes an inaccuracy in the thread archiving function, and adds a clarification to the message archiving function.