Commit graph

14 commits

Author SHA1 Message Date
David Bremner
fc1c81c378 emacs: update quoting in docstrings
The complicated looking escapes are needed to avoid compile time
warnings.  (info "(elisp) Text Quoting Style") for details.
2023-10-06 20:36:56 -03:00
David Bremner
5e5f2122f9 emacs: wrap call-process-region
As with notmuch--process-lines, initial purpose is to provide a safe
binding for default-directory. This is enough to make notmuch-hello
robust against non-existent or corrupt values default-directory, but
probably not other views.
2021-09-11 10:19:27 -03:00
Jonas Bernoulli
0067a43ea2 emacs: deal with unused lexical arguments and variables
The previous commit switched to lexical-binding but without dealing
with the new warnings about unused lexical arguments and variables.

This commit deals with most of them, in most cases by either removing
leftover bindings that are actually unnecessary, or by marking certain
arguments as "known to be unused" by prefixing their names with "_".

In the case of the functions named `notmuch-show-insert-...' the
amount of silencing that is required is a bit extreme and we might
want to investigate if there is a better way.

In the case of `notmuch-mua-mail', ignoring CONTINUE means that we do
not fully follow the intended behavior described in `compose-mail's
doc-string.
2021-01-13 07:16:23 -04:00
Jonas Bernoulli
fc4cda07a9 emacs: use lexical-bindings in all libraries
Doing so causes many new compile warnings.  Some of these warnings
concern genuine changes in behavior that have to be addressed right
away.

Many other warnings are due to unused variables.  Nothing has changed
here, except that the byte-compiler can now detect these pre-existing
and harmless issues.  We delay addressing these issues so that we can
focus on the important ones here.

A third group of warnings concern arguments that are not actually used
inside the function but which cannot be removed because the functions
signature is dictated by some outside convention.  Silencing these
warning is also delayed until subsequent commits.
2021-01-13 07:16:04 -04:00
Jonas Bernoulli
2ca941163d emacs: make headings outline-minor-mode compatible
`outline-minor-mode' treats comments that begin with three or more
semicolons as headings.  That makes it very convenient to navigate
code and to show/hide parts of a file.

Elips libraries typically have four top-level sections, e.g.:

;;; notmuch.el --- run notmuch within emacs...
;;; Commentary:...
;;; Code:...
;;; notmuch.el ends here

In this package many libraries lack a "Commentary:" section, which is
not optimal but okay for most libraries, except major entry points.

Depending on how one chooses to look at it, the "... ends here" line
is not really a heading that begins a section, because it should never
have a "section" body (after all it marks eof).

If the file is rather short, then I left "Code:" as the only section
that contains code.  Otherwise I split the file into multiple sibling
sections.  The "Code:" section continues to contain `require' and
`declare-function' forms and other such "front matter".

If and only if I have split the code into multiple sections anyway,
then I also added an additional section named just "_" before the
`provide' form and shortly before the "...end here" line.  This
section could also be called "Back matter", but I feel it would be
distracting to be that explicit about it.  (The IMO unnecessary but
unfortunately still obligatory "... ends here" line is already
distracting enough as far as I am concerned.)

Before this commit some libraries already uses section headings, some
of them consistently.  When a library already had some headings, then
this commit often sticks to that style, even at the cost inconsistent
styling across all libraries.

A very limited number of variable and function definitions have to be
moved around because they would otherwise end up in sections they do
not belong into.

Sections, including but not limited to their heading, can and should
be further improved in the future.
2021-01-13 07:10:27 -04:00
Jonas Bernoulli
df3fab18fe emacs: Increase consistency of library headers 2020-08-09 21:14:36 -03:00
David Bremner
617b36f3d1 emacs: use ".ps" suffix for PostScript temporary files.
Joerg Jaspert [1] reported problems with evince reading unsuffixed
temporary files in Debian.

[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=920856
2019-01-30 07:15:59 -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
Chunyang Xu
0cf457b73b emacs: Fix packaging
Refer to (info "(elisp) Library Headers") for package conventions.
2016-04-16 08:24:42 -03:00
Austin Clements
ff53fb468e emacs: Put notmuch-print-mechanism in custom group notmuch-show 2012-04-24 23:25:51 -03:00
David Edmondson
6bd3d8af54 emacs: Prefer '[No Subject]' to blank subjects. 2012-02-03 21:20:15 -04:00
David Edmondson
6f388fa711 emacs: Don't mark messages as "unsaved" when printing.
`ps-print-buffer' notes that a buffer is unsaved unless
`buffer-modified-p' returns `nil', so ensure that it does.
2012-01-27 08:01:59 -04:00
David Edmondson
76f5da775e emacs: Fix a notmuch-print.el compiler warning.
`notmuch-show-get-prop' should be declared.
2012-01-26 08:13:05 -04: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