Commit graph

54 commits

Author SHA1 Message Date
David Bremner
a6a8df7e03 build: drop variable HAVE_EMACS. use WITH_EMACS instead
The extra flexibility of having both HAVE_EMACS (for yes, there is an
emacs we can use) and WITH_EMACS (the user wants emacs support) lead
to confusion and bugs. We now just force WITH_EMACS to 0 if no
suitable emacs is detected.
2019-06-12 19:58:30 -03:00
David Bremner
e4a8d6e2a4 build: only try to build .rsti files if we have emacs and sphinx
Emacs is needed to build them, and sphinx is needed to use them
2019-04-24 06:53:13 -03:00
David Bremner
0a9fc49b90 emacs: build docstring (rsti) files
These are intended to included in the sphinx manual for notmuch-emacs.
The stamp file makes it easier to depend on the docstrings from other
parts of the build
2018-12-08 08:49:31 -04:00
David Bremner
ef07e3f3bd build: install notmuch-emacs-mua with absolute shebang
Follow distro-centric rules to reduce the chance of surprising
behaviour due to PATH changes
2018-09-18 07:34:33 -03:00
David Bremner
95f441b06b doc: install info files in elpa package
The duplication of effort in installing into different places seems
unavoidable; or more precisely not worth avoiding by more extensive
gnu-make-isms.
2018-05-26 08:26:22 -07:00
Jani Nikula
383796c325 build: update the desktop database after installing the desktop file
This makes the option to choose Notmuch as mailto: handler show up in
the desktop environment settings. Ignore errors.
2016-11-28 22:04:26 -04:00
Jani Nikula
459989b7ef build: install notmuch-emacs-mua.desktop file with emacs
There is really no need to have a separate install target for the
desktop file. Just install the desktop file with emacs, with a
configure option to opt out.
2016-11-28 22:01:45 -04:00
Jani Nikula
66c1bff416 notmuch.desktop: move under emacs as notmuch-emacs-mua.desktop
The notmuch.desktop file is part of notmuch-emacs. Move it under
emacs, and rename as notmuch-emacs-mua.desktop to reflect this.
2016-11-26 08:16:39 -04:00
Jani Nikula
440d24e7cc build: install notmuch-emacs-mua with notmuch-emacs
notmuch-emacs-mua is good enough to be installed with notmuch-emacs.
2016-11-26 08:16:19 -04:00
David Bremner
10f8c5d205 build/emacs: add target to create elpa package
This package can be created without emacs, but will only be usable in
versions of emacs supporting package.el
2016-11-26 07:57:58 -04:00
David Bremner
60ac94fe58 Merge branch 'release'
Updates for 0.23.2
2016-11-17 08:25:08 -04:00
David Bremner
297d27e9f9 emacs: generate notmuch-pkg.el
This file contains metadata for the built in (as of emacs 24) packaging
system.
2016-11-16 21:45:56 -04:00
Mark Walters
a3e712fa86 emacs: add compatibility functions for emacs 23
Some of the recent changes to the emacs code have used functions
introduced in emacs 24. The functions used are read-char-choice and
setq-local. This changeset adds a file notmuch-compat.el which
contains compatibility functions so that it should work on emacs
23.

Note, since these functions are taken almost unchanged from the emacs
source they are copyright the Free Software Foundation, and the header
in the file reflects that.
2016-11-16 21:42:34 -04:00
Mark Walters
d820b97477 emacs: postpone a message
This provides initial support for postponing in the emacs frontend;
resuming will follow in a later commit. On saving/postponing it uses
notmuch insert to put the message in the notmuch database

Current bindings are C-x C-s to save a draft, C-c C-p to postpone a
draft (save and exit compose buffer).

Previous drafts get tagged deleted on subsequent saves, or on the
message being sent.

Each draft gets its own message-id, and we use the namespace
draft-.... for draft message ids (so, at least for most people, drafts
are easily distinguisable).
2016-11-13 12:55:24 -04:00
Tomi Ollila
a79936cd6f emacs/Makefile.local: notmuch-lib.elc depend on notmuch-version.elc
emacs/make-depend.el will compute all other related dependencies
except this one:

notmuch-version is not top-level `require' expression in
notmuc-lib.el[c] but conditional based on the existence of
notmuch-version.el[c].

emacs/make-depend.el does not know now notmuch-version.el[c] becomes
into existence but emacs/Makefile.local does know.
2015-11-23 08:14:46 -04:00
Michal Sojka
4acbc1f7d3 Emacs: Add address completion based on company-mode
When company-mode is available (Emacs >= 24), address completion
candidates are shown in a nice popup box. This is triggered either by
pressing TAB or by waiting a while during typing an address. The
completion is based entirely on the asynchronous address harvesting
from notmuch-address.el so the GUI is theoretically not blocked for
long time.

The completion works similarly as the TAB-initiated completion from
notmuch-address.el, i.e. quick harvest based on user input is executed
first and only after full harvesting is finished, in-memory cached data
is used.

[Improved by David Bremner]
2015-10-27 08:01:15 -03:00
Austin Clements
3c1ad5bfa0 emacs: Introduce notmuch-jump: shortcut keys to saved searches
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.
2014-08-05 08:07:27 -03:00
Tomi Ollila
f0ad36cb7f emacs install: make sure all components to be installed are there
`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.
2014-06-15 15:40:51 -03:00
Tomi Ollila
c2048addd4 emacs: add $(srcdir) to notmuch-version.el.tmpl dependency
This fixes out-of-tree build when generating emacs/notmuch-version.el.
2014-04-13 08:42:51 -03:00
Tomi Ollila
cab1415a94 emacs: add notmuch-version.el.tmpl and create notmuch-version.el from it
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.
2014-04-10 23:25:36 -03:00
Austin Clements
7c0a1b4d60 emacs: Avoid rebuilding .eldeps even when there's nothing to do
Previously, we updated .eldeps only if the file contents actually
needed to change.  This was done to avoid unnecessary make restarts
(if the .eldeps rule changes the mtime of .eldeps, make has to restart
to collect the new dependencies).  However, this meant that, after a
modification to any .el file that did not change dependencies, .eldeps
would always be out of date, so every make invocation would run the
.eldeps rule, which is both expensive because it starts up Emacs and
noisy.  This was true even when there was nothing to do.  E.g.,

$ make clean && make
...
$ touch emacs/notmuch-lib.el && make
...
$ make
Use "make V=1" to see the verbose compile lines.
EMACS emacs/.eldeps
make: Nothing to be done for `all'.
$ make
Use "make V=1" to see the verbose compile lines.
EMACS emacs/.eldeps
make: Nothing to be done for `all'.

Fix this by replacing .eldeps with two files with identical content.
One tracks the mtime of the dependency information and triggers the
Emacs call to rebuild dependencies only when it may be necessary.  The
other tracks the content only; this rule over-triggers in the same way
the old rule did, but this rule is cheap and quiet.
2014-02-21 21:07:23 -04:00
Tomi Ollila
f2a3d9799d emacs: Makefile.local: HAVE_EMACS usage fixes
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-13 14:12:05 -04:00
Mark Walters
6e56912d13 emacs: add tree to the makefile 2013-11-07 07:39:52 -04:00
Austin Clements
b89ffba301 emacs: Streaming S-expression parser
This provides the same interface as the streaming JSON parser, but
reads S-expressions incrementally.  The only difference is that the
`notmuch-sexp-parse-partial-list' helper does not handle interleaved
error messages (since we now have the ability to separate these out at
the invocation level), so it no longer takes an error function and
does not need to do the horrible resynchronization that the JSON
parser had to.

Some implementation improvements have been made over the JSON parser.
This uses a vector instead of a list for the parser data structure,
since this allows faster access to elements (and modern versions of
Emacs handle storage of small vectors efficiently).  Private functions
follow the "prefix--name" convention.  And the implementation is much
simpler overall because S-expressions are much easier to parse.
2013-06-01 08:56:25 -03:00
Austin Clements
68720286eb emacs: Compute build dependencies to fix byte compile issues
Previously, we simply byte compiled each Elisp source file
independently.  This is actually the wrong thing to do and can lead to
issues with macros and performance issues with substitutions because
1) when the byte compiler encounters a (require 'x) form, it will load
x.elc in preference to x.el, even if x.el is newer, and as a result
may load old macro and substitution definitions and 2) if we update a
macro or substitution definition in one file, we currently won't
re-compile other files that depend on the file containing the
definition.

This patch addresses these problems by computing make dependency rules
from the (require 'x) forms in the Elisp source files, which we inject
into make's dependency database.
2013-05-23 08:06:12 -03:00
Jameson Graef Rollins
eb8feb1666 emacs: create notmuch-tag.el, and move appropriate functions from notmuch.el
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.
2012-04-29 17:39:37 -03:00
David Edmondson
05f4904616 emacs: Improved printing support.
Add various functions to print notmuch messages and tie them together
with a simple frontend.

Add a binding ('#') in `notmuch-show-mode' to print the current
message.

one trailing space removed by db.
2012-01-21 08:38:38 -04:00
Amadeusz Żołnowski
e6d85fb97d Separate Emacs misc. files dir. from Emacs code dir.
New option --emacsetcdir was added, but it's set default to the same
value as --emacslispdir for backward compatibility.
2011-10-28 14:07:44 -03:00
Carl Worth
e5dafc9051 Makefile: Make emacs compilation depend on global dependencies.
We call these "global_deps" for a reason, after all!

Without this, emacs compilation would proceed even if the configure script
failed, (such as for a missing dependency). That's undesirable as it can
cause the helpful error messages from the configure failure to scroll away.
2011-06-28 11:59:48 -07:00
Jameson Graef Rollins
45fe354745 emacs: Add support for PGP/MIME verification/decryption
A new emacs configuration variable "notmuch-crypto-process-mime"
controls the processing of PGP/MIME signatures and encrypted parts.
When this is set true, notmuch-query will use the notmuch show
--decrypt flag to decrypt encrypted messages and/or calculate the
sigstatus of signed messages.  If sigstatus is available, notmuch-show
will place a specially color-coded header at the begining of the
signed message.

Also included is the ability to switch decryption/verification on/off
on the fly, which is bound to M-RET in notmuch-search-mode.
2011-05-27 16:22:00 -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
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
Jesse Rosenthal
b749bd5390 Add notmuch-message.el to emacs/Makefile.local
When notmuch-message.el was added to the emacs directory, I neglected to
add it to the makefile as one of the emacs_sources. This patch adds it.
2010-04-27 10:19:09 -07:00
Sebastian Spaeth
36245db69d Integrate notmuch-maildir-fcc into notmuch
Require notmuch-maildir-fcc and also install it.
Rename all jkr/* functions to notmuch-maildir-fcc-*

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
2010-04-26 11:58:34 -07:00
David Edmondson
01ec4d3bcb emacs: Add more functions to clean up text/plain parts
Add:
- notmuch-wash-wrap-long-lines: Wrap lines longer than the width of
  the current window whilst maintaining any citation prefix.
- notmuch-wash-tidy-citations: Tidy up citations by:
  - compress repeated otherwise blank citation lines,
  - remove otherwise blank citation lines at the head and tail of a
    citation,
- notmuch-wash-elide-blank-lines: Compress repeated blank lines and
  remove leading and trailing blank lines.

None of these is enabled by default - add them to
`notmuch-show-insert-text/plain-hook' to use.

Reviewed-by: Carl Worth <cworth@cworth.org>: I previously committed a
stale version of this patch.
2010-04-26 10:05:46 -07:00
Carl Worth
6408270512 Revert "emacs: Add more functions to clean up text/plain parts"
This reverts commit 97570954cb.
2010-04-26 10:05:29 -07:00
David Edmondson
97570954cb emacs: Add more functions to clean up text/plain parts
Add:
- notmuch-wash-wrap-long-lines: Wrap lines longer than the width of
  the current window whilst maintaining any citation prefix.
- notmuch-wash-tidy-citations: Tidy up citations by:
  - compress repeated otherwise blank citation lines,
  - remove otherwise blank citation lines at the head and tail of a
    citation and remove blank lines between attribution statements and
    the citation,
- notmuch-wash-compress-blanks: Compress repeated blank lines and
  remove leading and trailing blank lines.

Enable `notmuch-wash-tidy-citations' and
`notmuch-wash-compress-blanks' by default by adding them to
`notmuch-show-insert-text/plain-hook'. `notmuch-wash-wrap-long-lines'
is not enabled by default.

If `notmuch-wash-wrap-long-lines' is enabled, word wrapping of the
buffer leads to an unappealing display of text, so provide a function
to disable it and add it to the list of `notmuch-show-mode' hook
functions.
2010-04-24 07:52:37 -07:00
David Edmondson
bae184f5fc emacs: Add notmuch-address.el for address completion using notmuch
A tool `notmuch-addresses' is required to produce addresses which
match a query string. An example of a suitable script can be found in
the git repository at
    http://jkr.acm.jhu.edu/git/notmuch_addresses.git
There are no doubt others.
2010-04-23 17:31:46 -07:00
David Edmondson
57926bc7b0 emacs: Re-arrange message sending code
Define a new `mail-user-agent' (`notmuch-user-agent') and use it by
default. Re-arrange various routines that send mail to use this
(compose, reply, forward). Insert a `User-Agent:' header by default.
2010-04-23 13:18:13 -07:00
David Edmondson
e9394932f7 emacs: Add notmuch-hello.el, a friendly frontend to notmuch
This is based on the prototype that Carl Worth described in the TODO
file. It provides a search bar as well as support for recent searches,
saved searches, and a list of all tags in the database (as well as the
number of messages with each tag).
2010-04-23 12:50:18 -07:00
David Edmondson
3b3da097d8 emacs: Move body markup to a separate file
Move the citation and signature markup for text/plain parts to a new
file (notmuch-wash.el) and call it using a hook mechanism rather than
directly.
2010-04-21 12:55:46 -07:00
Carl Worth
dfbec15b23 Install emacs lisp files into a notmuch sub-directory of site-lisp.
Now that we have multiple emacs-lisp source files, it's just more
polite this way.
2010-04-06 18:30:43 -07:00
Carl Worth
a5ed8c68f6 Makefile: Eliminate the "make install-emacs" target.
Instead, simply byte-compile the emacs source files as part of "make"
and install them as part of "make install". The byte compilation is
made conditional on the configure script finding the emacs binary.
That way, "make; make install" will still work for someone that doesn't
have emacs installed, (which was the only reason we had made a separate
"make install-emacs" target in the first place).
2010-04-06 14:36:31 -07:00
Carl Worth
f89b3d16db Makefiles: Eliminate the useless quiet_* functions.
With the original quiet function, there's an actual purpose (hiding
excessively long compiler command lines so that warnings and errors
from the compiler can be seen).

But with things like quiet_symlink there's nothing quieter. In fact
"SYMLINK" is longer than "ln -sf". So all this is doing is hiding the
actual command from the user for no real benefit.

The only actual reason we implemented the quiet_* functions was to be
able to neatly right-align the command name and left-align the arguments.

Let's give up on that, and just left-align everything, simplifying the
Makefiles considerably. Now, the only instances of a captialized command
name in the output is if there's some actually shortening of the command
itself.
2010-04-06 14:36:31 -07:00
Carl Worth
4235ef5109 Makfiles: Make the top-level targets PHONY
Just to avoid any clash with files of the same names.
2010-04-05 12:59:06 -07:00
David Bremner
c2f3710a78 notmuch-query.el: new file to support access to the notmuch database.
Initially this file provides one main function
notmuch-query-get-threads, which takes a set of search terms, and
returns a parsed set of matching threads as a lisp data structure.

A set of notmuch-query-map-* functions are provided to help map
functions over the data structure.

The function notmuch-query-get-message-ids uses this machinery to get
the set of message-ids matching a query.

Edited-by: Carl Worth <cworth@cworth.org>: Change comment syntax,
(";;" rather than ";" to make emacs-lisp mode happy), and eliminate
some excess whitespace, as suggested by David Edmonson.
2010-04-05 11:08:45 -07:00
David Edmondson
e8414a72d4 emacs: Move notmuch-show functionality to notmuch-show.el
To ease the transition to a JSON based implementation of
`notmuch-show', move the current implementation into a separate file.

Create `notmuch-lib.el' to hold common variables.
2010-04-05 09:25:56 -07:00
David Edmondson
d3884a5984 Makefile.local: Automatically use makefile mode
We add a magic line to the beginning of each Makefile.local file to
help the editor know that it should use makefile mode for editing the
file, (even though the filename isn't exactly "Makefile").

Edited-by: Carl Worth <cworth@cworth.org>: Expand treatment from
emacs/Makefile.local to each instance of Makefile.local.
2010-04-03 12:31:49 -07:00
Carl Worth
33d5cc415e Makefiles: Make the install rules quiet like the compilation rules.
The output from make is looking better all the time, (though the
columns still aren't lined up).
2010-03-31 23:54:21 -07:00