Commit graph

34 commits

Author SHA1 Message Date
Jani Nikula
97f3d55ad9 completion: complete notmuch emacs-mua
With subcommand handling for external commands we can easily complete
'notmuch emacs-mua' using the existing completion system.
2017-03-01 19:33:33 -04:00
Jani Nikula
c7df0cca9e completion: add bash completion for query: and property:
Add prefix completion for query and property, with value completion
for query. Apparently there's no way to get at the available
properties in the cli.
2017-02-26 07:57:42 -04:00
Jani Nikula
4d486cf94d completion: complete mimetype: search prefix
Use /etc/mime.types if available, parsed using a sed one-liner, and
fall back to a handful of common types otherwise.
2016-11-12 07:33:36 -04:00
Daniel Kahn Gillmor
6a833a6e83 Use https instead of http where possible
Many of the external links found in the notmuch source can be resolved
using https instead of http.  This changeset addresses as many as i
could find, without touching the e-mail corpus or expected outputs
found in tests.
2016-06-05 08:32:17 -03:00
Daniel Kahn Gillmor
8540c36a96 completion: update the location of the bash-completion project
Alioth currently redirects to github, so point there instead.
2016-06-05 08:26:16 -03:00
Jani Nikula
4cff5a9f98 completion: complete lastmod: search prefix 2015-10-21 21:30:15 -03:00
Jani Nikula
23180439cb completion: clean up top level completion
Add note about missing features.
2015-10-21 21:29:53 -03:00
Jani Nikula
cd4814ecb3 completion: complete shared options for each command
Add support for completing --help, --uuid=, and --version after the
subcommand. Do not support shared options at the top level yet due to
difficulties in handling options with arguments.

--uuid necessitates adding 'compopt -o nospace' also to notmuch new
completion, but that just brings it in line with the rest.
2015-10-21 21:29:20 -03:00
Jani Nikula
326824aee3 completion: complete notmuch count --lastmod 2015-10-21 21:22:02 -03:00
Jani Nikula
ddbda8f501 completion: handle notmuch address --deduplicate= option
Complete notmuch address --deduplicate=(no|mailbox|address).
2015-10-21 21:21:45 -03:00
Jani Nikula
76f8498df6 completion: complete addresses in from:/to: search terms
Use the new notmuch address command to do completion for addresses in
from: and to:. Use --output=sender for both for efficiency, even
though --output=recipients would be more accurate for to: prefix
completion.
2015-03-13 07:56:38 +01:00
David Bremner
35e49601c4 completion: update list of commands in zsh completion.
This is actually generated by the script in

     id:1420289900-29717-2-git-send-email-david@tethera.net

We may as well update the list of commands while we decide if it's
worth automating the process. Note that there is a bit more noise than
expected because it alphabetizes all of the commands with their own
man pages.
2015-03-06 08:02:33 +01:00
Jani Nikula
647c0b0692 completion: complete notmuch dump --gzip option 2015-02-23 21:49:08 +01:00
Todd
694c7b9ba7 Update completions for Emacs and bash
This adds completions for both Emacs and bash. ZSH does not appear to
have completions for search terms.
2015-01-24 16:50:02 +01:00
Jani Nikula
08928573e4 completion: remove the broken notmuch-completion.tcsh
The tcsh completion is minimal yet doesn't work at all. We're better
off without it, it's more embarrassing than useful.
2015-01-03 09:35:09 +01:00
Jani Nikula
2dfbb7598b completion: complete notmuch insert --folder to maildir folders only
The --folder option expects a folder relative from maildir root, so
complete like the folder: search term.
2015-01-02 16:51:00 +01:00
Jani Nikula
516a1b37b6 completion: complete notmuch insert --keep and --no-hooks options 2015-01-02 16:50:45 +01:00
Michal Sojka
a5a6859197 cli: address: Add --output=count
This output prints how many times was each address encountered during
search.
2014-11-05 23:25:05 +01:00
Michal Sojka
5c27136e64 cli: Introduce "notmuch address" command
This moves address-related functionality from search command to the
new address command. The implementation shares almost all code and
some command line options.

Options --offset and --limit were intentionally not included in the
address command, because they refer to messages numbers, which users
do not see in the output. This could confuse users because, for
example, they could see more addresses in the output that what was
specified with --limit. This functionality can be correctly
reimplemented for address subcommand later.

Also useless values of --exclude flag were not included in the address
command.

This was inspired by a patch from Jani Nikula.
2014-11-05 23:19:12 +01:00
Michal Sojka
3cc8ed5978 cli: search: Add --output={sender,recipients}
The new outputs allow printing senders, recipients or both of matching
messages. To print both, the user can use --output=sender and
--output=recipients simultaneously.

Currently, the same address can appear multiple times in the output.
The next commit will change this. For this reason, tests are
introduced there.

We use mailbox_t rather than InternetAddressMailbox because we will
need to extend it in a following commit.

This code is based on a patch from Jani Nikula.
2014-11-01 08:02:58 +01:00
Jani Nikula
523f06a0ad completion: fail silently if _init_completion is not found
The completion script depends on bash-completion 1.90 or later, with
_init_completion function. If that's not present, for some reason, the
completion currently fails with an ugly message, messing up user's
command line:

$ notmuch -bash: _init_completion: command not found

It's better to just not complete
2014-08-22 17:02:41 -07:00
Jani Nikula
b6238f7e51 completion: complete directory parameters to directories only
i.e. don't complete to files if only directories are acceptable.
2014-03-25 20:00:24 -03:00
Jani Nikula
d5822224da completion: add proper completion of folder: and path:
Complete folder: to maildir folders and path: to directories in mail
store.
2014-03-25 20:00:13 -03:00
Jani Nikula
b220aefdf9 completion: bash completion for notmuch new --quiet option
notmuch new now has --quiet option, complete it too.
2014-02-03 16:19:49 -04:00
Jani Nikula
db5189a3b9 completion: update bash completion
Update bash completion to cover new commands and options:

notmuch compact --quiet --backup=DIR
notmuch count --output=files --batch --input=FILE
notmuch insert --folder=DIR --create-folder
notmuch search --exclude=all --duplicate=N
notmuch show --include-html
notmuch tag --batch --input=FILE --remove-all
2013-11-11 07:45:04 -04:00
Jani Nikula
703136c57b completion: update README about bash completion dependencies 2013-03-30 18:31:01 -04:00
Jani Nikula
2302fd7925 completion: complete bash completion rewrite
Rewrite the bash completion script to actually do something
useful. Supported completions:

* All the notmuch commands, command line arguments, and values for
  keyword arguments.

* Tags after + and - in 'notmuch tag'.

* Config options in 'notmuch config', and some config option values.

* Search prefixes in all commands that use search terms.

* Tags after tag: prefix in search terms.

* User's email addresses after from: and to: in search terms.

This is all based on the bash-completion package [1], and will not
work without it.

[1] http://bash-completion.alioth.debian.org/
2013-03-28 15:07:54 -04:00
Pieter Praet
730acd4764 fix sum moar typos [build scripts, Makefiles]
Various typo fixes in comments within the Makefile and other build scripts.

Signed-off-by: Pieter Praet <pieter@praet.org>

Edited-by: Carl Worth <cworth@cworth.org> Restricted to just build files.
2011-06-23 15:44:59 -07:00
Carl Worth
3e4a9d60a9 build: Add support for non-source-directory builds.
Such as:

     mkdir build
     cd build
     ../configure
     make

This is implemented by having the configure script set a srcdir
variable in Makefile.config, and then sprinkling $(srcdir) into
various make rules. We also use vpath directives to convince GNU make
to find the source files from the original source directory.
2011-03-09 15:10:03 -08:00
Carl Worth
1a915d1b38 Makefile: Quote variables used as filenames in shell commands
This allows support for filenames with spaces in them.
2011-01-26 23:36:52 +10:00
Michal Sojka
f806dd3a8f Fix installation of zsh completion 2011-01-26 22:32:30 +10:00
Cédric Cabessa
26b4cc4aad configure: add options to disable emacs/zsh/bash and choose install dir.
add --bashcompletiondir and --zshcompletiondir (like --emacslispdir) to choose
installation dir for bash/zsh completion files

Make some features optional:
  --without-emacs / --with-emacs=no do not install lisp file
  --without-bash-completion / --with-bash-completion=no  do not install bash
files
  --without-zsh-completion / --with-zsh-completion=no do not install zsh files
By default, everything is enabled. You can reenable something with
  --with-feature=yes
2011-01-26 22:30:32 +10:00
Carl Worth
b5d8fe2784 Makefile: Move the completion-specific commands to completion/Makefile.local
For much better modularity.
2010-04-06 14:36:31 -07:00
Carl Worth
e1a84ab173 Rename the "contrib" directory to "completion".
The original "contrib" name is lousy. Everything in notmuch has been
contributed, and we are integrating as much of it as possible, (rather
than making users grub through contrib looking for useful pieces to
install).

Meanwhile, the only things we have in contrib are command-line
completion scripts, so "completion" makes more sense as a name, (and
helps make "./configure" slightly less ambiguous).
2010-04-06 14:36:31 -07:00