aboutsummaryrefslogtreecommitdiff
path: root/emacs/notmuch-crypto.el
AgeCommit message (Collapse)Author
2021-09-11emacs: wrap call-processDavid Bremner
Provide safe working directory
2021-09-11emacs: wrap make-processDavid Bremner
Provide a safe working directory.
2021-07-06emacs: fix typo in variable nameDavid Bremner
This error crept in during my style rewrite of dkg's proposed change.
2021-06-26emacs: Prefer email address over User ID when showing valid signatureDaniel Kahn Gillmor
Most concrete verification steps are likely only taken on the e-mail address in the first place, and e-mail addresses render more intelligibly than arbitrary User IDs in the first place. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net> Amended-by: db, apply dme restructuring suggestions.
2021-01-13emacs: notmuch-crypto-status-button-type: fix potential bugJonas Bernoulli
The "help-echo" can potentially contain an unintended %-spec so we have to make sure it would not be treated as such.
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.
2020-12-06emacs: misc doc-string improvementsJonas Bernoulli
2020-12-06emacs: place complete first sentence on first doc-string lineJonas Bernoulli
2020-08-09Fix typosJonas Bernoulli
2020-08-09emacs: Increase consistency of library headersJonas Bernoulli
2020-08-09emacs: Use 'and' instead of 'when' when the return value mattersJonas Bernoulli
Also do so for some 'if' forms that lack an ELSE part. Even go as far as using 'and' and 'not' instead of 'unless'.
2020-08-09emacs: Only set one variable per setq formJonas Bernoulli
It's a bit weird to avoid having to write the "(setq ... )" more than once, just because we can. In a language that uses '=' for the same purpose we also happily use that once per assignment. While there are no benefit to using just one 'setq' there are some drawbacks. It is not always clear on first what is a key and what a value and as a result it is easy to make a mistake. Also it becomes harder to comment out just one assignment.
2020-08-09emacs: Remove excess empty linesJonas Bernoulli
Most people who write lots of lisp tend to only sparsely use empty "separator" lines within forms. In lisp they feel unnecessary and since most files stick to this convention we get a bit confused when there are extra empty lines. It feels like the s-expressions are falling into pieces. All of this is especially true between a function's doc-string and body because the doc-string is colored differently, which visually already separates it quite sufficiently from the code that follows.
2020-08-09emacs: Shorten long linesJonas Bernoulli
2020-04-16emacs: Declare function notmuch-show-get-message-idJonas Bernoulli
2020-03-22emacs: avoid warning about notmuch-show-get-message-idDaniel Kahn Gillmor
Without this change, we see the following warning when compiling the elisp: ``` EMACS emacs/notmuch-crypto.elc In end of data: emacs/notmuch-crypto.el:266:1:Warning: the function ‘notmuch-show-get-message-id’ is not known to be defined. ``` Thanks to Örjan Ekeberg and David Edmondson for their followup about this. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2020-01-08emacs: don't start processes stoppedSteven Allen
It causes this function to fail with: let: Wrong type argument: null, t Support for this was removed from Emacs in April 2019 (5c5e309527e6b582e2c04b83e7af45f3144863ac) because it never worked correctly (apparently). This also shouldn't be necessary as sentinels will not be called unless emacs is idle or waiting for input. Therefore, the `process-put' calls immediately following the `make-process' call should always complete before the sentinel is first called.
2019-12-14emacs: Improve the reporting of key activityDavid Edmondson
Improve the information provided about key retrieval and key validity.
2019-12-14emacs: Add notmuch-crypto-gpg-program and use itDavid Edmondson
Allow the user to specify the gpg program to use when retrieving keys, etc., defaulting to the value of `epg-gpg-program'.
2019-12-14emacs: Minor refactoring of crypto codeDavid Edmondson
2019-12-14emacs: Asynchronous retrieval of GPG keysDavid Edmondson
Rather than blocking emacs while gpg does its' thing, by default run key retrieval asynchronously, possibly updating the display of the message on successful completion.
2019-05-25emacs: Drop content-free "Unknown signature status" buttonDaniel Kahn Gillmor
When we have not been able to evaluate the signature status of a given MIME part, showing a content-free (and interaction-free) "[ Unknown signature status ]" button doesn't really help the user at all, and takes up valuable screen real-estate. A visual reminder that a given message is *not* signed isn't helpful unless it is always present, in which case we'd want to see "[ Unknown signature status ]" buttons on all messages, even ones that don't have a signing structure, but i don't think we want that. Amended by db to drop the unused initialization of 'label'
2019-02-10emacs: Invoke gpg with --batch and --no-ttyDaniel Kahn Gillmor
When invoking gpg as a backgrounded tool, it's important to let gpg know that it is backgrounded, to avoid spurious prompts or other breakage. In particular, https://bugs.debian.org/913614 was a regression in GnuPG which causes problems when importing keys without a terminal, but gpg expects one. Ensuring that notmuch-emacs always invokes gpg as a background process should avoid some of these unnecessary failure. Thanks to Justus Winter for finding this problem. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2017-07-15emacs: change default for notmuch-crypto-process-mime to tDavid Bremner
There are some cases like remote usage where this might cause problems, but those users can easily customize the variable. The inconvenience seems to be outweighed by the security benefit for most users.
2017-03-13emacs: use epg-gpg-programJohn Byrnes
Adjusted notmuch-crypto gpg call-process function to respect the GPG program set by the EasyPG epg-gpg-program variable. This is to correct a problem observed on NixOS where only gpg2 is installed by default. The Notmuch Emacs frontend fails when trying to access someone's key to verify their signature when it cannot find the GPG binary.
2016-11-02emacs: make faces readable on dark backgrounds.Matt Armstrong
The notmuch-tag-flagged, notmuch-search-flagged-face and notmuch-crypto-part-header faces defaulted to "blue", which is nearly unreadable when a dark background is in use. This is addressed by using "LightBlue1" for dark backgrounds. As a side effect, these faces are now no-op definitions for grayscale or mono displays.
2016-06-05Use https instead of http where possibleDaniel Kahn Gillmor
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-04-16emacs: Fix packagingChunyang Xu
Refer to (info "(elisp) Library Headers") for package conventions.
2016-03-24emacs: Improve crypto button labels.David Edmondson
Make the labels for both encryption and signature buttons share a common format, in which both report the status if it is not one of those known.
2013-02-18emacs: show: make buttons select windowMark Walters
Emacs has two button type objects: widgets (as used for saved searches in notmuch-hello) and buttons as used by parts/citations and id links in notmuch-show. These two behave subtly differently when clicked with the mouse: widgets select the window clicked before running the action, buttons do not. This patch makes all of these behave the same: clicking always selects the clicked window. It does this by defining a notmuch-button-type supertype that the other notmuch buttons can inherit from. This supertype binds the mouse-action to select the window and then activate the button.
2012-03-01Spelling fixTomi Ollila
Retreive is spelled as r e t r i e v e .
2012-03-01emacs: retain show buffer state after retrieving gpg keyTomi Ollila
After retrieving gpg key retain show buffer state like in all other operations (i.e. no other calls to notmuch-show-refresh-view provides optional reset-state argument). Emacs MUA keeps current message under cursor instead of going first open message(possibly marking it read).
2012-02-25emacs: Reverse the meaning of notmuch-show-refresh-view's argumentAustin Clements
Consensus seems to be that people prefer that refreshing show buffers retains state by default, rather than resetting it by default. This turns out to be the case in the code, as well. In fact, there's even a test for this that's been marked broken for several months, which this patch finally gets to mark as fixed.
2012-02-20emacs: Fix out-of-date declare-functionAustin Clements
The names of the arguments to notmuch-show-refresh-view had gotten out of sync between the declare-function and the real thing.
2012-02-12emacs: Ensure that gnupg output goes at the end of the buffer.David Edmondson
When showing the user some details of gnupg output, ensure that those details are shown at the end of the gnupg status buffer ("*notmuch-crypto-gpg-out*"), otherwise it can end up mixed up with earlier output.
2012-01-19emacs: logically group def{custom,face}sPieter Praet
To allow for expansion whilst keeping everything tidy and organized, move all defcustom/defface variables to the following subgroups, defined in notmuch-lib.el: - Hello - Search - Show - Send - Crypto - Hooks - External Commands - Appearance As an added benefit, defcustom keyword args are now consistently ordered as they appear @ defcustom's docstring (OCD much?). Proper defgroup docstrings and various other improvements by courtesy of Austin Clements.
2011-12-21Don't quote lambda formsAaron Ecay
This generates byte-compiler warnings on (at least) current trunk versions of Emacs. The quote is not necessary; lambda forms are self-quoting.
2011-12-15emacs: Add a face for crypto parts headersThomas Jost
Commit cb841878 introduced new parts handlers for crypto parts, but also hardcoded values for their headers face. This replaces these hardcoded values with a customizable face.
2011-11-12emacs: update notmuch-crypto-process-mime config variable documentation.Jameson Graef Rollins
This mentions the fact that prefix arguments are now used to enable to crypto switch.
2011-10-06emacs: Add callback functions to crypto sigstatus button.Jameson Graef Rollins
This adds two callback functions to the sigstatus button. If the sig status is "good", then clicking the button displays the output of "gpg --list-keys" on the key fingerprint. If the sigstatus is "bad", then clicking the button will retrieve the key from the keyserver, and redisplay the current buffer. Thanks to David Bremner <bremner@unb.ca> for help with this.
2011-06-01emacs: Define several faces for the crypto-status buttonThomas Jost
Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net> jrollins modified this patch to conform to recent changes in the crypto processing since this patch was originally sent in.
2011-05-27emacs: Give mutlipart/{signed, encrypted} their own part handler.Jameson Graef Rollins
This is the best way to make the displayed output for decrypted/verified messages clearer. The special sigstatus and encstatus buttons are now displayed under the part header button. The part header button is also tweaked to provide information to user about how to proces crypto.
2011-05-27emacs: Add support for PGP/MIME verification/decryptionJameson Graef Rollins
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.