aboutsummaryrefslogtreecommitdiff
path: root/emacs
AgeCommit message (Collapse)Author
2014-01-26emacs: add function notmuch-assert-cli-saneDavid Bremner
If the CLI seems borked, signal an error, and log a suggestion for the user about how to recover.
2014-01-26emacs: add a function to heuristically test if the CLI is configured OK.David Bremner
We cache the result so that we can call the function many places without worrying about the cost.
2014-01-18emacs: tree: use tag-format-tagsMark Walters
Previously tree did not use tag-format-tags: since tree wants to distinguish matching messages from non-matching messages it is not a perfect fit. However, in preparation for allowing tag-changes to be shown (i.e., added or deleted tags to be indicated) it is convenient to make all places displaying tags call the same routines. We modify notmuch-tag-format-tags slightly so that it can take and argument for the default characteristics of the face before the special tag features are applied. This also means that things like the star symbol for flagged messages all work in tree.
2014-01-18emacs: tree: default face for matching/non-matching messagesMark Walters
This adds default faces for matching and non-matching messages. This makes it easier for a user to do broad customization without having to customize every field. It also fits more neatly with the next patch which switches to using notmuch-tag-format-tags for tag formatting. We set the field specific face customization to nil for all the fields which use the message default face to make it clear to a user which fields customizations are being used.
2014-01-13emacs: tree remove comma separator tagsMark Walters
Previously the tags on each line in tree view were separarted by ", " not just " ". This is different from show and search views. This patch removes this comma. This is a large patch as essentially every line of each of the expected outputs in the tree tests needs updating. Apart from aesthetic reasons this simplifies the switch to notmuch-tag-format-tags in the next patch.
2014-01-13emacs: Makefile.local: HAVE_EMACS usage fixesTomi Ollila
If we don't have emacs, disable targets that used EMACS while doing the recipes of that target. If we do have emacs, make install-emacs depend on *.elc files, as making the target will attempt to install those.
2014-01-03emacs: tree: bare-id in treeMark Walters
Previously notmuch-tree-get-message-id always returned the id including the prefix "id:". Modify the function to take an optional `bare' argument saying to return the raw string. This will be useful later and brings the function in line with notmuch-show-get-message-id.
2013-12-10emacs: add '?' to some prefix keymaps to describe its bindingsMark Walters
Added function notmuch-subkeymap-help to describe keybindings of a subkeymap (eg after . or c in notmuch-search and notmuch-show).
2013-11-20emacs: show: stop stderr appearing in bufferMark Walters
In emacs 24.3+ the stdout/stderr from externally displaying an attachment gets inserted into the show buffer. This is caused by changes in mm-display-external in mm-decode.el. Ideally, we would put this output in the notmuch errors buffer but the handler is called asynchronously so we don't know when the output will appear. Thus if we put it straight into the errors buffer it could get interleaved with other errors. Also we can't easily tell when we have got all the error output so can't wait until the process is complete. One solution would be to create a new buffer for the stderr of each attachment viewed. Again, since we can't tell when the process has finished, we can't close these buffers automatically so this will leave lots of buffers around. Thus we add a debug variable notmuch-show-attachment-debug: it this is non-nil we create a new buffer for each viewer; if this variable is nil we just use a temp buffer which means all error output is discarded (this is the same behaviour as with emacs pre 24.3).
2013-11-19emacs: do not put quoted reply in primary selectionMark Walters
In current emacs (24.3) select-active-regions is set to t by default. The reply insertion code sets the region to the quoted message to make it easy to delete (kill-region or C-w). These two things combine to put the quoted message in the primary selection. This is not what the user wanted and is a privacy risk (accidental pasting of the quoted message). We can avoid some of the problems by let-binding select-active-regions to nil. This fixes if the primary selection was previously in a non-emacs window but not if it was in an emacs window. To avoid the problem in the latter case we deactivate mark. One key test (which fails under many simpler "fixes") is: open emacs 24.3 with notmuch, open 2 windows (viewing different notmuch buffers), highlight some text in one, and then reply to a message in the other. In many of my earlier attempts to fix this big this test fails.
2013-11-13emacs: tree: use remap for the over-ridden global bindingsMark Walters
Following a suggestion by Austin in id:20130915153642.GY1426@mit.edu we use remap for the over-riding bindings in pick. This means that if the user modifies the global keymap these modifications will happen in the tree-view versions of them too. [tree-view overrides these to do things like close the message pane before doing the action, so the functionality is very close to the original common keymap function.]
2013-11-13emacs: help: add a special function to deal with remapsMark Walters
remaps are a rather unusual keymap consisting of "first key" 'remap and then "second-key" the remapped-function. Thus we do the documentation for it separately.
2013-11-13emacs: help: add base-keymapMark Walters
To support key remapping in emacs help we need to know the base keymap when looking at the remapping. keep track of this while we recurse down the sub-keymaps in help.
2013-11-13emacs: help: split out notmuch-describe-key as a functionMark Walters
The actual documentation function notmuch-describe-keymap was getting rather complicated so split out the code for a single key into its own function notmuch-describe-key.
2013-11-13emacs: help: remove duplicate bindingsMark Walters
If the user (or a mode) overrides a keybinding from the common keymap in one of the modes then both help lines appear in the help screen even though only one of them is applicable. Fix this by checking if we already have that key binding. We do this by constructing an list of (key . docstring) pairs so it is easy to check if we have already had that binding. Then the actual print help routine changes these pairs into strings "key \t docstring"
2013-11-13emacs: help: save-match-dataMark Walters
The routines that construct the help page in notmuch-lib rely on match-data being preserved across some fairly complicated code. This is currently valid but will not be when this series is finished. Thus place everything between the string-match and replace-match inside a save-match-data.
2013-11-13emacs: help: check for nil key bindingMark Walters
A standard way to unset a key binding is local-unset-key which is equivalent to (define-key (current-local-map) key nil) Currently notmuch-help gives an error and fails if a user has done this. To fix this we only add a help line if the binding is non-nil.
2013-11-13emacs: Correct documentation of `notmuch-poll-script'Austin Clements
The functions referred to in the documentation for this variable were replaced by the unified `notmuch-poll-and-refresh-this-buffer' in 21474f0e. Update the documentation to reflect the new function.
2013-11-08emacs: Fix search tagging racesAustin Clements
This fixes races in thread-local and global tagging in notmuch-search (e.g., "+", "-", "a", "*", etc.). Previously, these would modify tags of new messages that arrived after the search. Now they only operate on the messages that were in the threads when the search was performed. This prevents surprises like archiving messages that arrived in a thread after the search results were shown. This eliminates `notmuch-search-find-thread-id-region(-search)' because these functions strongly encouraged racy usage. This fixes the two broken tests added by the previous patch.
2013-11-08emacs: Use notmuch tag --batch for large tag queriesAustin Clements
(Unfortunately, it's difficult to first demonstrate this problem with a known-broken test because modern Linux kernels have argument length limits in the megabytes, which makes Emacs really slow!)
2013-11-08emacs: Support passing input via `notmuch-call-notmuch-*'Austin Clements
This adds support for passing a string to write to notmuch's stdin to `notmuch-call-notmuch-process' and `notmuch-call-notmuch-sexp'. Since this makes both interfaces a little more complicated, it also unifies their documentation better.
2013-11-08emacs: Move `notmuch-call-notmuch-process' to notmuch-libAustin Clements
Previously, this was in notmuch.el, but all of the other notmuch call wrappers were in notmuch-lib.el. Move `notmuch-call-notmuch-process' to live with its friends. This happens to fix a missing dependency from notmuch-tag.el, which required notmuch-lib, but not notmuch.
2013-11-07emacs: move the show entry to tree into show.elMark Walters
Move the keybinding and show specific helper from tree.el to show.el
2013-11-07emacs: add z to common keymapMark Walters
Add the main entry "z" to notmuch-tree to the common keymap.
2013-11-07emacs: move search based tree functions to notmuch.elMark Walters
Move a couple of the search mode specifc caller helpers for tree from tree into notmuch.el.
2013-11-07emacs: minimal change to load notmuch-tree by defaultMark Walters
We want to load notmuch-tree when notmuch is loaded, so include it as a require in notmuch.el. To avoid circular dependency we need to move one keybinding from notmuch-tree.el to notmuch.el: it makes sense for it to be defined there anyway. Since tree is now loaded by default there is no need to print a message when it is loaded.
2013-11-07emacs: add tree to the makefileMark Walters
2013-11-07emacs: move notmuch-tree from contrib to mainlineMark Walters
2013-11-07emacs: move notmuch-help to libMark Walters
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.
2013-10-27emacs: Add a space after completed tag operationsAustin Clements
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.
2013-10-27emacs: Sanitize authors and subjects in search and showAustin Clements
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.
2013-10-25emacs: Remove interactive behavior of `notmuch-tag'Austin Clements
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.
2013-10-25emacs: Use interactive specifications for tag changes in searchAustin Clements
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.
2013-10-25emacs: Use interactive specifications for tag changes in showAustin Clements
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.
2013-10-25emacs: Take prompt and current tags in `notmuch-read-tag-changes'Austin Clements
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'.
2013-10-25emacs: Fix misuse of `notmuch-tag'Austin Clements
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.
2013-10-19emacs: show: use interactive instead of current-prefix-argMark Walters
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.
2013-10-12emacs: distinguish tag `flagged' on terminalGregor Zattler
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.
2013-10-10emacs: Improved `notmuch-describe-keymap' documentationAustin Clements
2013-10-07emacs: Improve interactive use documentationAustin Clements
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).
2013-10-07emacs: Support overriding help and describing prefix actionAustin Clements
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.
2013-10-07emacs: Clean up a few documentation stringsAustin Clements
Correct some grammatical errors, fix some violations of standard documentation string formatting conventions, and be more precise.
2013-10-07emacs: `notmuch-mua-new-reply' is also not interactiveAustin Clements
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.
2013-10-07emacs: `notmuch-mua-new-forward-message' is not interactiveAustin Clements
`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.
2013-09-15emacs: bugfix unquoted symbolMark Walters
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.
2013-09-10emacs: Move ?, q, s, m, =, and G to the common keymapAustin Clements
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).
2013-09-10emacs: Define a common shared keymap for all of notmuchAustin Clements
This defines a single, currently empty keymap that all other notmuch mode maps inherit from.
2013-09-10emacs: Make notmuch-help work with arbitrary keymapsAustin Clements
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.
2013-09-10emacs: Add unified refresh-this-buffer functionAustin Clements
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.
2013-09-10emacs: Move `notmuch-poll' to notmuch-libAustin Clements