diff options
author | Jonas Bernoulli <jonas@bernoul.li> | 2020-08-08 13:49:36 +0200 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2020-08-09 19:48:36 -0300 |
commit | a4617f29ce81e7ae3e0cb747fdb9070f88407a28 (patch) | |
tree | ba7c56547d6be71956a8244e13c0b2ddf59e4b9e /emacs | |
parent | e3fd546ad75411ed310202e52e1c88bbd9616651 (diff) |
emacs: Shorten long lines
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/coolj.el | 2 | ||||
-rw-r--r-- | emacs/notmuch-address.el | 38 | ||||
-rw-r--r-- | emacs/notmuch-company.el | 17 | ||||
-rw-r--r-- | emacs/notmuch-crypto.el | 16 | ||||
-rw-r--r-- | emacs/notmuch-draft.el | 12 | ||||
-rw-r--r-- | emacs/notmuch-hello.el | 43 | ||||
-rw-r--r-- | emacs/notmuch-jump.el | 7 | ||||
-rw-r--r-- | emacs/notmuch-lib.el | 62 | ||||
-rw-r--r-- | emacs/notmuch-maildir-fcc.el | 14 | ||||
-rw-r--r-- | emacs/notmuch-message.el | 3 | ||||
-rw-r--r-- | emacs/notmuch-mua.el | 78 | ||||
-rw-r--r-- | emacs/notmuch-show.el | 103 | ||||
-rw-r--r-- | emacs/notmuch-tag.el | 14 | ||||
-rw-r--r-- | emacs/notmuch-tree.el | 55 | ||||
-rw-r--r-- | emacs/notmuch-wash.el | 19 | ||||
-rw-r--r-- | emacs/notmuch.el | 27 | ||||
-rw-r--r-- | emacs/rstdoc.el | 3 |
17 files changed, 326 insertions, 187 deletions
diff --git a/emacs/coolj.el b/emacs/coolj.el index 350d537f..5d311170 100644 --- a/emacs/coolj.el +++ b/emacs/coolj.el @@ -1,6 +1,6 @@ ;;; coolj.el --- automatically wrap long lines -*- coding:utf-8 -*- -;; Copyright (C) 2000, 2001, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +;; Copyright (C) 2000, 2001, 2004-2009 Free Software Foundation, Inc. ;; Authors: Kai Grossjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> ;; Alex Schroeder <alex@gnu.org> diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el index 0d56fba7..2a9c411a 100644 --- a/emacs/notmuch-address.el +++ b/emacs/notmuch-address.el @@ -195,10 +195,11 @@ external commands." ((eq notmuch-address-command 'internal) (unless (notmuch-address--harvest-ready) ;; First, run quick synchronous harvest based on what the user - ;; entered so far + ;; entered so far. (notmuch-address-harvest original t)) (prog1 (notmuch-address-matching original) - ;; Then start the (potentially long-running) full asynchronous harvest if necessary + ;; Then start the (potentially long-running) full asynchronous + ;; harvest if necessary. (notmuch-address-harvest-trigger))) (t (process-lines notmuch-address-command original)))) @@ -241,7 +242,8 @@ external commands." (push chosen notmuch-address-history) (delete-region beg end) (insert chosen) - (run-hook-with-args 'notmuch-address-post-completion-functions chosen)) + (run-hook-with-args 'notmuch-address-post-completion-functions + chosen)) (message "No matches.") (ding)))) (t nil))) @@ -393,10 +395,11 @@ to be a saved address hash." ;; The file exists, check it is a file we saved (notmuch-address--get-address-hash)) (with-temp-file notmuch-address-save-filename - (let ((save-plist (list :version notmuch-address--save-hash-version - :completion-settings notmuch-address-internal-completion - :last-harvest notmuch-address-last-harvest - :completions notmuch-address-completions))) + (let ((save-plist + (list :version notmuch-address--save-hash-version + :completion-settings notmuch-address-internal-completion + :last-harvest notmuch-address-last-harvest + :completions notmuch-address-completions))) (print "notmuch-address-hash" (current-buffer)) (print save-plist (current-buffer)))) (message "\ @@ -408,16 +411,17 @@ appear to be an address savefile. Not overwriting." (let ((now (float-time))) (when (> (- now notmuch-address-last-harvest) 86400) (setq notmuch-address-last-harvest now) - (notmuch-address-harvest nil nil - (lambda (proc event) - ;; If harvest fails, we want to try - ;; again when the trigger is next - ;; called - (if (string= event "finished\n") - (progn - (notmuch-address--save-address-hash) - (setq notmuch-address-full-harvest-finished t)) - (setq notmuch-address-last-harvest 0))))))) + (notmuch-address-harvest + nil nil + (lambda (proc event) + ;; If harvest fails, we want to try + ;; again when the trigger is next + ;; called + (if (string= event "finished\n") + (progn + (notmuch-address--save-address-hash) + (setq notmuch-address-full-harvest-finished t)) + (setq notmuch-address-last-harvest 0))))))) ;; diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el index ac998f9b..c1f3594e 100644 --- a/emacs/notmuch-company.el +++ b/emacs/notmuch-company.el @@ -69,9 +69,11 @@ (cl-case command (interactive (company-begin-backend 'notmuch-company)) (prefix (and (derived-mode-p 'message-mode) - (looking-back (concat notmuch-address-completion-headers-regexp ".*") - (line-beginning-position)) - (setq notmuch-company-last-prefix (company-grab "[:,][ \t]*\\(.*\\)" 1 (point-at-bol))))) + (looking-back + (concat notmuch-address-completion-headers-regexp ".*") + (line-beginning-position)) + (setq notmuch-company-last-prefix + (company-grab "[:,][ \t]*\\(.*\\)" 1 (point-at-bol))))) (candidates (cond ((notmuch-address--harvest-ready) ;; Update harvested addressed from time to time @@ -80,17 +82,20 @@ (t (cons :async (lambda (callback) - ;; First run quick asynchronous harvest based on what the user entered so far + ;; First run quick asynchronous harvest + ;; based on what the user entered so far (notmuch-address-harvest arg nil (lambda (_proc _event) (funcall callback (notmuch-address-matching arg)) - ;; Then start the (potentially long-running) full asynchronous harvest if necessary + ;; Then start the (potentially long-running) + ;; full asynchronous harvest if necessary (notmuch-address-harvest-trigger)))))))) (match (if (string-match notmuch-company-last-prefix arg) (match-end 0) 0)) - (post-completion (run-hook-with-args 'notmuch-address-post-completion-functions arg)) + (post-completion + (run-hook-with-args 'notmuch-address-post-completion-functions arg)) (no-cache t)))) diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el index c201d0d7..2327ff1f 100644 --- a/emacs/notmuch-crypto.el +++ b/emacs/notmuch-crypto.el @@ -161,7 +161,8 @@ by user FROM." (goto-char (point-max)) (insert (format "-- Key %s in message %s:\n" fingerprint id)) - (call-process notmuch-crypto-gpg-program nil t t "--batch" "--no-tty" "--list-keys" fingerprint)) + (call-process notmuch-crypto-gpg-program nil t t + "--batch" "--no-tty" "--list-keys" fingerprint)) (recenter -1)))) (declare-function notmuch-show-refresh-view "notmuch-show" (&optional reset-state)) @@ -220,12 +221,13 @@ corresponding key when the status button is pressed." (with-current-buffer buffer (goto-char (point-max)) (insert (format "--- Retrieving key %s:\n" keyid))) - (let ((p (make-process :name "notmuch GPG key retrieval" - :connection-type 'pipe - :buffer buffer - :stderr buffer - :command (list notmuch-crypto-gpg-program "--recv-keys" keyid) - :sentinel #'notmuch-crypto--async-key-sentinel))) + (let ((p (make-process + :name "notmuch GPG key retrieval" + :connection-type 'pipe + :buffer buffer + :stderr buffer + :command (list notmuch-crypto-gpg-program "--recv-keys" keyid) + :sentinel #'notmuch-crypto--async-key-sentinel))) (process-put p :gpg-key-id keyid) (process-put p :notmuch-show-buffer (current-buffer)) (process-put p :notmuch-show-point (point)) diff --git a/emacs/notmuch-draft.el b/emacs/notmuch-draft.el index 27abc7d9..c3cb619f 100644 --- a/emacs/notmuch-draft.el +++ b/emacs/notmuch-draft.el @@ -154,12 +154,14 @@ Used when a new version is saved, or the message is sent." `notmuch-draft-save-plaintext' controls the behaviour." (cl-case notmuch-draft-save-plaintext ((ask) - (unless (yes-or-no-p "(Customize `notmuch-draft-save-plaintext' to avoid this warning) + (unless (yes-or-no-p + "(Customize `notmuch-draft-save-plaintext' to avoid this warning) This message contains mml tags that suggest it is intended to be encrypted. Really save and index an unencrypted copy? ") (error "Save aborted"))) ((nil) - (error "Refusing to save draft with encryption tags (see `notmuch-draft-save-plaintext')")) + (error "Refusing to save draft with encryption tags (see `%s')" + 'notmuch-draft-save-plaintext)) ((t) (ignore)))) @@ -192,14 +194,16 @@ applied to newly inserted messages)." (message-remove-header "Message-ID") (message-add-header (concat "Message-ID: <" id ">"))) (t - (message "You have customized emacs so Message-ID is not a deletable header, so not changing it") + (message "You have customized emacs so Message-ID is not a %s" + "deletable header, so not changing it") (setq id nil))) (cond ((member 'Date message-deletable-headers) (message-remove-header "Date") (message-add-header (concat "Date: " (message-make-date)))) (t - (message "You have customized emacs so Date is not a deletable header, so not changing it"))) + (message "You have customized emacs so Date is not a deletable %s" + "header, so not changing it"))) (message-add-header "X-Notmuch-Emacs-Draft: True") (notmuch-draft-quote-some-mml) (notmuch-maildir-setup-message-for-saving) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 0ff5aaff..11c625ea 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -29,7 +29,8 @@ (require 'notmuch-lib) (require 'notmuch-mua) -(declare-function notmuch-search "notmuch" (&optional query oldest-first target-thread target-line continuation)) +(declare-function notmuch-search "notmuch" + (&optional query oldest-first target-thread target-line continuation)) (declare-function notmuch-poll "notmuch" ()) (declare-function notmuch-tree "notmuch-tree" (&optional query query-context target buffer-name open-target unthreaded)) @@ -91,18 +92,28 @@ searches so they still work in customize." :tag "Saved Search" :args '((list :inline t :format "%v" - (group :format "%v" :inline t (const :format " Name: " :name) (string :format "%v")) - (group :format "%v" :inline t (const :format " Query: " :query) (string :format "%v"))) + (group :format "%v" :inline t + (const :format " Name: " :name) + (string :format "%v")) + (group :format "%v" :inline t + (const :format " Query: " :query) + (string :format "%v"))) (checklist :inline t :format "%v" - (group :format "%v" :inline t (const :format "Shortcut key: " :key) (key-sequence :format "%v")) - (group :format "%v" :inline t (const :format "Count-Query: " :count-query) (string :format "%v")) - (group :format "%v" :inline t (const :format "" :sort-order) + (group :format "%v" :inline t + (const :format "Shortcut key: " :key) + (key-sequence :format "%v")) + (group :format "%v" :inline t + (const :format "Count-Query: " :count-query) + (string :format "%v")) + (group :format "%v" :inline t + (const :format "" :sort-order) (choice :tag " Sort Order" (const :tag "Default" nil) (const :tag "Oldest-first" oldest-first) (const :tag "Newest-first" newest-first))) - (group :format "%v" :inline t (const :format "" :search-type) + (group :format "%v" :inline t + (const :format "" :search-type) (choice :tag " Search Type" (const :tag "Search mode" nil) (const :tag "Tree mode" tree) @@ -474,7 +485,8 @@ should be. Returns a cons cell `(tags-per-line width)'." ((floatp notmuch-column-control) (let* ((available-width (- (window-width) notmuch-hello-indent)) - (proposed-width (max (* available-width notmuch-column-control) widest))) + (proposed-width (max (* available-width notmuch-column-control) + widest))) (floor available-width proposed-width))) (t @@ -536,8 +548,9 @@ options will be handled as specified for (unless (= (call-process-region (point-min) (point-max) notmuch-command t t nil "count" "--batch") 0) - (notmuch-logged-error "notmuch count --batch failed" - "Please check that the notmuch CLI is new enough to support `count + (notmuch-logged-error + "notmuch count --batch failed" + "Please check that the notmuch CLI is new enough to support `count --batch'. In general we recommend running matching versions of the CLI and emacs interface.")) @@ -553,7 +566,8 @@ the CLI and emacs interface.")) search-query (plist-get options :filter))) (message-count (prog1 (read (current-buffer)) (forward-line 1)))) - (when (and filtered-query (or (plist-get options :show-empty-searches) (> message-count 0))) + (when (and filtered-query (or (plist-get options :show-empty-searches) + (> message-count 0))) (setq elem-plist (plist-put elem-plist :query filtered-query)) (plist-put elem-plist :count message-count)))) query-list)))) @@ -740,7 +754,9 @@ Complete list of currently available key bindings: ;; dark background. (setq image (cons 'image (append (cdr image) - (list :background (face-background 'notmuch-hello-logo-background))))) + (list :background + (face-background + 'notmuch-hello-logo-background))))) (insert-image image)) (widget-insert " ")) @@ -760,7 +776,8 @@ Complete list of currently available key bindings: (notmuch-hello-update)) :help-echo "Refresh" (notmuch-hello-nice-number - (string-to-number (car (process-lines notmuch-command "count"))))) + (string-to-number + (car (process-lines notmuch-command "count"))))) (widget-insert " messages.\n"))) diff --git a/emacs/notmuch-jump.el b/emacs/notmuch-jump.el index 84fe2b9c..6d8cd97f 100644 --- a/emacs/notmuch-jump.el +++ b/emacs/notmuch-jump.el @@ -70,7 +70,8 @@ fast way to jump to a saved search from anywhere in Notmuch." (if action-map (notmuch-jump action-map "Search: ") - (error "To use notmuch-jump, please customize shortcut keys in notmuch-saved-searches.")))) + (error "To use notmuch-jump, \ +please customize shortcut keys in notmuch-saved-searches.")))) (defvar notmuch-jump--action nil) @@ -200,7 +201,9 @@ buffer." (define-key map keystr `(lambda () (interactive) (setq notmuch-jump--action - ',(apply-partially #'notmuch-jump action-submap new-prompt)) + ',(apply-partially #'notmuch-jump + action-submap + new-prompt)) (exit-minibuffer))))))) map)) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 0bb08eb2..9339f9d0 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -316,8 +316,10 @@ It does not prepend if ACTUAL-KEY is already listed in TAIL." tail))) ;; Documentation for command (push (cons key-string - (or (and (symbolp binding) (get binding 'notmuch-doc)) - (and (functionp binding) (notmuch-documentation-first-line binding)))) + (or (and (symbolp binding) + (get binding 'notmuch-doc)) + (and (functionp binding) + (notmuch-documentation-first-line binding)))) tail))) tail) @@ -327,13 +329,13 @@ It does not prepend if ACTUAL-KEY is already listed in TAIL." ;; binding whose "key" is 'remap, and whose "binding" is itself a ;; keymap that maps not from keys to commands, but from old (remapped) ;; functions to the commands to use in their stead. - (map-keymap - (lambda (command binding) - (mapc - (lambda (actual-key) - (setq tail (notmuch-describe-key actual-key binding prefix ua-keys tail))) - (where-is-internal command base-keymap))) - remap-keymap) + (map-keymap (lambda (command binding) + (mapc (lambda (actual-key) + (setq tail + (notmuch-describe-key actual-key binding + prefix ua-keys tail))) + (where-is-internal command base-keymap))) + remap-keymap) tail) (defun notmuch-describe-keymap (keymap ua-keys base-keymap &optional prefix tail) @@ -356,9 +358,13 @@ prefix argument. PREFIX and TAIL are used internally." (notmuch-describe-remaps binding ua-keys base-keymap prefix tail) (notmuch-describe-keymap - binding ua-keys base-keymap (notmuch-prefix-key-description key) tail)))) + binding ua-keys base-keymap + (notmuch-prefix-key-description key) + tail)))) (binding - (setq tail (notmuch-describe-key (vector key) binding prefix ua-keys tail))))) + (setq tail + (notmuch-describe-key (vector key) + binding prefix ua-keys tail))))) keymap) tail) @@ -368,11 +374,15 @@ prefix argument. PREFIX and TAIL are used internally." (while (string-match "\\\\{\\([^}[:space:]]*\\)}" doc beg) (let ((desc (save-match-data - (let* ((keymap-name (substring doc (match-beginning 1) (match-end 1))) + (let* ((keymap-name (substring doc + (match-beginning 1) + (match-end 1))) (keymap (symbol-value (intern keymap-name))) (ua-keys (where-is-internal 'universal-argument keymap t)) (desc-alist (notmuch-describe-keymap keymap ua-keys keymap)) - (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist))) + (desc-list (mapcar (lambda (arg) + (concat (car arg) "\t" (cdr arg))) + desc-alist))) (mapconcat #'identity desc-list "\n"))))) (setq doc (replace-match desc 1 1 doc))) (setq beg (match-end 0))) @@ -391,7 +401,8 @@ its prefixed behavior by setting the 'notmuch-prefix-doc property of its command symbol." (interactive) (let* ((mode major-mode) - (doc (substitute-command-keys (notmuch-substitute-command-keys (documentation mode t))))) + (doc (substitute-command-keys + (notmuch-substitute-command-keys (documentation mode t))))) (with-current-buffer (generate-new-buffer "*notmuch-help*") (insert doc) (goto-char (point-min)) @@ -411,8 +422,10 @@ of its command symbol." (let* ((subkeymap (key-binding prefix)) (ua-keys (where-is-internal 'universal-argument nil t)) (prefix-string (notmuch-prefix-key-description prefix)) - (desc-alist (notmuch-describe-keymap subkeymap ua-keys subkeymap prefix-string)) - (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) desc-alist)) + (desc-alist (notmuch-describe-keymap + subkeymap ua-keys subkeymap prefix-string)) + (desc-list (mapcar (lambda (arg) (concat (car arg) "\t" (cdr arg))) + desc-alist)) (desc (mapconcat #'identity desc-list "\n"))) (with-help-window (help-buffer) (with-current-buffer standard-output @@ -547,7 +560,8 @@ This replaces spaces, percents, and double quotes in STR with '( ;; Avoid HTML parts. "text/html" - ;; multipart/related usually contain a text/html part and some associated graphics. + ;; multipart/related usually contain a text/html part and some + ;; associated graphics. "multipart/related" )) @@ -602,8 +616,9 @@ the given type." ,(notmuch-id-to-query (plist-get msg :id)))) (coding-system-for-read (if binaryp 'no-conversion - (let ((coding-system (mm-charset-to-coding-system - (plist-get part :content-charset)))) + (let ((coding-system + (mm-charset-to-coding-system + (plist-get part :content-charset)))) ;; Sadly, ;; `mm-charset-to-coding-system' seems ;; to return things that are not @@ -615,7 +630,8 @@ the given type." ;; charset is US-ASCII. RFC6657 ;; complicates this somewhat. 'us-ascii))))) - (apply #'call-process notmuch-command nil '(t nil) nil args) + (apply #'call-process + notmuch-command nil '(t nil) nil args) (buffer-string)))))) (when (and cache data) (plist-put part plist-elem data)) @@ -670,7 +686,8 @@ current buffer, if possible." (let* ((have-content (plist-member part :content)) (charset (if have-content 'gnus-decoded (plist-get part :content-charset))) - (handle (mm-make-handle (current-buffer) `(,content-type (charset . ,charset))))) + (handle (mm-make-handle (current-buffer) + `(,content-type (charset . ,charset))))) ;; If the user wants the part inlined, insert the content and ;; test whether we are able to inline it (which includes both ;; capability and suitability tests). @@ -786,7 +803,8 @@ provided, it is taken from `process-command'." ((exit) (process-exit-status proc)) ((signal) msg)))) (when exit-status - (notmuch-check-exit-status exit-status (or command (process-command proc)) + (notmuch-check-exit-status exit-status + (or command (process-command proc)) nil err)))) (defun notmuch-check-exit-status (exit-status command &optional output err) diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el index e95de63b..4b10a731 100644 --- a/emacs/notmuch-maildir-fcc.el +++ b/emacs/notmuch-maildir-fcc.el @@ -135,8 +135,9 @@ by notmuch-mua-mail." ;; really want this header inserted. (when (or (not (= (elt subdir 0) ?/)) - (y-or-n-p (format "Fcc header %s is an absolute path and notmuch insert is requested.\nInsert header anyway? " - subdir))) + (y-or-n-p + (format "Fcc header %s is an absolute path and notmuch insert is requested. +Insert header anyway? " subdir))) (message-add-header (concat "Fcc: " subdir)))) (defun notmuch-maildir-add-file-style-fcc-header (subdir) @@ -249,9 +250,8 @@ If CREATE is non-nil then create the folder if necessary." ;; typo, or just the user want a new folder, let the user decide ;; how to deal with it. (error - (let ((response (notmuch-read-char-choice - "Insert failed: (r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " - '(?r ?c ?i ?e)))) + (let ((response (notmuch-read-char-choice "Insert failed: \ +\(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " '(?r ?c ?i ?e)))) (cl-case response (?r (notmuch-maildir-fcc-with-notmuch-insert fcc-header)) (?c (notmuch-maildir-fcc-with-notmuch-insert fcc-header 't)) @@ -333,8 +333,8 @@ if needed." (notmuch-maildir-fcc-write-buffer-to-maildir fcc-header 't) ;; The fcc-header is not a valid maildir see if the user wants to ;; fix it in some way. - (let* ((prompt (format "Fcc %s is not a maildir: (r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " - fcc-header)) + (let* ((prompt (format "Fcc %s is not a maildir: \ +\(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " fcc-header)) (response (notmuch-read-char-choice prompt '(?r ?c ?i ?e)))) (cl-case response (?r (notmuch-maildir-fcc-file-fcc fcc-header)) diff --git a/emacs/notmuch-message.el b/emacs/notmuch-message.el index 0164472f..c2242070 100644 --- a/emacs/notmuch-message.el +++ b/emacs/notmuch-message.el @@ -60,7 +60,8 @@ the first is a notmuch query and the rest are the tag changes to be applied to the matching messages.") (defun notmuch-message-apply-queued-tag-changes () - ;; Apply the tag changes queued in the buffer-local variable notmuch-message-queued-tag-changes. + ;; Apply the tag changes queued in the buffer-local variable + ;; notmuch-message-queued-tag-changes. (dolist (query-and-tags notmuch-message-queued-tag-changes) (notmuch-tag (car query-and-tags) (cdr query-and-tags)))) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 1efc88ea..74dfb384 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -205,10 +205,12 @@ Typically this is added to `notmuch-mua-send-hook'." (defun notmuch-mua-reply-crypto (parts) "Add mml sign-encrypt flag if any part of original message is encrypted." (cl-loop for part in parts - if (notmuch-match-content-type (plist-get part :content-type) "multipart/encrypted") - do (mml-secure-message-sign-encrypt) - else if (notmuch-match-content-type (plist-get part :content-type) "multipart/*") - do (notmuch-mua-reply-crypto (plist-get part :content)))) + if (notmuch-match-content-type (plist-get part :content-type) + "multipart/encrypted") + do (mml-secure-message-sign-encrypt) + else if (notmuch-match-content-type (plist-get part :content-type) + "multipart/*") + do (notmuch-mua-reply-crypto (plist-get part :content)))) ;; There is a bug in emacs 23's message.el that results in a newline ;; not being inserted after the References header, so the next header @@ -250,8 +252,9 @@ Typically this is added to `notmuch-mua-send-hook'." ;; the original message. ((same-window-regexps '("\\*mail .*"))) - ;; We modify message-header-format-alist to get around a bug in message.el. - ;; See the comment above on notmuch-mua-insert-references. + ;; We modify message-header-format-alist to get around + ;; a bug in message.el. See the comment above on + ;; notmuch-mua-insert-references. (let ((message-header-format-alist (cl-loop for pair in message-header-format-alist if (eq (car pair) 'References) @@ -266,7 +269,8 @@ Typically this is added to `notmuch-mua-send-hook'." (notmuch-headers-plist-to-alist reply-headers) nil (notmuch-mua-get-switch-function)))) - ;; Create a buffer-local queue for tag changes triggered when sending the reply + ;; Create a buffer-local queue for tag changes triggered when + ;; sending the reply. (when notmuch-message-replied-tags (setq-local notmuch-message-queued-tag-changes (list (cons query-string notmuch-message-replied-tags)))) @@ -293,27 +297,29 @@ Typically this is added to `notmuch-mua-send-hook'." (insert "From: " from "\n") (insert "Date: " date "\n\n") - (insert (with-temp-buffer - (let - ;; Don't attempt to clean up messages, excerpt - ;; citations, etc. in the original message before - ;; quoting. - ((notmuch-show-insert-text/plain-hook nil) - ;; Don't omit long parts. - (notmuch-show-max-text-part-size 0) - ;; Insert headers for parts as appropriate for replying. - (notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function) - ;; Ensure that any encrypted parts are - ;; decrypted during the generation of the reply - ;; text. - (notmuch-show-process-crypto process-crypto) - ;; Don't indent multipart sub-parts. - (notmuch-show-indent-multipart nil)) - ;; We don't want sigstatus buttons (an information leak and usually wrong anyway). - (cl-letf (((symbol-function 'notmuch-crypto-insert-sigstatus-button) #'ignore) - ((symbol-function 'notmuch-crypto-insert-encstatus-button) #'ignore)) - (notmuch-show-insert-body original (plist-get original :body) 0) - (buffer-substring-no-properties (point-min) (point-max)))))) + (insert + (with-temp-buffer + (let + ;; Don't attempt to clean up messages, excerpt + ;; citations, etc. in the original message before + ;; quoting. + ((notmuch-show-insert-text/plain-hook nil) + ;; Don't omit long parts. + (notmuch-show-max-text-part-size 0) + ;; Insert headers for parts as appropriate for replying. + (notmuch-show-insert-header-p-function + notmuch-mua-reply-insert-header-p-function) + ;; Ensure that any encrypted parts are + ;; decrypted during the generation of the reply + ;; text. + (notmuch-show-process-crypto process-crypto) + ;; Don't indent multipart sub-parts. + (notmuch-show-indent-multipart nil)) + ;; We don't want sigstatus buttons (an information leak and usually wrong anyway). + (cl-letf (((symbol-function 'notmuch-crypto-insert-sigstatus-button) #'ignore) + ((symbol-function 'notmuch-crypto-insert-encstatus-button) #'ignore)) + (notmuch-show-insert-body original (plist-get original :body) 0) + (buffer-substring-no-properties (point-min) (point-max)))))) (set-mark (point)) (goto-char start) @@ -383,10 +389,13 @@ modified. This function is notmuch addaptation of (unless (assq 'From other-headers) (push (cons 'From (message-make-from - (notmuch-user-name) (notmuch-user-primary-email))) other-headers)) + (notmuch-user-name) + (notmuch-user-primary-email))) + other-headers)) (notmuch-mua-pop-to-buffer (message-buffer-name "mail" to) - (or switch-function (notmuch-mua-get-switch-function))) + (or switch-function + (notmuch-mua-get-switch-function))) (let ((headers (append ;; The following is copied from `message-mail' @@ -499,7 +508,8 @@ the From: address." (with-current-buffer temp-buffer (erase-buffer) (let ((coding-system-for-read 'no-conversion)) - (call-process notmuch-command nil t nil "show" "--format=raw" id)) + (call-process notmuch-command nil t nil + "show" "--format=raw" id)) ;; Because we process the messages in reverse order, ;; always generate a forwarded subject, then use the ;; last (i.e. first) one. @@ -524,7 +534,8 @@ the From: address." (message-add-header (concat "References: " (mapconcat 'identity forward-references " ")))) - ;; Create a buffer-local queue for tag changes triggered when sending the message + ;; Create a buffer-local queue for tag changes triggered when + ;; sending the message. (when notmuch-message-forwarded-tags (setq-local notmuch-message-queued-tag-changes (cl-loop for id in forward-queries @@ -609,7 +620,8 @@ unencrypted. Really send? ")))) (run-hooks 'notmuch-mua-send-hook) (when (and (notmuch-mua-check-no-misplaced-secure-tag) (notmuch-mua-check-secure-tag-has-newline)) - (cl-letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc)) + (cl-letf (((symbol-function 'message-do-fcc) + #'notmuch-maildir-message-do-fcc)) (if exit (message-send-and-exit arg) (message-send arg))))) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 0eb27e33..41f31c46 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -51,7 +51,8 @@ (declare-function notmuch-count-attachments "notmuch" (mm-handle)) (declare-function notmuch-save-attachments "notmuch" (mm-handle &optional queryp)) (declare-function notmuch-tree "notmuch-tree" - (&optional query query-context target buffer-name open-target unthreaded)) + (&optional query query-context target buffer-name + open-target unthreaded)) (declare-function notmuch-tree-get-message-properties "notmuch-tree" nil) (declare-function notmuch-unthreaded (&optional query query-context target buffer-name open-target)) @@ -95,10 +96,11 @@ visible for any given message." :group 'notmuch-show :group 'notmuch-hooks) -(defcustom notmuch-show-insert-text/plain-hook '(notmuch-wash-wrap-long-lines - notmuch-wash-tidy-citations - notmuch-wash-elide-blank-lines - notmuch-wash-excerpt-citations) +(defcustom notmuch-show-insert-text/plain-hook + '(notmuch-wash-wrap-long-lines + notmuch-wash-tidy-citations + notmuch-wash-elide-blank-lines + notmuch-wash-excerpt-citations) "Functions used to improve the display of text/plain parts." :type 'hook :options '(notmuch-wash-convert-inline-patch-to-part @@ -348,7 +350,9 @@ operation on the contents of the current buffer." (with-temp-buffer (insert all) (if indenting - (indent-rigidly (point-min) (point-max) (- (* notmuch-show-indent-messages-width depth)))) + (indent-rigidly (point-min) + (point-max) + (- (* notmuch-show-indent-messages-width depth)))) ;; Remove the original header. (goto-char (point-min)) (re-search-forward "^$" (point-max) nil) @@ -395,7 +399,9 @@ operation on the contents of the current buffer." (if (re-search-forward "(\\([^()]*\\))$" (line-end-position) t) (let ((inhibit-read-only t)) (replace-match (concat "(" - (notmuch-tag-format-tags tags (notmuch-show-get-prop :orig-tags)) + (notmuch-tag-format-tags + tags + (notmuch-show-get-prop :orig-tags)) ")")))))) (defun notmuch-clean-address (address) @@ -481,7 +487,8 @@ message at DEPTH in the current thread." ") (" (notmuch-tag-format-tags tags tags) ")\n") - (overlay-put (make-overlay start (point)) 'face 'notmuch-message-summary-face))) + (overlay-put (make-overlay start (point)) + 'face 'notmuch-message-summary-face))) (defun notmuch-show-insert-header (header header-value) "Insert a single header." @@ -508,7 +515,8 @@ message at DEPTH in the current thread." 'face 'message-mml :supertype 'notmuch-button-type) -(defun notmuch-show-insert-part-header (nth content-type declared-type &optional name comment) +(defun notmuch-show-insert-part-header (nth content-type declared-type + &optional name comment) (let ((button) (base-label (concat (when name (concat name ": ")) declared-type @@ -532,8 +540,9 @@ message at DEPTH in the current thread." (when button (let ((overlay (button-get button 'overlay)) (lazy-part (button-get button :notmuch-lazy-part))) - ;; We have a part to toggle if there is an overlay or |