aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs
Commit message (Collapse)AuthorAge
* emacs: jump: fix compile warning on emacs 23Gravatar Mark Walters2014-09-24
| | | | | | | | | | | | | | | | | | | | | | notmuch-jump uses window-body-width which is not defined in emacs 23. To get around this it does (unless (fboundp 'window-body-width) ;; Compatibility for Emacs pre-24 (defalias 'window-body-width 'window-width)) This makes sure window-body-width is defined and all should be well. But it seems that the byte compiler does not realise that this guarantees that window-body-width will be defined and so, when compiling with emacs 23, it gives an error In end of data: notmuch-jump.el:172:1:Warning: the function `window-body-width' is not known to be defined. Domo and I came to following on irc: wrap the (unless (fboundp ...)) inside eval-and-compile which ensures that both the test and the defalias (if needed) happen at both compile and load time. This fixes the warning.
* emacs: Fix coding system in `notmuch-show-view-raw-message'Gravatar Austin Clements2014-09-21
| | | | | This fixes the known-broken test of viewing 8bit messages added by the previous commit.
* emacs: Remove redundant NTH argument from `notmuch-get-bodypart-content'.Gravatar Austin Clements2014-09-21
| | | | | | This can be derived from the PART argument (which is arguably canonical), so there's no sense in giving the caller an extra foot gun.
* emacs: jump: sort-order bugfixGravatar Mark Walters2014-09-07
| | | | | | | | | | | | | | | | | | | default-value needs its argument to be quoted. Slightly strangely default-value of 't or nil is 't or nil respectively so the code (default-value notmuch-search-oldest-first) just gives the current value of notmuch-search-oldest-first rather than intended default-value of this variable. The symptom is that if you are in a search buffer and use notmuch jump to run a saved search which does not have an explicitly set sort order then the sort order of the saved-search is inherited from the current search buffer rather than being the default search order. Thanks to Jani for finding the bug.
* emacs: Improved compatibility for window-body-width in Emacs < 24Gravatar Austin Clements2014-08-16
| | | | | | | Fix byte compiler warning "Warning: the function `window-body-width' is not known to be defined." by moving our compatibility wrapper before its use and simplify the definition to a defalias for the old name of the function.
* emacs: Expand default saved searches and add shortcut keysGravatar Austin Clements2014-08-05
| | | | | | This should help new users off to a better start with the addition of more sensible saved searches and default shortcut keys. Most existing users have probably customized this variable and won't be affected.
* emacs: Introduce notmuch-jump: shortcut keys to saved searchesGravatar Austin Clements2014-08-05
| | | | | | | | | | | | | | | This introduces notmuch-jump, which is like a user-friendly, user-configurable global prefix map for saved searches. This provides a non-modal and much faster way to access saved searches than notmuch-hello. A user configures shortcut keys in notmuch-saved-searches, which are immediately accessible from anywhere in Notmuch under the "j" key (for "jump"). When the user hits "j", the minibuffer immediately shows a helpful table of bindings reminiscent of a completions buffer. This code is a combination of work from myself (originally, "notmuch-go"), David Edmondson, and modifications from Mark Walters.
* emacs: Clarify that notmuch-poll-script is deprecatedGravatar Austin Clements2014-07-31
| | | | | | | | | notmuch-poll-script has long since been deprecated in favor of post-new hooks, but this wasn't obvious from the documentation. Update the documentation to make this clear. Since notmuch-poll-script could, to some extend, be used to control the path of the notmuch binary and that use is now clearly discouraged, promote notmuch-command to a real defcustom instead of just a variable.
* emacs: show: make return value of notmuch-show-get-prop explicitGravatar Mark Walters2014-07-30
| | | | | This makes the fact the notmuch-show-get-prop returns nil if the major mode is neither show not tree explicit.
* emacs: tree/show remove duplicate functionGravatar Mark Walters2014-07-16
| | | | | | | tree overrides notmuch-show-get-prop so that it can use many of the utility function directly. Now that tree is in mainline the version from tree can be moved to show and the original overridden show version dropped.
* emacs: set default in notmuch-read-queryGravatar Mark Walters2014-07-15
| | | | | | | | | | | | | | This adds the current query as a "default value" to notmuch-read-qeury. The default value is available via a down-arrow as opposed to history which is available from the up arrow. Note if a user presses return in the minibuffer this value is not returned. The implementation is simple but notmuch-read-query could be called via notmuch-search/notmuch-tree etc from any buffer so it makes sense to put the decision of how to extract the current query in notmuch-read-query rather than in each of the callers.
* emacs: search archive tweakGravatar Mark Walters2014-07-15
| | | | | | | notmuch-search-archive-thread moves to the next line after tagging. In the normal case this makes sense, but if the region is active, it tags the whole region and then it doesn't really. Thus only move to the next line if region is not active.
* emacs: show: add an update seen function to post-command-hookGravatar Mark Walters2014-07-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a function for updating seen messages to the post-command-hook. This function calls a customizable (by eg defcustom) function with parameters the start and end of the current window and that function can decide what to mark read based on that and the current point. Since this is in the post-command-hook it should get called after most user actions (exceptions include user resizing the window) so it should be possible to make sure the seen status gets updated whether the user uses notmuch commands like next-message or normal emacs commands like scroll-up. It removes all of the old mark read/seen points but introduces a simple example function that just marks the current message read if it is open. This function has one small subtlety: it makes sure it doesn't mark the same message read twice (in the same instance of the same buffer); otherwise the post-command-hook makes it impossible for a user to manually mark a message unread. This fixes the current bugs (imo) that closed messages can be marked read, and that opening a closed message does not mark it read. Another advantage of using the post-command-hook any programmatic use with point passing through a message will not mark it read.
* emacs: Fix indentation.Gravatar David Edmondson2014-07-13
| | | | Fix the indentation of `notmuch-show-mode-map'.
* emacs: Forwarded messages should not have modified buffersGravatar David Edmondson2014-06-22
| | | | | | When the user begins forwarding a message, the resulting composition buffer should not be marked as modified, in order that it can immediately be killed without prompting.
* Merge branch 'release'Gravatar David Bremner2014-06-15
|\ | | | | | | still painfully slowly assembling 0.18.1
| * emacs install: make sure all components to be installed are thereGravatar Tomi Ollila2014-06-15
| | | | | | | | | | | | | | | | | | `make install-emacs` will copy $(emacs_sources), $(emacs_images) and $(emacs_bytecode) to their target directories. $(emacs_bytecode) was already a prerequisite of make install-emacs as these obviously needed to be build. Until a while ago all of $(emacs_sources) was available in the repository, but now it includes `notmuch-version.el` which is generated. In the future we may have generated emacs images too.
* | Merge branch 'release'Gravatar David Bremner2014-05-28
|\| | | | | | | | | A point release is slowly being built on branch release. Merge those changes into master.
| * emacs: make sure tagging on an empty query is harmlessGravatar Mark Walters2014-05-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently notmuch-tag throws a "wrong-type-argument stringp nil" if passed a nil query-string. Catch this and provide a more useful error message. This fixes a case in notmuch-tree (if you try to tag when at the end of the buffer). Secondly, as pointed out by David (dme) `notmuch-search-find-stable-query-region' can return the query string () if there are no messages in the region. This gets passed to notmuch tag, and due to interactions in the optimize_query code in notmuch-tag.c becomes, in the case tag-change is -inbox, "( () ) and (tag:inbox)". This query matches some strange collection of messages which then get archived. This should probably be fixed, but in any case make `notmuch-search-find-stable-query-region' return a nil query-string in this case. This avoids data-loss (random tag removal) in this case.
* | emacs: Correct the documentation for `notmuch-search-line-faces'.Gravatar David Edmondson2014-05-18
| | | | | | | | | | | | | | The implementation and documentation for `notmuch-search-line-faces' disagreed in how elements in the list were merged. Correct the documentation to match the implementation (that is, the earlier elements in the list have precedence over later elements).
* | emacs: allow functions in notmuch-show-stash-mlarchive-link-alistGravatar Jani Nikula2014-05-04
|/ | | | | | | | | | | | | | | | | | Some archives may use a more complicated scheme for referring to messages than just concatenated url and message-id. In particular, patchwork requires a query to translate message-id to a patchwork patch id. Allow functions in notmuch-show-stash-mlarchive-link-alist to facilitate this. For example, one could use something like this for patchwork. (lambda (message-id) (concat "http://patchwork.example.com/patch/" (nth 0 (split-string (car (last (process-lines "pwclient" "search" "-n" "1" "-m" (concat "<" message-id ">"))))))))
* emacs: hello: bugfix for saved searches defcustomGravatar Mark Walters2014-04-21
| | | | | | | | | | | | | | | | | | | | The recent changes for saved searches introduced a bug when notmuch was loaded after the saved search was defined. This was caused by a utility function not being defined when the defcustom was loaded. Fix this by moving some code around: the defcustom is moved into notmuch-hello (which is a more natural place anyway), and the utility functions are moved before the defcustom in notmuch-hello. We are rather constrained as the defcustom for saved searches is the first variable in the notmuch-hello customize window; to avoid moving this customize the defcustom needs to be the first defcustom in notmuch-hello, and the utility functions come before that. This patch also renames one of the utility functions from notmuch--saved-searches-to-plist to notmuch-hello--saved-searches-to-plist (as it is purely local to notmuch-hello) and corrects a couple of typo/spelling mistakes pointed out by Tomi.
* emacs: Honor debug-on-error for part renderersGravatar Austin Clements2014-04-19
| | | | | | Previously, even if debug-on-error was non-nil, the debugger would not trap on part renderer errors. This made debugging part renderer bugs frustrating, so let the debugger trap these errors.
* emacs: hello: bugfix: make alphabetically sorted saved searches workGravatar Mark Walters2014-04-14
| | | | | | | | | | | My recent changes to the saved search format broke the alphabetically sorted saved sort option. This makes it work again. Also update docs for saved-search sort defcustom to match the new format. Finally, since the saved-search list is no longer an alist change the names in the sort function to avoid confusion.
* emacs: remove auto-signing of replies to signed messagesGravatar Jameson Graef Rollins2014-04-14
| | | | | | | | | | It was decided that auto-signing is potentially too troublesome for the apparently common case of users who enable crypto processing for the purpose of checking signature validity but who are not in a position to sign out-going messages. Users can still manually invoke signing as needed. Encrypting replies to encrypted messages is more of a security issue so we leave it in place.
* emacs: add $(srcdir) to notmuch-version.el.tmpl dependencyGravatar Tomi Ollila2014-04-13
| | | | This fixes out-of-tree build when generating emacs/notmuch-version.el.
* emacs: sign/encrypt replies to signed/encrypted messagesGravatar Jani Nikula2014-04-12
| | | | | | | | | | | | | | This is a simple approach to improving security when replying to signed or encrypted messages. If the message being replied to was signed, add mml tag to sign the reply. If the message being replied to was encrypted, add mml tag to sign and encrypt the reply. This may need configuration; I for one might want to encrypt replies to encrypted messages, but not always sign replies to signed messages. This still includes a slight bug: if any mml tags are added, they are included in the region containing the quoted parts. Killing the region will kill the mml tags too.
* emacs: Add a sort-order option to saved-searchesGravatar Mark Walters2014-04-11
| | | | | | | | | This adds a sort-order option to saved-searches, stores it in the saved-search buttons (widgets), and uses the stored value when the button is pressed. Storing the sort-order in the widget was suggested by Jani in id:4c3876274126985683e888641b29cf18142a5eb8.1391771337.git.jani@nikula.org.
* emacs: hello: switch notmuch-hello-insert-buttons to plistsGravatar Mark Walters2014-04-11
| | | | | Switching notmuch-hello-insert-buttons to plists means we can easily pass extra options through to the buttons.
* emacs: hello: add a customize for saved-searchesGravatar Mark Walters2014-04-11
| | | | | | Make the defcustom for notmuch-saved-searches use the new plist format. It should still work with oldstyle saved-searches but will write the newstyle form.
* emacs: hello: use the saved-search helper functionsGravatar Mark Walters2014-04-11
| | | | | This uses the helper functions: the saved searches format has not changed yet but backwards compatibility means everything still works.
* emacs: hello: add helper functions for saved-searchesGravatar Mark Walters2014-04-11
| | | | | | Add helper functions to for saved searches to ease the transition to the new plist form while maintaining backwards compatibility. They will be used in the next patch.
* emacs: defun notmuch-hello-versions and bind 'v' in hello mode to itGravatar Tomi Ollila2014-04-10
| | | | | | If notmuch cli & notmuch emacs MUA versions differ, print also the emacs MUA version string (along with the cli version) to the minibuffer.
* emacs: add notmuch-version.el.tmpl and create notmuch-version.el from itGravatar Tomi Ollila2014-04-10
| | | | | | | | | The notmuch cli program and emacs lisp versions may differ (especially in remote usage). It helps to resolve problems if we can determine the versions of notmuch cli and notmuch emacs mua separately. The build process now creates notmuch-version.el from template file by filling the version info to notmuch-emacs-version variable.
* emacs: push mark before signature on replyGravatar Jani Nikula2014-03-30
| | | | | | | | We push mark on reply so user can cut the quote. Push the mark before signature, if any, instead of end of buffer so the signature is preserved. This is consistent with message-kill-to-signature.
* emacs: add defcustom notmuch-init-file and load it if existsGravatar Tomi Ollila2014-03-30
| | | | | | | So that users can easily organize their notmuch-specific configurations to separate file and they don't have to have notmuch configurations in *every* emacs installation they launch, especially if those need to '(require notmuch) to make the configurations possible.
* emacs: instruct user to autoload notmuch instead of require'ing itGravatar Tomi Ollila2014-03-30
| | | | | | | | | | | | | When (require 'notmuch) is added to ~/.emacs notmuch is loaded to every instance of emacs although it may not be used in majority of those instances. When (autoload 'notmuch "notmuch" ...) is added to ~/.emacs notmuch is loaded (only) when user invokes the notmuch function. User may want to add other entrypoints to notmuch by adding more autoloads -- the autoload instruction given should offer them clue how to do so.
* emacs: Use whitelist instead of blacklist for term escapingGravatar Austin Clements2014-03-25
| | | | | | | | | | | | Previously, the term escaper used a blacklist of characters that needed escaping. This blacklist turned out to be somewhat incomplete; for example, it did not contain non-whitespace ASCII control characters or Unicode "fancy quotes", both of which do require the term to be escaped. Switch to a whitelist of characters that are definitely safe to leave unquoted. This fixes the broken test introduced by the previous patch.
* emacs: tree: use orig-tags in searchGravatar Mark Walters2014-03-24
| | | | | | | This uses the recent functionality to show the tag changes in the tree buffer. Currently this is only used to show changes the tree buffer makes itself: i.e., it does not make display any changes reflecting tagging done by other notmuch-buffers.
* emacs: search: use orig-tags in searchGravatar Mark Walters2014-03-24
| | | | | | | This uses the recent functionality to show the tag changes in the search buffer. Currently this is only used to show changes the search buffer makes itself: i.e., it does not make display any changes reflecting tagging done by other notmuch-buffers.
* emacs: show: use orig-tags for tag displayGravatar Mark Walters2014-03-24
| | | | | This uses the previous patch to show the tag changes that have occured in the show buffer since it was last loaded/refreshed.
* emacs: show: mark tags changed since buffer loadedGravatar Mark Walters2014-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows (and requires) the original-tags to be passed along with the current-tags to be passed to notmuch-tag-format-tags. This allows the tag formatting to show added and deleted tags.By default a removed tag is displayed with strike-through in red (if strike-through is not available, eg on a terminal, inverse video is used instead) and an added tag is displayed underlined in green. If the caller does not wish to use the new feature it can pass current-tags for both arguments and, at this point, we do exactly that in the three callers of this function. Note, we cannot tidily allow original-tags to be optional because we would need to distinguish nil meaning "we are not specifying original-tags" from nil meaning there were no original-tags (an empty list). We use this in subsequent patches to make it clear when a message was unread when you first loaded a show buffer (previously the unread tag could be removed before a user realised that it had been unread). The code adds into the existing tag formatting code. The user can specify exactly how a tag should be displayed normally, when deleted, or when added. Since the formatting code matches regexps a user can match all deleted tags with a ".*" in notmuch-tag-deleted-formats. For example setting notmuch-tag-deleted-formats to '((".*" nil)) tells notmuch not to show deleted tags at all. All the variables are customizable; however, more complicated cases like changing the face depending on the type of display will require custom lisp. Currently this overrides notmuch-tag-deleted-formats for the tests setting it to '((".*" nil)) so that they get removed from the display and, thus, all tests still pass.
* emacs: tag: add customize for deleted/added tag formatsGravatar Mark Walters2014-03-24
| | | | | | | | | | | | | | Add customize options for deleted/added tag formats. These are not used yet but will be later in the series. We switch to using `notmuch-apply-face' rather than `propertize' in the defcustom for faces so that the faces for deleted/added tags add to the default face attributes for the tag. We special case deleting the unread tag as that tag is a strong visual cue and we don't need that cue when we are just saying it used to be unread. Thus, we revert to the normal tag face with strikethough for deleted unread tags.
* emacs: tag split customise option for format-tags into a widgetGravatar Mark Walters2014-03-24
| | | | | | We will re-use the customize option for format-tags for formattting deleted tags to added tags in the next patch so split it into a widget. There should be no functional change.
* Make keys of notmuch-tag-formats regexps and use cachingGravatar Austin Clements2014-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This modifies `notmuch-tag-format-tag' to treat the keys of `notmuch-tag-formats' as (anchored) regexps, rather than literal strings. This is clearly more flexible, as it allows for prefix matching, defining a fallback format, etc. This may cause compatibility problems if people have customized `notmuch-tag-formats' to match tags that contain regexp specials, but this seems unlikely. Regular expression matching has quite a performance hit over string lookup, so this also introduces a simple cache from exact tags to formatted strings. The number of unique tags is likely to be quite small, so this cache should have a high hit rate. In addition to eliminating the regexp lookup in the common case, this cache stores fully formatted tags, eliminating the repeated evaluation of potentially expensive, user-specified formatting code. This makes regexp lookup at least as fast as assoc for unformatted tags (e.g., inbox) and *faster* than the current code for formatted tags (e.g., unread): inbox (usec) unread (usec) assoc: 0.4 2.8 regexp: 3.2 7.2 regexp+caching: 0.4 0.4 (Though even at 7.2 usec, tag formatting is not our top bottleneck.) This cache must be explicitly cleared to keep it coherent, so this adds the appropriate clearing calls.
* emacs: Combine notmuch-combine-face-text-property{, -string}Gravatar Austin Clements2014-03-24
| | | | | | | | | This combines our two face combining functions into one, easy to use function with a much shorter name: `notmuch-apply-face'. This function takes the full set of arguments that `notmuch-combine-face-text-property' took, but takes them in a more convenient order and provides smarter defaults that make the function easy to use on both strings and buffers.
* emacs: add path: prefix to query completionGravatar Jani Nikula2014-03-23
| | | | Complete to the new path: prefix.
* emacs: use the originating buffer's working directory for pipeGravatar Jani Nikula2014-03-04
| | | | | | | | | | | | | Currently notmuch-show-pipe-message runs the command in the working directory of the *notmuch-pipe* buffer if it exists, and the current buffer's working directory (which is inherited to the new *notmuch-pipe* buffer) otherwise. This is all very surprising to the user, and it's difficult to know or change where the command will be run. Always use the current show buffer's working directory for piping. The user can check that with M-x pwd and change it with M-x cd. This is consistent with notmuch-show-pipe-part.
* emacs: Simplify and fix `notmuch-mua-prompt-for-sender'Gravatar Austin Clements2014-03-04
| | | | | | | | | | | | | | | | | | | | `notmuch-mua-prompt-for-sender' is over-engineered and often wrong. It attempts to detect when all identities have the same name and specialize the prompt to just the email address part. However, to do this it uses `mail-extract-address-components', which is meant for displaying email addresses, not general-purpose parsing, and hence performs many canonicalizations that can interfere with this use. For example, configuring notmuch-identities to ("Austin <austin@example.com>"), will cause `notmuch-mua-prompt-for-sender' to lose the name part entirely and return " <austin@example.com>". This patch rewrites `notmuch-mua-prompt-for-sender' to simply prompt for a full identity when notmuch-identities is configured, or to prompt for a sender address when it isn't. The original code also did several strange things, like using `eval' and specifying that this function was interactive. As a side-effect, this patch fixes these problems. And it adds a docstring.
* emacs: remove newlines from input to notmuch count --batchGravatar David Bremner2014-02-25
| | | | | | | | | | | Since a newline starts a new query in batch mode, this causes mysterious crashes in the emacs interface if saved searches contain newlines. See the discussion at id:87wqhcxb5j.fsf@maritornes.cs.unb.ca In general newlines seem to be just whitespace to the xapian query parser, so this should be mainly harmless.