aboutsummaryrefslogtreecommitdiff
path: root/emacs
Commit message (Collapse)AuthorAge
* emacs: show: exclude bug fixMark 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.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 formatsAustin 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 formattingAustin 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 propertyAustin 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 iterationAustin 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 placeAustin 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 coloringAustin 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 propertyAustin 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.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 resultsAustin 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 parserAustin 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'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'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 errorsAustin 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 displayAustin 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-resultAustin 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-linesDaniel 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.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 commandMark 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 nameJesse 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 subjectJani 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 runtimeAustin 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 ()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-helloDmitry 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 parserMichal 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 mailsThomas 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 replyAdam 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-tagJameson 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 interfaceJameson 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 interfaceJameson 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 tagsJameson 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.elJameson 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.Jameson Graef Rollins2012-04-29
| | | | | This removes an inaccuracy in the thread archiving function, and adds a clarification to the message archiving function.
* emacs: Don't move to the next thread unless the cursor is at the end of the ↵David Edmondson2012-04-29
| | | | | | | | | buffer. When using the spacebar to scroll through a thread, hitting 'space' when the bottom of the last message is visible should take the cursor to the end of the buffer rather than immediately archiving the thread and moving to the next thread.
* emacs-show: open excluded matches if no other matchesMark Walters2012-04-29
| | | | | | | | Currently emacs show does not open matching but excluded messages. This is normally the desired behaviour but is probably not ideal if only excluded messages match. This patch opens all the matching (necessarily excluded) messages in this case and goes to the first one.
* emacs: do not modify subject in search or showJameson 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: Put notmuch-hello-sections in custom group notmuch-helloAustin Clements2012-04-24
|
* emacs: Put notmuch-print-mechanism in custom group notmuch-showAustin Clements2012-04-24
|
* emacs: modify help message for notmuch-search-line-faces to reflect ↵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 inputJameson 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 completionJameson 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 functionJameson Graef Rollins2012-04-12
| | | | | "search-tags" is deprecated, so use the more modern and supported "search --output=tags".
* emacs: get rid of trailing spaces in notmuch-hello viewDmitry Kurochkin2012-04-12
| | | | | | | | | | | This patch removes trailing spaces in notmuch-hello view. A side effect of this change is that tag/query buttons no longer include a space at the end. This means that pressing RET when the point is at the first character after the tag/query button no longer works (note that this is the standard behavior for buttons). We may change this behavior in the future (without adding trailing spaces back) if people would find this change inconvenient.
* emacs: make show set --exclude=falseMark Walters2012-04-07
| | | | | | Show has to set --exclude=false to deal with cases where it is asked to show a single excluded message. It uses JSON so it can easily pass the exclude information to the user.
* emacs: do not modify the alist passed to notmuch-sort-saved-searchesJani Nikula2012-04-06
| | | | | | Sort modifies its input as a side effect. Pass it a copy in notmuch-sort-saved-searches to not modify the notmuch-saved-searches alist.
* emacs: fix off-by-one error in notmuch-hello column alignmentDmitry Kurochkin2012-04-05
| | | | | Expected results for few tests are fixed, the relevant test is unmarked broken.
* emacs: Fix the References header in replyAdam Wolfe Gordon2012-04-02
| | | | | | | | | | | | | | In the new reply code, the References header gets inserted by message.el using a function called message-shorten-references. Unlike all the other header-inserting functions, it doesn't put a newline after the header, causing the next header to end up on the same line. In our case, this header happened to be User-Agent, so it's hard to notice. This is probably a bug in message.el, but we need to work around it. This fixes the problem by wrapping message-shorten-references in a function that inserts a newline after if necessary. This should protect against the message.el bug being fixed in the future.
* emacs: Fix two bugs in replyAdam Wolfe Gordon2012-04-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug 1: Replying from alternate addresses ---------------------------------------- The reply code was inconsistent in its use of symbols and strings for header names being passed to message.el functions. This caused the From header to be lookup up incorrectly, causing an additional From header to be added with the user's primary address instead of the correct alternate address. This is fixed by using symbols everywhere, i.e. never using strings for header names when interacting with message.el. This change also removes our use of `mail-header`, since we don't use it anywhere else, and using assq makes it clear how the header lists are expected to work. Bug 2: Duplicate headers in emacs 23.2 -------------------------------------- The message.el code in emacs 23.2 assumes that header names will always be passed as symbols, so our use of strings caused problems. The symptom was that on 23.2 (and presumably on earlier versions) the reply message would end up with two of some headers. Converting everything to symbols also fixes this issue.
* emacs: Fix mis-named argument to notmuch-get-bodypart-internalAustin Clements2012-03-31
| | | | | | Previously, this function took an argument called "message-id", even though it was a general query, rather than a message ID. This changes it to "query".