aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-01-13emacs: deal with unused lexical arguments and variablesJonas Bernoulli
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-13emacs: use lexical-bindings in all librariesJonas Bernoulli
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-13emacs: make headings outline-minor-mode compatibleJonas Bernoulli
`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-13emacs: avoid killing process buffer when process is still aliveJonas Bernoulli
In practice this probably does not make a difference or we would have heard about it many times, but better be safe than sorry. Process sentinels are called not only when the process has finished but also on other state changes.
2021-01-13emacs: avoid passing around some redundant informationJonas Bernoulli
When running "notmuch" we use its full path but when displaying the command to the user we show just its name for readability reasons. Avoid passing around both representations because it is very easy to get the name from the path. Notmuch itself uses the involved functions just for "notmuch" but there might be extensions that use them for other executable so we forgo other potential simplifications.
2021-01-13emacs: notmuch-start-notmuch: avoid storing process buffer twiceJonas Bernoulli
The buffer of the error process is accessible using `process-buffer'. We still have to store the error-buffer in the non-error process because for that process `process-buffer' obviously returns its own buffer.
2021-01-13emacs: notmuch-start-notmuch-sentinel: assert buffer is aliveJonas Bernoulli
2021-01-13emacs: notmuch-start-notmuch-error-sentinel: assert buffer is aliveJonas Bernoulli
2021-01-13emacs: notmuch-start-notmuch: remove backward compatibility codeJonas Bernoulli
We no longer support Emacs releases before version 25.1. Also adjust the sentinels which only had to deal with an error file when using an older Emacs release was used.
2021-01-13emacs: define new notmuch-search-item widget typeJonas Bernoulli
This is complex enough to warrant a dedicated widget type, which will make future improvements less messy to implement.
2021-01-13emacs: sanitize dedicated widget action/notify functionsJonas Bernoulli
These functions are used as action/notify functions. That dictates the appropriate function signatures but even though these functions are not used for anything else they use incompatible signatures, forcing the callers to use lambda expressions to deal with these incompatibilities. Fix that by adjusting the function signatures to the needs of the only intended callers. Two of these functions were defined as commands but because the interactive form did not return the mandatory arguments, we know that nobody (successfully) used these as commands. In one case we move the location of a y-or-n-p prompt.
2021-01-13emacs: use setq instead of setJonas Bernoulli
Commonly `set' is only used if there is no way around it; i.e. when the variable cannot be known until runtime.
2021-01-09nmbug: notmuch-report: set both background and foreground colorsTomi Ollila
Whenever setting background color, set also corresponding foreground color. Don't expect default foreground color to be #000 (or something close); user may have changed it.
2021-01-09docs: drop deprecated doxygen TCL_SUBST flagDaniel Kahn Gillmor
notmuch has no tcl code, and doxygen upstream is deprecating/removing tcl support anyway: https://github.com/doxygen/doxygen/commit/48a7afc0caf69857a42b0fe1963db3440cb4000f
2020-12-26Merge branch 'release'David Bremner
2020-12-26debian: skip gdb based tests on hppadebian/0.31.3-2archive/debian/0.31.3-2David Bremner
2020-12-25Revert "emacs: notmuch-search: avoid wiping out buffer-local variables"Jonas Bernoulli
This reverts commit f9fbd1ee3bfd679175d88af403752d87a730349f. Emacs provides a mechanism for avoiding wiping out buffer-local variables: marking them as "permanent local", which essentially means "don't wip out the local value when enabling major-mode". (put 'the-variable 'permanent-local t) See (info "(elisp)Creating Buffer-Local"). Whether refreshing the buffer contents should involve re-enable the mode is a different question, which should not be decided based on the fact that we want keep the value of some random variable, not least because some other (e.g. cache) variables are likely expected to be wiped.
2020-12-25Merge branch 'release'David Bremner
2020-12-25Commit Debian 3.0 (quilt) metadatadebian/0.31.3-1archive/debian/0.31.3-1David Bremner
[dgit (9.12) quilt-fixup]
2020-12-25debian: drop debian/patchesDavid Bremner
These were originally committed by git-debrebase. Unfortunately git debrebase does not seem to like the notmuch git workflow, so giving up on it for now.
2020-12-25debian: don't tag debian tag at release is made.0.31.3David Bremner
This reflects a change in the debian workflow to use dgit, which does the tagging for us. It also leaves room for debian specific fixups.
2020-12-25NEWS: add news for 0.31.3David Bremner
2020-12-25debian: changelog for 0.31.3-1David Bremner
2020-12-25version: bump 0.31.3David Bremner
2020-12-25test/T360-symbol-hiding.sh: trim extra output from readelfDavid Bremner
readelf on (at least) ppc64le sometimes generates some extension to the Ndx name inside '[]'. Remove this output to allow our simple column based parsing to work.
2020-12-25python/notmuch2: fix exclude tag handlingJohannes Larsen
A typo in Database._create_query lost the exclude_tag names during the string to utf-8 conversion. Amended by DB: fixed patch format and updated commit message.
2020-12-23lib/config: delay setting talloc destructorDavid Bremner
If Xapian has thrown an exception, it is not safe to invoke the destructor when freeing the list struct. (cherry picked from commit 43ba5ed7eca6e9f6433b8c2c2a9d834d4101b92a)
2020-12-23lib: factor out notmuch_database_open* related code to own fileDavid Bremner
Reduce the size of database.cc, and prepare for extending the database opening API
2020-12-23test: add regression test for searching with alternate configDavid Bremner
Make sure upcoming changes to config handling do not break command line specification.
2020-12-23lib/config: delay setting talloc destructorDavid Bremner
If Xapian has thrown an exception, it is not safe to invoke the destructor when freeing the list struct.
2020-12-23lib: factor out prefix related code to its own fileDavid Bremner
Reduce the size of database.cc, and limit the scope of prefix_table, make sure it's accessed via a well-defined internal API.
2020-12-23lib: factor out feature name related code.David Bremner
database.cc is uncomfortably large, and some of the static data structures do not need to be shared as much as they are. This is a somewhat small piece to factor out, but it will turn out to be helpful to further refactoring.
2020-12-20test: use keys with group 'test' in T590-libconfigDavid Bremner
In a future commit we want to interoperate better with glib KeyFiles, which need groups for all keys.
2020-12-13Merge tag 'debian/0.31.2-5'David Bremner
notmuch release 0.31.2-5 for unstable (sid) [dgit] [dgit distro=debian no-split --quilt=linear]
2020-12-13Commit Debian 3.0 (quilt) metadatadebian/0.31.2-5archive/debian/0.31.2-5David Bremner
[dgit (9.12) quilt-fixup]
2020-12-13debian: changelog for 0.31.2-5David Bremner
2020-12-13test/T360-symbol-hiding: use readelf in place of nmDavid Bremner
It turns out that using nm -P isn't as portable as hoped. In particular with some ELF ABIs (e.g. ppc64 ELFv1), the desired symbols end up in the data section instead of text. The test is currently only functional on ELF based architectures, so I think it's legit to depend on readelf instead of nm. The switch to readelf has the advantage that we can explicitely ask for all of the symbols with global visibility, rather than grepping for notmuch. That seems a more robust approach since it will catch any strangely named global symbols.
2020-12-11Merge branch 'release'David Bremner
2020-12-10Commit Debian 3.0 (quilt) metadatadebian/0.31.2-4archive/debian/0.31.2-4David Bremner
[dgit (9.12) quilt-fixup]
2020-12-10debian: changelog for 0.31.2-4David Bremner
2020-12-09build/docs: move docstring prereq to file targetsDavid Bremner
Under a sufficiently high level of parallelism [1] there seems to be a a race condition that allows sphinx-build to start running before the docstrings are extracted. This change moves the docstring stamp from the phony targets sphinx-html and sphinx-info to the file targets that they depend on. I'm not sure why this makes things better, but I am fairly confident it does not make things worse, and experimentally it seems to eliminate the race condition. [1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=976934
2020-12-06emacs: avoid binding unnamed commands in keymapsJonas Bernoulli
One should never bind unnamed commands in keymaps because doing that makes it needlessly hard for users to change these bindings. Replace such anonymous bindings with named commands that are generated using macros and some boilerplate. Using macros is better than using a simple loop because that makes it possible for `find-function' to find the definitions. Eat your boilerplate--it forms character. Admittedly this approach is quite ugly and it might be better to teach the original commands to support different buffers directly instead of requiring wrapper commands to do just that. Never-the-less as a short-term solution this is better than what we had before.
2020-12-06emacs: do not quote self-quoting tJonas Bernoulli
2020-12-06emacs: use setq-localJonas Bernoulli
It is available since Emacs 24.3 and we require at least Emacs 25. It makes the variable buffer-local if it isn't always buffer-local anyway.
2020-12-06emacs: use defvar-localJonas Bernoulli
It is available since Emacs 24.3 and we require at least Emacs 25.
2020-12-06emacs: inline notmuch-split-content-typeJonas Bernoulli
This trivial helper function actually made things slightly *less* readable by adding an unnecessary indirection.
2020-12-06emacs: inline notmuch-documentation-first-lineJonas Bernoulli
Inline a simplified version of `notmuch-documentation-first-line' into its only caller. The new code snippet differs from the removed function in that it returns nil instead of the empty string for symbols that have no function documentation. That value is ultimately used as an argument to `concat', which treats nil like the empty string. So we can do the logical thing without changing the behavior.
2020-12-06emacs: remove unnecessary notmuch-tree-button-activateJonas Bernoulli
Since [1: f8bdba37] no key is bound to this command and it is redundant because the behavior of `push-command' is identical when called as a command. 1: f8bdba37d3f4c877e05e17b5b1c7d2d512106538 emacs: tree: remove binding for pressing button in message pane
2020-12-06emacs: remove unused notmuch-address-locate-commandJonas Bernoulli
We stopped using it in [1: 0e671478]. 1: 0e671478c6f37018973392f049979da5e1a8ff99 emacs: replace use of notmuch-address-message-insinuate
2020-12-06emacs: remove unnecessary notmuch-remove-if-notJonas Bernoulli
We could just have switched to using `cl-remove-if-not' instead, but the two uses of the *remove-if-not function are pretty strange to begin with so we refactor to not use any such function at all.