aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs
Commit message (Collapse)AuthorAge
* emacs: move notmuch-tree from contrib to mainlineGravatar Mark Walters2013-11-07
|
* emacs: move notmuch-help to libGravatar Mark Walters2013-11-07
| | | | | | notmuch-help is in notmuch.el not notmuch-lib.el and this is incovenient for the way pick/tree uses it. I think lib makes more sense anyway so move it there.
* emacs: Add a space after completed tag operationsGravatar Austin Clements2013-10-27
| | | | | | | | | | | | | | Previously, when a user fully completed a tag operation, they had to press space to begin entering another tag operation. This is different from, say, shell file name completion, which typically inserts a space after an unambiguous completion under the assumption that the user will want to enter more input. This patch tweaks `notmuch-read-tag-changes' to act more like shell file name completion: after an unambiguous tag completion, it now inserts a space, ready and waiting for another tagging operation from the user. This is backwards-compatible with old habits, since there's no harm in putting an extra space.
* emacs: Sanitize authors and subjects in search and showGravatar Austin Clements2013-10-27
| | | | | | Authors and subjects can contain embedded, encoded control characters like "\n" and "\t" that mess up display. Transform control characters into spaces everywhere we display them in search and show.
* emacs: Remove interactive behavior of `notmuch-tag'Gravatar Austin Clements2013-10-25
| | | | | | | We no longer use this, since we've lifted all interactive behavior to the appropriate interactive entry points. Because of this, `notmuch-tag' also no longer needs to return the tag changes list, since the caller always passes it in.
* emacs: Use interactive specifications for tag changes in searchGravatar Austin Clements2013-10-25
| | | | | | | | | | This is similar to the previous commit, but applies to search. Search is somewhat more complicated because its tagging operations can also apply to a region. Hence, this lifts interactive prompting into a helper function. This also takes advantage of the new ability to provide a prompt to distinguish tagging a single thread from tagging a region of threads.
* emacs: Use interactive specifications for tag changes in showGravatar Austin Clements2013-10-25
| | | | | | | | | | | | | | | This modifies all tagging operations in show to call `notmuch-read-tag-changes' in their interactive specification to input tag changes, rather than depending on lower-level functions to prompt for tag changes regardless of their calling context. Besides being more Elispy and providing a more consistent programmatic API, this enables callers to provide two call site-specific pieces of information: an appropriate prompt, and the set of visible tags. The prompt lets us differentiate * from +/-. Providing visible tags enables a more consistent user experience than retrieving the (potentially different) tags from the database, and avoids a round-trip to the CLI and database.
* emacs: Take prompt and current tags in `notmuch-read-tag-changes'Gravatar Austin Clements2013-10-25
| | | | | | | | | | This modifies the interface of `notmuch-read-tag-changes' to take an optional prompt string as well as a list of existing tags instead of a query. This list of tags is used to populate the tag removal completions and lets the caller compute these in a more efficient/consistent manner than performing a potentially large or complex query. This patch also updates the sole current caller of `notmuch-read-tag-changes'.
* emacs: Fix misuse of `notmuch-tag'Gravatar Austin Clements2013-10-25
| | | | | | | | | The calling convention for `notmuch-tag' changed in commit 97aa3c06 to take a list of tag changes instead of a &rest argument, but the call from `notmuch-search-tag-all' still passed a &rest argument. This happened to work for interactive calls because tag-changes would be nil, so the `apply' call would pass only the query string to `notmuch-tag' and simply omit the &optional tag-changes argument.
* emacs: show: use interactive instead of current-prefix-argGravatar Mark Walters2013-10-19
| | | | | | | | | Currently notmuch-show looks at the prefix-arg directly via current-prefix-arg. This changes it to use the interactive specification. One test (for elide-toggle functionality) set the prefix arg directly. Update this test to set the new argument directly.
* emacs: distinguish tag `flagged' on terminalGravatar Gregor Zattler2013-10-12
| | | | | | | Change foreground color to `blue' like lines representing threads with flagged messages in notmuch-search. Before tag `flagged' was shown in notmuch-show buffers as image star on graphical frames while there was no visible distinction to other flags on terminal frames.
* emacs: Improved `notmuch-describe-keymap' documentationGravatar Austin Clements2013-10-10
|
* emacs: Improve interactive use documentationGravatar Austin Clements2013-10-07
| | | | | | | | | | | | This improves the function documentation for many interactive commands, either by improving their documentation string where the improvement also makes sense for programmatic use or by adding a 'notmuch-doc property where it doesn't. For nearly all commands that support a prefix argument, this adds a 'notmuch-prefix-doc property to document their prefixed behavior This omits prefix documentation for a few commands where I thought the prefixed behavior was too obscure (or too complex to fit in one line).
* emacs: Support overriding help and describing prefix actionGravatar Austin Clements2013-10-07
| | | | | | | | | | | | | | | | | | | | | | | | Traditionally, function documentation strings are intended primarily for programmers, rather than users. They're written from the perspective of calling the function, not interactively invoking it. They're only ever displayed along with the function prototype (and often refer to argument names). And built-in help commands like `describe-bindings' show the name of the command, not its documentation. The notmuch help system is like `describe-bindings', but tries to be more user-friendly by displaying documentation strings, rather than Elisp command names. For most commands, this is fine, but for some the "programmer description" is inappropriate for interactive use. This is particularly noticeable for commands that take an optional prefix argument. This patch adds support for two symbol properties: notmuch-doc and notmuch-prefix-doc, which let a command override its interactive documentation and provide separate documentation for its prefixed invocation. If notmuch-prefix-doc is present, we add an extra line to the help giving the prefixed key sequence along with the documentation for the prefixed command.
* emacs: Clean up a few documentation stringsGravatar Austin Clements2013-10-07
| | | | | Correct some grammatical errors, fix some violations of standard documentation string formatting conventions, and be more precise.
* emacs: `notmuch-mua-new-reply' is also not interactiveGravatar Austin Clements2013-10-07
| | | | | | | | | Like `notmuch-mua-new-forward-message', this is meant to be invoked programmatically by something that can provide a reasonable query string. In fact, `notmuch-mua-new-reply's interactive specification didn't match its arguments, so it wouldn't have worked interactively.
* emacs: `notmuch-mua-new-forward-message' is not interactiveGravatar Austin Clements2013-10-07
| | | | | | | | | | | `notmuch-mua-new-forward-message' must be called from a buffer containing a raw RFC2822-formatted message to forward. Hence, it's intended to be invoked programmatically through something else that sets up this buffer (like `notmuch-show-forward-message'), not interactively. Remove its interactive specification and update the documentation string to mention the requirements on the current buffer.
* emacs: bugfix unquoted symbolGravatar Mark Walters2013-09-15
| | | | | | | | In the recent changes for search order handling the default-value of notmuch-search-oldest-first was used. However, default-value needs a symbol so the symbol-name needs to be quoted. This missing quote was causing strange sort-orders in some cases.
* emacs: Move ?, q, s, m, =, and G to the common keymapGravatar Austin Clements2013-09-10
| | | | | | | | | The only user-visible effect of this should be that "G" now works in show mode (previously it was unbound for no apparent reason). This shared keymap gives us one place to put global commands, which both forces us to think about what commands should be global, and ensures their bindings can't diverge (like the missing "G" in show).
* emacs: Define a common shared keymap for all of notmuchGravatar Austin Clements2013-09-10
| | | | | This defines a single, currently empty keymap that all other notmuch mode maps inherit from.
* emacs: Make notmuch-help work with arbitrary keymapsGravatar Austin Clements2013-09-10
| | | | | | | | This converts notmuch-help to use map-keymap for all keymap traversal. This generally cleans up and simplifies construction of keymap documentation, and also makes notmuch-help support anything that can be in a keymap, including more esoteric stuff like multiple inheritance.
* emacs: Add unified refresh-this-buffer functionGravatar Austin Clements2013-09-10
| | | | | | | | This unifies the various refresh and poll-and-refresh functions we have for different modes. Now all modes bind "=" and "G" (except show, which doesn't bind "G" for some reason) to `notmuch-refresh-this-buffer' and `notmuch-poll-and-refresh-this-buffer', respectively.
* emacs: Move `notmuch-poll' to notmuch-libGravatar Austin Clements2013-09-10
|
* emacs: Remove notmuch-search quit continuationGravatar Austin Clements2013-09-10
| | | | | | Since notmuch-hello doesn't need this any more, we can remove this hack. This also eliminates `notmuch-search-quit', so now all modes bind "q" to `notmuch-kill-this-buffer'.
* emacs: Bind "s" to notmuch-search in hello-modeGravatar Austin Clements2013-09-10
| | | | | | Since there is now no difference between notmuch-hello-search and notmuch-search when called interactively, bind "s" to notmuch-search in notmuch-hello-mode-map. Now all modes bind "s" this way.
* emacs: Refresh hello whenever the user switches to the bufferGravatar Austin Clements2013-09-10
| | | | | | | | | | Previously, we refreshed hello when the user quit a search that was started from hello. This is fine assuming purely stack-oriented buffer use, but is quite fragile and requires hacks to search. This replaces that logic with a new approach that refreshes hello whenever the user switches to the hello buffer, regardless of how this happens.
* emacs: Consistently use configured sort orderGravatar Austin Clements2013-09-10
| | | | | | | | | | Previously, if `notmuch-search' was called interactively (bound to "s" in search and show, but not hello), it would always use newest-first. However, `notmuch-hello-search' (bound to "s" in hello) and `notmuch-hello-widget-search` would call it with the user-configured sort order. This inconsistency seems unintentional, so change `notmuch-search' to use the user-configured sort order when called interactively.
* emacs: add buttons for all multipart/related partsGravatar Istvan Marko2013-09-10
| | | | | | | | | When text/html parts include images as multipart/related and the text/plain alternative is used these images can be completely hidden with no easy way to access them or even find out that they are there. Make notmuch-show-insert-part-multipart/related add buttons for all parts, the first one visible the rest hidden.
* emacs: show: lazy part handling bugfixGravatar Mark Walters2013-09-10
| | | | | | | | | | | The lazy part handler had a bug that it allowed the button to be toggled to be specified. During toggling it needs to save and restore the text-properties for the button but it actually saved the text properties at point rather than from the button. In almost all cases this didn't matter as as point had the same text properties as the button. However, it is a bug and did cause incorrect behaviour in some cases: see id:87txhz14z6.fsf@qmul.ac.uk for details.
* emacs: fix notmuch-mua-reply point placement when signature involvedGravatar Tomi Ollila2013-09-08
| | | | | | | | | | | | | | | | | | | | | | When composing a reply, notmuch-mua-reply attempts to cite the the original message by inserting it before the user signature, if one is present. The existing method used to search the signature separator backward from the end of the buffer and then move one line up. In case of variable `message-signature-insert-empty-line' being nil this caused point to go to the beginning of '--text follows this line--' separator line, and citation was inserted there. This change checks the value of `message-signature-insert-empty-line' and doesn't move point if that is nil. Additional narrowing to the body region ensures that point never goes to the separator line (or beyond). `message-signature-setup-hook' or `message-setup-hook' may already have added some other content to the message body, therefore using simply (message-goto-body) to move point to the beginning of body might lead to unexpected results. Original patch from "Geoffrey H. Ferrari", continued with iterations from Jani and Mark.
* emacs: insert quotable parts in reply as they are displayed in show viewGravatar Jani Nikula2013-09-05
| | | | | | | | | | | | | | | | In reply, insert quotable parts using notmuch-show-insert-bodypart instead of calling notmuch-mm-display-part-inline directly to render the quoted parts as they are rendered in show view. We use a temp buffer to not leak text properties from the show renderer into the reply. This way we also don't need to worry about narrowing or point placement. Credits to Mark Walters <markwalters1009@gmail.com> and Austin Clements <amdragon@MIT.EDU> for getting this part straight. The notable change is that replies to text/calendar parts quote the pretty printed output of icalendar-import-buffer rather than the ugly raw vcalendar.
* emacs: removed 3 duplicate functions from notmuch-show.elGravatar Tomi Ollila2013-08-27
| | | | | | | notmuch-show.el and notmuch.el had 3 duplicate, identical functions: notmuch-foreach-mime-part, notmuch-count-attachments and notmuch-save-attachments. Now these functions in notmuch-show.el are replaced with declare-functions pointing to "notmuch"(.el).
* emacs: bugfix attachment content-type as mime-type handlingGravatar Mark Walters2013-07-31
| | | | | | | | | | | | Notmuch puts attachments in as declared content-type except when the content-type is application/octet-stream it tries to guess the type from the filename/extension. This means that viewing a pdf (for example) which is sent as application/octet-strem invokes the pdf viewer rather than just offering to save the part. Recent changes to the attachment handling (commit 1546387d) changed (broke) this. This patch stores the calculated mime-type with the part and changes the attachment part handlers can use it instead.
* emacs: hello: make --batch error gracefullyGravatar Mark Walters2013-07-27
| | | | | | | | | Recently notmuch-hello was converted to use batch count. However, it seems that several people run different versions of notmuch-emacs and notmuch-cli so this batch makes emacs fail with an error message if --batch is not available in the CLI. Amended by: db
* emacs: dropped rest of now-unused JSON functionalityGravatar Tomi Ollila2013-07-20
| | | | | | Notmuch cli provides all structured data previously provided in json format now in s-expression format, rendering all current json functionality obsolete.
* emacs: Remove `notmuch-call-notmuch-json'Gravatar Austin Clements2013-06-24
| | | | This function is no longer used.
* emacs: Use S-exp format everywhereGravatar Austin Clements2013-06-24
| | | | | | This switches `notmuch-mua-reply' and `notmuch-query-get-threads' to the S-exp format. These were the last two uses of the JSON format in the Emacs frontend.
* emacs: Introduce `notmuch-call-notmuch-sexp'Gravatar Austin Clements2013-06-24
| | | | | | | This is just like `notmuch-call-notmuch-json', but parses S-expression output. Note that, also like `notmuch-call-notmuch-json', this doesn't consider trailing data to be an error, which may or may not be what we want in the long run.
* emacs: Remove v commandGravatar Austin Clements2013-06-24
| | | | | | | | This removes the v command, since we now have much nicer part commands, and deprecates the underlying notmuch-show-view-all-mime-parts. This also means that people who try using the old unprefixed 'v' command on a part button will no longer be greeted by ALL of their parts popping up.
* emacs: update search sort order help to match codeGravatar Jani Nikula2013-06-24
|
* emacs: show: change emacs interactive pipe message.Gravatar Mark Walters2013-06-24
| | | | | | | | Previously the query string for piping a message to a command was "Pipe message to command: " regardless of whether the function was called with a prefix argument (which pipes all open messages to the command). This patch modifies the `interactive' command to reflect this.
* emacs: show: implement lazy hidden part handlingGravatar Mark Walters2013-06-13
| | | | | | | | | | | | | | | | | | | | | This adds the actual code to do the lazy insertion of hidden parts. We use a memory inefficient but simple method: when we come to insert the part if it is hidden we just store all of the arguments to the part insertion function as a button property. This means when we want to show the part we can just resume where we left off. One thing is that we can't tell if a lazy part will produce text until we try to render it so when unhiding a part we check to see if it rendered; if not we invoke the default part handler (e.g. an external viewer). Also, we would like to insert the lazy part at the start of the line after the part button. But if this line has some text properties (e.g. the colours for a following message header) then the lazy part gets these properties. Thus we start at the end of the part button line, insert a newline, insert the lazy part, and then delete the extra newline at the end of the part.
* emacs: show move addition of :notmuch-part to separate functionGravatar Mark Walters2013-06-13
| | | | | | This separates out the adding of the :notmuch-part text property to a separate function to simplify calling from the lazy part insertion code.
* emacs: show: modify the way hidden state is recorded.Gravatar Mark Walters2013-06-13
| | | | | | | | | | | | | | | | | Previously, whether a part was hidden or shown was recorded in the invisibility/visibility of the part overlay. Since we are going to have lazily rendered parts with no overlay store the hidden/shown state in the part button itself. Additionally, in preparation for the invisible part handling move the actual hiding of the hidden parts to insert-bodypart from create-part-overlays. Finally, we will need to know whether a part-insertion has done anything (it won't if the invisible part cannot be displayed by emacs) so we slightly rejig the code order in notmuch-show-toggle-part-invisibility to make it easier for the function to set an appropriate return value.
* emacs: show: pass button to create-overlaysGravatar Mark Walters2013-06-13
| | | | | Now that the bodypart code has the button we can pass that to create-overlays and simplify that.
* emacs: show: move the insertion of the header button to the top levelGravatar Mark Walters2013-06-13
| | | | | | | | | | | | | | | | | | | Previously each of the part insertion handlers inserted the part button themselves. Move this up into notmuch-show-insert-bodypart. Since a small number of the handlers modify the button (the encryption/signature ones) we need to pass the header button as an argument into the individual part insertion handlers. However, the declared-type argument was only used for the text for the part buttons we can now omit it. The patch is large but mostly simple. The only things of note are that we let the text/plain handler applies notmuch-wash to the whole part including the part button. In particular, notmuch-wash removes leading blank lines from a text/plain part, but since the button is counted as part of the part this does not happen with text/plain buttons that have a button. This is probably a bug in notmuch-wash but changing it does make several tests fail (that rely on this blank line) so, for the moment, keep the old behaviour.
* emacs: show: fake wash parts are handled at insert-bodypart levelGravatar Mark Walters2013-06-13
| | | | | | Earlier patches have moved the handling of wash fake inline patch parts to insert-bodypart so we can drop the function notmuch-show-insert-part-inline-patch-fake-part
* emacs: Fix "no such file or directory" errorGravatar Austin Clements2013-06-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Occasionally, when the user killed the search buffer when the CLI process was still running, Emacs would run the notmuch-start-notmuch-sentinel sentinel twice. The first call would process and delete the error output file and the second would fail with an "Opening input file: no such file or directory, ..." error when attempting to access the error file. Emacs isn't supposed to run the sentinel twice. The reason it does is rather subtle (and probably a bug in Emacs): 1) When the user kills the search buffer, Emacs invokes kill_buffer_processes, which sends a SIGHUP to notmuch, but doesn't do anything else. Meanwhile, suppose the notmuch search process has printed some more output, but Emacs hasn't consumed it yet (this is critical and is why this error only happens sometimes). 2) Emacs gets a SIGCHLD from the dying notmuch process, which invokes handle_child_signal, which sets the new process status, but can't do anything else because it's a signal handler. 3) Emacs returns to its idle loop, which calls status_notify, which sees that the notmuch process has a new status. This is where things get interesting. 3.1) Emacs guarantees that it will run process filters on any unconsumed output before running the process sentinel, so status_notify calls read_process_output, which consumes the final output and calls notmuch-search-process-filter. 3.1.1) notmuch-search-process-filter checks if the search buffer is still alive and, since it's not, it calls delete-process. 3.1.1.1) delete-process correctly sees that the process is already dead and doesn't try to send another signal, *but* it still modifies the status to "killed". To deal with the new status, it calls status_notify. Dun dun dun. We've seen this function before. 3.1.1.1.1) The *recursive* status_notify invocation sees that the process has a new status and doesn't have any more output to consume, so it invokes our sentinel and returns. 3.2) The outer status_notify call (which we're still in) is now done flushing pending process output, so it *also* invokes our sentinel. This patch addresses this problem at step 3.1.1, where the filter calls delete-process, since this is a strange and redundant thing to do anyway.
* emacs: Don't report CLI signals sent by Emacs as errorsGravatar Austin Clements2013-06-12
| | | | | | | | | Previously, when the user killed the search buffer before the CLI search process had completed, we would report the signal sent by Emacs to kill the CLI to the user as an error. Fix this by only reporting error exits if the process buffer is still live. We still report stderr output regardless in case stderr output was relevant to why the user killed the search buffer (such as a wrapper script being stuck).
* emacs: hello: allow deleting individual searches in the historyGravatar Servilio Afre Puentes2013-06-08
| | | | | | This commit adds an extra button at the end of the search entries that allows deleting that individual search from the history. A short confirmation («y» or «n») is made before taking action.