mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-17 23:14:52 +01:00
emacs: Fix indentation
This commit is contained in:
parent
6fb7d35069
commit
caaa108760
15 changed files with 312 additions and 309 deletions
|
@ -108,11 +108,11 @@ If the line should not be broken, return nil; point remains on the
|
||||||
line."
|
line."
|
||||||
(move-to-column fill-column)
|
(move-to-column fill-column)
|
||||||
(if (and (re-search-forward "[^ ]" (line-end-position) 1)
|
(if (and (re-search-forward "[^ ]" (line-end-position) 1)
|
||||||
(> (current-column) fill-column))
|
(> (current-column) fill-column))
|
||||||
;; This line is too long. Can we break it?
|
;; This line is too long. Can we break it?
|
||||||
(or (coolj-find-break-backward prefix)
|
(or (coolj-find-break-backward prefix)
|
||||||
(progn (move-to-column fill-column)
|
(progn (move-to-column fill-column)
|
||||||
(coolj-find-break-forward)))))
|
(coolj-find-break-forward)))))
|
||||||
|
|
||||||
(defun coolj-find-break-backward (prefix)
|
(defun coolj-find-break-backward (prefix)
|
||||||
"Move point backward to the first available breakpoint and return t.
|
"Move point backward to the first available breakpoint and return t.
|
||||||
|
@ -135,12 +135,12 @@ If no breakpoint is found, return nil."
|
||||||
If no break point is found, return nil."
|
If no break point is found, return nil."
|
||||||
(and (search-forward " " (line-end-position) 1)
|
(and (search-forward " " (line-end-position) 1)
|
||||||
(progn (skip-chars-forward " " (line-end-position))
|
(progn (skip-chars-forward " " (line-end-position))
|
||||||
(null (eolp)))
|
(null (eolp)))
|
||||||
(if (and fill-nobreak-predicate
|
(if (and fill-nobreak-predicate
|
||||||
(run-hook-with-args-until-success
|
(run-hook-with-args-until-success
|
||||||
'fill-nobreak-predicate))
|
'fill-nobreak-predicate))
|
||||||
(coolj-find-break-forward)
|
(coolj-find-break-forward)
|
||||||
t)))
|
t)))
|
||||||
|
|
||||||
(provide 'coolj)
|
(provide 'coolj)
|
||||||
|
|
||||||
|
|
|
@ -153,14 +153,14 @@ matching `notmuch-address-completion-headers-regexp'."
|
||||||
|
|
||||||
(defun notmuch-address-setup ()
|
(defun notmuch-address-setup ()
|
||||||
(let* ((setup-company (and notmuch-address-use-company
|
(let* ((setup-company (and notmuch-address-use-company
|
||||||
(require 'company nil t)))
|
(require 'company nil t)))
|
||||||
(pair (cons notmuch-address-completion-headers-regexp
|
(pair (cons notmuch-address-completion-headers-regexp
|
||||||
#'notmuch-address-expand-name)))
|
#'notmuch-address-expand-name)))
|
||||||
(when setup-company
|
(when setup-company
|
||||||
(notmuch-company-setup))
|
(notmuch-company-setup))
|
||||||
(unless (member pair message-completion-alist)
|
(unless (member pair message-completion-alist)
|
||||||
(setq message-completion-alist
|
(setq message-completion-alist
|
||||||
(push pair message-completion-alist)))))
|
(push pair message-completion-alist)))))
|
||||||
|
|
||||||
(defun notmuch-address-toggle-internal-completion ()
|
(defun notmuch-address-toggle-internal-completion ()
|
||||||
"Toggle use of internal completion for current buffer.
|
"Toggle use of internal completion for current buffer.
|
||||||
|
@ -323,7 +323,7 @@ execution, CALLBACK is called when harvesting finishes."
|
||||||
,query)))
|
,query)))
|
||||||
(if synchronous
|
(if synchronous
|
||||||
(mapc #'notmuch-address-harvest-addr
|
(mapc #'notmuch-address-harvest-addr
|
||||||
(apply 'notmuch-call-notmuch-sexp args))
|
(apply 'notmuch-call-notmuch-sexp args))
|
||||||
;; Asynchronous
|
;; Asynchronous
|
||||||
(let* ((current-proc (if addr-prefix
|
(let* ((current-proc (if addr-prefix
|
||||||
(car notmuch-address-harvest-procs)
|
(car notmuch-address-harvest-procs)
|
||||||
|
@ -390,7 +390,7 @@ to be a saved address hash."
|
||||||
(defun notmuch-address--save-address-hash ()
|
(defun notmuch-address--save-address-hash ()
|
||||||
(when notmuch-address-save-filename
|
(when notmuch-address-save-filename
|
||||||
(if (or (not (file-exists-p notmuch-address-save-filename))
|
(if (or (not (file-exists-p notmuch-address-save-filename))
|
||||||
;; The file exists, check it is a file we saved
|
;; The file exists, check it is a file we saved
|
||||||
(notmuch-address--get-address-hash))
|
(notmuch-address--get-address-hash))
|
||||||
(with-temp-file notmuch-address-save-filename
|
(with-temp-file notmuch-address-save-filename
|
||||||
(let ((save-plist
|
(let ((save-plist
|
||||||
|
|
|
@ -35,7 +35,7 @@ Backport of setq-local for emacs without setq-local (pre 24.3)."
|
||||||
(if (fboundp 'read-char-choice)
|
(if (fboundp 'read-char-choice)
|
||||||
(defalias 'notmuch-read-char-choice 'read-char-choice)
|
(defalias 'notmuch-read-char-choice 'read-char-choice)
|
||||||
(defun notmuch-read-char-choice (prompt chars &optional inhibit-keyboard-quit)
|
(defun notmuch-read-char-choice (prompt chars &optional inhibit-keyboard-quit)
|
||||||
"Read and return one of CHARS, prompting for PROMPT.
|
"Read and return one of CHARS, prompting for PROMPT.
|
||||||
Any input that is not one of CHARS is ignored.
|
Any input that is not one of CHARS is ignored.
|
||||||
|
|
||||||
If optional argument INHIBIT-KEYBOARD-QUIT is non-nil, ignore
|
If optional argument INHIBIT-KEYBOARD-QUIT is non-nil, ignore
|
||||||
|
@ -44,49 +44,49 @@ keyboard-quit events while waiting for a valid input.
|
||||||
This is an exact copy of this function from emacs 24 for use on
|
This is an exact copy of this function from emacs 24 for use on
|
||||||
emacs 23, except with the one emacs 24 only function it calls
|
emacs 23, except with the one emacs 24 only function it calls
|
||||||
inlined."
|
inlined."
|
||||||
(unless (consp chars)
|
(unless (consp chars)
|
||||||
(error "Called `read-char-choice' without valid char choices"))
|
(error "Called `read-char-choice' without valid char choices"))
|
||||||
(let (char done show-help (helpbuf " *Char Help*"))
|
(let (char done show-help (helpbuf " *Char Help*"))
|
||||||
(let ((cursor-in-echo-area t)
|
(let ((cursor-in-echo-area t)
|
||||||
(executing-kbd-macro executing-kbd-macro)
|
(executing-kbd-macro executing-kbd-macro)
|
||||||
(esc-flag nil))
|
(esc-flag nil))
|
||||||
(save-window-excursion ; in case we call help-form-show
|
(save-window-excursion ; in case we call help-form-show
|
||||||
(while (not done)
|
(while (not done)
|
||||||
(unless (get-text-property 0 'face prompt)
|
(unless (get-text-property 0 'face prompt)
|
||||||
(setq prompt (propertize prompt 'face 'minibuffer-prompt)))
|
(setq prompt (propertize prompt 'face 'minibuffer-prompt)))
|
||||||
(setq char (let ((inhibit-quit inhibit-keyboard-quit))
|
(setq char (let ((inhibit-quit inhibit-keyboard-quit))
|
||||||
(read-key prompt)))
|
(read-key prompt)))
|
||||||
(and show-help (buffer-live-p (get-buffer helpbuf))
|
(and show-help (buffer-live-p (get-buffer helpbuf))
|
||||||
(kill-buffer helpbuf))
|
(kill-buffer helpbuf))
|
||||||
(cond
|
|
||||||
((not (numberp char)))
|
|
||||||
;; If caller has set help-form, that's enough.
|
|
||||||
;; They don't explicitly have to add help-char to chars.
|
|
||||||
((and help-form
|
|
||||||
(eq char help-char)
|
|
||||||
(setq show-help t)
|
|
||||||
;; This is an inlined copy of help-form-show as that
|
|
||||||
;; was introduced in emacs 24 too.
|
|
||||||
(let ((msg (eval help-form)))
|
|
||||||
(if (stringp msg)
|
|
||||||
(with-output-to-temp-buffer " *Char Help*"
|
|
||||||
(princ msg))))))
|
|
||||||
((memq char chars)
|
|
||||||
(setq done t))
|
|
||||||
((and executing-kbd-macro (= char -1))
|
|
||||||
;; read-event returns -1 if we are in a kbd macro and
|
|
||||||
;; there are no more events in the macro. Attempt to
|
|
||||||
;; get an event interactively.
|
|
||||||
(setq executing-kbd-macro nil))
|
|
||||||
((not inhibit-keyboard-quit)
|
|
||||||
(cond
|
(cond
|
||||||
((and (null esc-flag) (eq char ?\e))
|
((not (numberp char)))
|
||||||
(setq esc-flag t))
|
;; If caller has set help-form, that's enough.
|
||||||
((memq char '(?\C-g ?\e))
|
;; They don't explicitly have to add help-char to chars.
|
||||||
(keyboard-quit))))))))
|
((and help-form
|
||||||
;; Display the question with the answer. But without cursor-in-echo-area.
|
(eq char help-char)
|
||||||
(message "%s%s" prompt (char-to-string char))
|
(setq show-help t)
|
||||||
char)))
|
;; This is an inlined copy of help-form-show as that
|
||||||
|
;; was introduced in emacs 24 too.
|
||||||
|
(let ((msg (eval help-form)))
|
||||||
|
(if (stringp msg)
|
||||||
|
(with-output-to-temp-buffer " *Char Help*"
|
||||||
|
(princ msg))))))
|
||||||
|
((memq char chars)
|
||||||
|
(setq done t))
|
||||||
|
((and executing-kbd-macro (= char -1))
|
||||||
|
;; read-event returns -1 if we are in a kbd macro and
|
||||||
|
;; there are no more events in the macro. Attempt to
|
||||||
|
;; get an event interactively.
|
||||||
|
(setq executing-kbd-macro nil))
|
||||||
|
((not inhibit-keyboard-quit)
|
||||||
|
(cond
|
||||||
|
((and (null esc-flag) (eq char ?\e))
|
||||||
|
(setq esc-flag t))
|
||||||
|
((memq char '(?\C-g ?\e))
|
||||||
|
(keyboard-quit))))))))
|
||||||
|
;; Display the question with the answer. But without cursor-in-echo-area.
|
||||||
|
(message "%s%s" prompt (char-to-string char))
|
||||||
|
char)))
|
||||||
|
|
||||||
;; End of compatibility functions
|
;; End of compatibility functions
|
||||||
|
|
||||||
|
|
|
@ -153,17 +153,17 @@ Used when a new version is saved, or the message is sent."
|
||||||
|
|
||||||
`notmuch-draft-save-plaintext' controls the behaviour."
|
`notmuch-draft-save-plaintext' controls the behaviour."
|
||||||
(cl-case notmuch-draft-save-plaintext
|
(cl-case notmuch-draft-save-plaintext
|
||||||
((ask)
|
((ask)
|
||||||
(unless (yes-or-no-p
|
(unless (yes-or-no-p
|
||||||
"(Customize `notmuch-draft-save-plaintext' to avoid this warning)
|
"(Customize `notmuch-draft-save-plaintext' to avoid this warning)
|
||||||
This message contains mml tags that suggest it is intended to be encrypted.
|
This message contains mml tags that suggest it is intended to be encrypted.
|
||||||
Really save and index an unencrypted copy? ")
|
Really save and index an unencrypted copy? ")
|
||||||
(error "Save aborted")))
|
(error "Save aborted")))
|
||||||
((nil)
|
((nil)
|
||||||
(error "Refusing to save draft with encryption tags (see `%s')"
|
(error "Refusing to save draft with encryption tags (see `%s')"
|
||||||
'notmuch-draft-save-plaintext))
|
'notmuch-draft-save-plaintext))
|
||||||
((t)
|
((t)
|
||||||
(ignore))))
|
(ignore))))
|
||||||
|
|
||||||
(defun notmuch-draft--make-message-id ()
|
(defun notmuch-draft--make-message-id ()
|
||||||
;; message-make-message-id gives the id inside a "<" ">" pair,
|
;; message-make-message-id gives the id inside a "<" ">" pair,
|
||||||
|
|
|
@ -147,9 +147,9 @@ a plist. Supported properties are
|
||||||
|
|
||||||
Other accepted forms are a cons cell of the form (NAME . QUERY)
|
Other accepted forms are a cons cell of the form (NAME . QUERY)
|
||||||
or a list of the form (NAME QUERY COUNT-QUERY)."
|
or a list of the form (NAME QUERY COUNT-QUERY)."
|
||||||
;; The saved-search format is also used by the all-tags notmuch-hello
|
;; The saved-search format is also used by the all-tags notmuch-hello
|
||||||
;; section. This section generates its own saved-search list in one of
|
;; section. This section generates its own saved-search list in one of
|
||||||
;; the latter two forms.
|
;; the latter two forms.
|
||||||
:get 'notmuch-hello--saved-searches-to-plist
|
:get 'notmuch-hello--saved-searches-to-plist
|
||||||
:type '(repeat notmuch-saved-search-plist)
|
:type '(repeat notmuch-saved-search-plist)
|
||||||
:tag "List of Saved Searches"
|
:tag "List of Saved Searches"
|
||||||
|
@ -382,10 +382,10 @@ afterwards.")
|
||||||
(setq n (/ n 1000)))
|
(setq n (/ n 1000)))
|
||||||
(setq result (or result '(0)))
|
(setq result (or result '(0)))
|
||||||
(apply #'concat
|
(apply #'concat
|
||||||
(number-to-string (car result))
|
(number-to-string (car result))
|
||||||
(mapcar (lambda (elem)
|
(mapcar (lambda (elem)
|
||||||
(format "%s%03d" notmuch-hello-thousands-separator elem))
|
(format "%s%03d" notmuch-hello-thousands-separator elem))
|
||||||
(cdr result)))))
|
(cdr result)))))
|
||||||
|
|
||||||
(defun notmuch-hello-trim (search)
|
(defun notmuch-hello-trim (search)
|
||||||
"Trim whitespace."
|
"Trim whitespace."
|
||||||
|
@ -540,7 +540,7 @@ options will be handled as specified for
|
||||||
(notmuch-hello-filtered-query count-query
|
(notmuch-hello-filtered-query count-query
|
||||||
(or (plist-get options :filter-count)
|
(or (plist-get options :filter-count)
|
||||||
(plist-get options :filter))))
|
(plist-get options :filter))))
|
||||||
"\n")))
|
"\n")))
|
||||||
(unless (= (call-process-region (point-min) (point-max) notmuch-command
|
(unless (= (call-process-region (point-min) (point-max) notmuch-command
|
||||||
t t nil "count" "--batch") 0)
|
t t nil "count" "--batch") 0)
|
||||||
(notmuch-logged-error
|
(notmuch-logged-error
|
||||||
|
@ -690,7 +690,7 @@ with `notmuch-hello-query-counts'."
|
||||||
(fset 'notmuch-hello-mode-map notmuch-hello-mode-map)
|
(fset 'notmuch-hello-mode-map notmuch-hello-mode-map)
|
||||||
|
|
||||||
(define-derived-mode notmuch-hello-mode fundamental-mode "notmuch-hello"
|
(define-derived-mode notmuch-hello-mode fundamental-mode "notmuch-hello"
|
||||||
"Major mode for convenient notmuch navigation. This is your entry portal into notmuch.
|
"Major mode for convenient notmuch navigation. This is your entry portal into notmuch.
|
||||||
|
|
||||||
Saved searches are \"bookmarks\" for arbitrary queries. Hit RET
|
Saved searches are \"bookmarks\" for arbitrary queries. Hit RET
|
||||||
or click on a saved search to view matching threads. Edit saved
|
or click on a saved search to view matching threads. Edit saved
|
||||||
|
@ -720,9 +720,9 @@ The screen may be customized via `\\[customize]'.
|
||||||
Complete list of currently available key bindings:
|
Complete list of currently available key bindings:
|
||||||
|
|
||||||
\\{notmuch-hello-mode-map}"
|
\\{notmuch-hello-mode-map}"
|
||||||
(setq notmuch-buffer-refresh-function #'notmuch-hello-update)
|
(setq notmuch-buffer-refresh-function #'notmuch-hello-update)
|
||||||
;;(setq buffer-read-only t)
|
;;(setq buffer-read-only t)
|
||||||
)
|
)
|
||||||
|
|
||||||
(defun notmuch-hello-generate-tag-alist (&optional hide-tags)
|
(defun notmuch-hello-generate-tag-alist (&optional hide-tags)
|
||||||
"Return an alist from tags to queries to display in the all-tags section."
|
"Return an alist from tags to queries to display in the all-tags section."
|
||||||
|
|
|
@ -211,7 +211,7 @@ Otherwise the output will be returned."
|
||||||
(unless (notmuch-cli-sane-p)
|
(unless (notmuch-cli-sane-p)
|
||||||
(notmuch-logged-error
|
(notmuch-logged-error
|
||||||
"notmuch cli seems misconfigured or unconfigured."
|
"notmuch cli seems misconfigured or unconfigured."
|
||||||
"Perhaps you haven't run \"notmuch setup\" yet? Try running this
|
"Perhaps you haven't run \"notmuch setup\" yet? Try running this
|
||||||
on the command line, and then retry your notmuch command")))
|
on the command line, and then retry your notmuch command")))
|
||||||
|
|
||||||
(defun notmuch-cli-version ()
|
(defun notmuch-cli-version ()
|
||||||
|
@ -321,7 +321,7 @@ It does not prepend if ACTUAL-KEY is already listed in TAIL."
|
||||||
(and (functionp binding)
|
(and (functionp binding)
|
||||||
(notmuch-documentation-first-line binding))))
|
(notmuch-documentation-first-line binding))))
|
||||||
tail)))
|
tail)))
|
||||||
tail)
|
tail)
|
||||||
|
|
||||||
(defun notmuch-describe-remaps (remap-keymap ua-keys base-keymap prefix tail)
|
(defun notmuch-describe-remaps (remap-keymap ua-keys base-keymap prefix tail)
|
||||||
;; Remappings are represented as a binding whose first "event" is
|
;; Remappings are represented as a binding whose first "event" is
|
||||||
|
@ -413,8 +413,8 @@ of its command symbol."
|
||||||
"Show help for a subkeymap."
|
"Show help for a subkeymap."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let* ((key (this-command-keys-vector))
|
(let* ((key (this-command-keys-vector))
|
||||||
(prefix (make-vector (1- (length key)) nil))
|
(prefix (make-vector (1- (length key)) nil))
|
||||||
(i 0))
|
(i 0))
|
||||||
(while (< i (length prefix))
|
(while (< i (length prefix))
|
||||||
(aset prefix i (aref key i))
|
(aset prefix i (aref key i))
|
||||||
(setq i (1+ i)))
|
(setq i (1+ i)))
|
||||||
|
@ -527,7 +527,7 @@ This replaces spaces, percents, and double quotes in STR with
|
||||||
(let (out)
|
(let (out)
|
||||||
(while list
|
(while list
|
||||||
(when (funcall predicate (car list))
|
(when (funcall predicate (car list))
|
||||||
(push (car list) out))
|
(push (car list) out))
|
||||||
(setq list (cdr list)))
|
(setq list (cdr list)))
|
||||||
(nreverse out)))
|
(nreverse out)))
|
||||||
|
|
||||||
|
@ -835,24 +835,24 @@ You may need to restart Emacs or upgrade your notmuch package."))
|
||||||
command " "))
|
command " "))
|
||||||
(extra
|
(extra
|
||||||
(concat "command: " command-string "\n"
|
(concat "command: " command-string "\n"
|
||||||
(if (integerp exit-status)
|
(if (integerp exit-status)
|
||||||
(format "exit status: %s\n" exit-status)
|
(format "exit status: %s\n" exit-status)
|
||||||
(format "exit signal: %s\n" exit-status))
|
(format "exit signal: %s\n" exit-status))
|
||||||
(when err
|
(when err
|
||||||
(concat "stderr:\n" err))
|
(concat "stderr:\n" err))
|
||||||
(when output
|
(when output
|
||||||
(concat "stdout:\n" output)))))
|
(concat "stdout:\n" output)))))
|
||||||
(if err
|
(if err
|
||||||
;; We have an error message straight from the CLI.
|
;; We have an error message straight from the CLI.
|
||||||
(notmuch-logged-error
|
(notmuch-logged-error
|
||||||
(replace-regexp-in-string "[ \n\r\t\f]*\\'" "" err) extra)
|
(replace-regexp-in-string "[ \n\r\t\f]*\\'" "" err) extra)
|
||||||
;; We only have combined output from the CLI; don't inundate
|
;; We only have combined output from the CLI; don't inundate
|
||||||
;; the user with it. Mimic `process-lines'.
|
;; the user with it. Mimic `process-lines'.
|
||||||
(notmuch-logged-error (format "%s exited with status %s"
|
(notmuch-logged-error (format "%s exited with status %s"
|
||||||
(car command) exit-status)
|
(car command) exit-status)
|
||||||
extra))
|
extra))
|
||||||
;; `notmuch-logged-error' does not return.
|
;; `notmuch-logged-error' does not return.
|
||||||
))))
|
))))
|
||||||
|
|
||||||
(defun notmuch-call-notmuch--helper (destination args)
|
(defun notmuch-call-notmuch--helper (destination args)
|
||||||
"Helper for synchronous notmuch invocation commands.
|
"Helper for synchronous notmuch invocation commands.
|
||||||
|
@ -925,9 +925,9 @@ invoke `set-process-sentinel' directly on the returned process,
|
||||||
as that will interfere with the handling of stderr and the exit
|
as that will interfere with the handling of stderr and the exit
|
||||||
status."
|
status."
|
||||||
(let (err-file err-buffer proc err-proc
|
(let (err-file err-buffer proc err-proc
|
||||||
;; Find notmuch using Emacs' `exec-path'
|
;; Find notmuch using Emacs' `exec-path'
|
||||||
(command (or (executable-find notmuch-command)
|
(command (or (executable-find notmuch-command)
|
||||||
(error "Command not found: %s" notmuch-command))))
|
(error "Command not found: %s" notmuch-command))))
|
||||||
(if (fboundp 'make-process)
|
(if (fboundp 'make-process)
|
||||||
(progn
|
(progn
|
||||||
(setq err-buffer (generate-new-buffer " *notmuch-stderr*"))
|
(setq err-buffer (generate-new-buffer " *notmuch-stderr*"))
|
||||||
|
@ -1030,8 +1030,8 @@ region if the region is active, or both `point' otherwise."
|
||||||
(list (point) (point))))
|
(list (point) (point))))
|
||||||
|
|
||||||
(define-obsolete-function-alias
|
(define-obsolete-function-alias
|
||||||
'notmuch-search-interactive-region
|
'notmuch-search-interactive-region
|
||||||
'notmuch-interactive-region
|
'notmuch-interactive-region
|
||||||
"notmuch 0.29")
|
"notmuch 0.29")
|
||||||
|
|
||||||
(provide 'notmuch-lib)
|
(provide 'notmuch-lib)
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
(defvar notmuch-maildir-fcc-count 0)
|
(defvar notmuch-maildir-fcc-count 0)
|
||||||
|
|
||||||
(defcustom notmuch-fcc-dirs "sent"
|
(defcustom notmuch-fcc-dirs "sent"
|
||||||
"Determines the Fcc Header which says where to save outgoing mail.
|
"Determines the Fcc Header which says where to save outgoing mail.
|
||||||
|
|
||||||
Three types of values are permitted:
|
Three types of values are permitted:
|
||||||
|
|
||||||
|
@ -69,13 +69,13 @@ database.path option in the notmuch configuration file).
|
||||||
In all cases you will be prompted to create the folder or
|
In all cases you will be prompted to create the folder or
|
||||||
directory if it does not exist yet when sending a mail."
|
directory if it does not exist yet when sending a mail."
|
||||||
|
|
||||||
:type '(choice
|
:type '(choice
|
||||||
(const :tag "No FCC header" nil)
|
(const :tag "No FCC header" nil)
|
||||||
(string :tag "A single folder")
|
(string :tag "A single folder")
|
||||||
(repeat :tag "A folder based on the From header"
|
(repeat :tag "A folder based on the From header"
|
||||||
(cons regexp (string :tag "Folder"))))
|
(cons regexp (string :tag "Folder"))))
|
||||||
:require 'notmuch-fcc-initialization
|
:require 'notmuch-fcc-initialization
|
||||||
:group 'notmuch-send)
|
:group 'notmuch-send)
|
||||||
|
|
||||||
(defcustom notmuch-maildir-use-notmuch-insert 't
|
(defcustom notmuch-maildir-use-notmuch-insert 't
|
||||||
"Should fcc use notmuch insert instead of simple fcc."
|
"Should fcc use notmuch insert instead of simple fcc."
|
||||||
|
@ -267,16 +267,16 @@ If CREATE is non-nil then create the folder if necessary."
|
||||||
t))
|
t))
|
||||||
|
|
||||||
(defun notmuch-maildir-fcc-make-uniq-maildir-id ()
|
(defun notmuch-maildir-fcc-make-uniq-maildir-id ()
|
||||||
(let* ((ftime (float-time))
|
(let* ((ftime (float-time))
|
||||||
(microseconds (mod (* 1000000 ftime) 1000000))
|
(microseconds (mod (* 1000000 ftime) 1000000))
|
||||||
(hostname (notmuch-maildir-fcc-host-fixer (system-name))))
|
(hostname (notmuch-maildir-fcc-host-fixer (system-name))))
|
||||||
(setq notmuch-maildir-fcc-count (+ notmuch-maildir-fcc-count 1))
|
(setq notmuch-maildir-fcc-count (+ notmuch-maildir-fcc-count 1))
|
||||||
(format "%d.%d_%d_%d.%s"
|
(format "%d.%d_%d_%d.%s"
|
||||||
ftime
|
ftime
|
||||||
(emacs-pid)
|
(emacs-pid)
|
||||||
microseconds
|
microseconds
|
||||||
notmuch-maildir-fcc-count
|
notmuch-maildir-fcc-count
|
||||||
hostname)))
|
hostname)))
|
||||||
|
|
||||||
(defun notmuch-maildir-fcc-dir-is-maildir-p (dir)
|
(defun notmuch-maildir-fcc-dir-is-maildir-p (dir)
|
||||||
(and (file-exists-p (concat dir "/cur/"))
|
(and (file-exists-p (concat dir "/cur/"))
|
||||||
|
@ -328,17 +328,17 @@ if needed."
|
||||||
;; fix it in some way.
|
;; fix it in some way.
|
||||||
(let* ((prompt (format "Fcc %s is not a maildir: \
|
(let* ((prompt (format "Fcc %s is not a maildir: \
|
||||||
\(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " fcc-header))
|
\(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " fcc-header))
|
||||||
(response (notmuch-read-char-choice prompt '(?r ?c ?i ?e))))
|
(response (notmuch-read-char-choice prompt '(?r ?c ?i ?e))))
|
||||||
(cl-case response
|
(cl-case response
|
||||||
(?r (notmuch-maildir-fcc-file-fcc fcc-header))
|
(?r (notmuch-maildir-fcc-file-fcc fcc-header))
|
||||||
(?c (if (file-writable-p fcc-header)
|
(?c (if (file-writable-p fcc-header)
|
||||||
(notmuch-maildir-fcc-create-maildir fcc-header)
|
(notmuch-maildir-fcc-create-maildir fcc-header)
|
||||||
(message "No permission to create %s." fcc-header)
|
(message "No permission to create %s." fcc-header)
|
||||||
(sit-for 2))
|
(sit-for 2))
|
||||||
(notmuch-maildir-fcc-file-fcc fcc-header))
|
(notmuch-maildir-fcc-file-fcc fcc-header))
|
||||||
(?i 't)
|
(?i 't)
|
||||||
(?e (notmuch-maildir-fcc-file-fcc
|
(?e (notmuch-maildir-fcc-file-fcc
|
||||||
(read-from-minibuffer "Fcc header: " fcc-header)))))))
|
(read-from-minibuffer "Fcc header: " fcc-header)))))))
|
||||||
|
|
||||||
(defun notmuch-maildir-fcc-write-buffer-to-maildir (destdir &optional mark-seen)
|
(defun notmuch-maildir-fcc-write-buffer-to-maildir (destdir &optional mark-seen)
|
||||||
"Writes the current buffer to maildir destdir. If mark-seen is
|
"Writes the current buffer to maildir destdir. If mark-seen is
|
||||||
|
|
|
@ -58,7 +58,7 @@ window/frame that will be destroyed when the buffer is killed.
|
||||||
You may want to customize `message-kill-buffer-on-exit'
|
You may want to customize `message-kill-buffer-on-exit'
|
||||||
accordingly."
|
accordingly."
|
||||||
(when (< emacs-major-version 24)
|
(when (< emacs-major-version 24)
|
||||||
" Due to a known bug in Emacs 23, you should not set
|
" Due to a known bug in Emacs 23, you should not set
|
||||||
this to `new-window' if `message-kill-buffer-on-exit' is
|
this to `new-window' if `message-kill-buffer-on-exit' is
|
||||||
disabled: this would result in an incorrect behavior."))
|
disabled: this would result in an incorrect behavior."))
|
||||||
:group 'notmuch-send
|
:group 'notmuch-send
|
||||||
|
@ -106,13 +106,13 @@ Note that these functions use `mail-citation-hook' if that is non-nil."
|
||||||
This function specifies which parts of a mime message with
|
This function specifies which parts of a mime message with
|
||||||
multiple parts get a header."
|
multiple parts get a header."
|
||||||
:type '(radio (const :tag "No part headers"
|
:type '(radio (const :tag "No part headers"
|
||||||
notmuch-show-reply-insert-header-p-never)
|
notmuch-show-reply-insert-header-p-never)
|
||||||
(const :tag "All except multipart/* and hidden parts"
|
(const :tag "All except multipart/* and hidden parts"
|
||||||
notmuch-show-reply-insert-header-p-trimmed)
|
notmuch-show-reply-insert-header-p-trimmed)
|
||||||
(const :tag "Only for included text parts"
|
(const :tag "Only for included text parts"
|
||||||
notmuch-show-reply-insert-header-p-minimal)
|
notmuch-show-reply-insert-header-p-minimal)
|
||||||
(const :tag "Exactly as in show view"
|
(const :tag "Exactly as in show view"
|
||||||
notmuch-show-insert-header-p)
|
notmuch-show-insert-header-p)
|
||||||
(function :tag "Other"))
|
(function :tag "Other"))
|
||||||
:group 'notmuch-reply)
|
:group 'notmuch-reply)
|
||||||
|
|
||||||
|
@ -472,10 +472,12 @@ the From: address."
|
||||||
(let* ((other-headers
|
(let* ((other-headers
|
||||||
(when (or prompt-for-sender notmuch-always-prompt-for-sender)
|
(when (or prompt-for-sender notmuch-always-prompt-for-sender)
|
||||||
(list (cons 'From (notmuch-mua-prompt-for-sender)))))
|
(list (cons 'From (notmuch-mua-prompt-for-sender)))))
|
||||||
forward-subject ;; Comes from the first message and is
|
;; Comes from the first message and is applied later.
|
||||||
;; applied later.
|
forward-subject
|
||||||
forward-references ;; List of accumulated message-references of forwarded messages
|
;; List of accumulated message-references of forwarded messages.
|
||||||
forward-queries) ;; List of corresponding message-query
|
forward-references
|
||||||
|
;; List of corresponding message-query.
|
||||||
|
forward-queries)
|
||||||
;; Generate the template for the outgoing message.
|
;; Generate the template for the outgoing message.
|
||||||
(notmuch-mua-mail nil "" other-headers nil (notmuch-mua-get-switch-function))
|
(notmuch-mua-mail nil "" other-headers nil (notmuch-mua-get-switch-function))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
@ -529,17 +531,17 @@ the From: address."
|
||||||
If PROMPT-FOR-SENDER is non-nil, the user will be prompted for
|
If PROMPT-FOR-SENDER is non-nil, the user will be prompted for
|
||||||
the From: address first. If REPLY-ALL is non-nil, the message
|
the From: address first. If REPLY-ALL is non-nil, the message
|
||||||
will be addressed to all recipients of the source message."
|
will be addressed to all recipients of the source message."
|
||||||
;; In current emacs (24.3) select-active-regions is set to t by
|
;; In current emacs (24.3) select-active-regions is set to t by
|
||||||
;; default. The reply insertion code sets the region to the quoted
|
;; default. The reply insertion code sets the region to the quoted
|
||||||
;; message to make it easy to delete (kill-region or C-w). These two
|
;; message to make it easy to delete (kill-region or C-w). These two
|
||||||
;; things combine to put the quoted message in the primary selection.
|
;; things combine to put the quoted message in the primary selection.
|
||||||
;;
|
;;
|
||||||
;; This is not what the user wanted and is a privacy risk (accidental
|
;; This is not what the user wanted and is a privacy risk (accidental
|
||||||
;; pasting of the quoted message). We can avoid some of the problems
|
;; pasting of the quoted message). We can avoid some of the problems
|
||||||
;; by let-binding select-active-regions to nil. This fixes if the
|
;; by let-binding select-active-regions to nil. This fixes if the
|
||||||
;; primary selection was previously in a non-emacs window but not if
|
;; primary selection was previously in a non-emacs window but not if
|
||||||
;; it was in an emacs window. To avoid the problem in the latter case
|
;; it was in an emacs window. To avoid the problem in the latter case
|
||||||
;; we deactivate mark.
|
;; we deactivate mark.
|
||||||
(let ((sender
|
(let ((sender
|
||||||
(when prompt-for-sender
|
(when prompt-for-sender
|
||||||
(notmuch-mua-prompt-for-sender)))
|
(notmuch-mua-prompt-for-sender)))
|
||||||
|
|
|
@ -42,9 +42,9 @@ is a possibly empty forest of replies."
|
||||||
"Private function to do the actual mapping and flattening."
|
"Private function to do the actual mapping and flattening."
|
||||||
(apply 'append
|
(apply 'append
|
||||||
(mapcar
|
(mapcar
|
||||||
(lambda (tree)
|
(lambda (tree)
|
||||||
(funcall mapper function tree))
|
(funcall mapper function tree))
|
||||||
seq)))
|
seq)))
|
||||||
|
|
||||||
(defun notmuch-query-map-threads (fn threads)
|
(defun notmuch-query-map-threads (fn threads)
|
||||||
"Apply FN to every thread in THREADS. Flatten results to a list.
|
"Apply FN to every thread in THREADS. Flatten results to a list.
|
||||||
|
|
|
@ -272,7 +272,7 @@ position of the message in the thread."
|
||||||
`(save-excursion
|
`(save-excursion
|
||||||
(let ((id (notmuch-show-get-message-id)))
|
(let ((id (notmuch-show-get-message-id)))
|
||||||
(let ((buf (generate-new-buffer (concat "*notmuch-msg-" id "*"))))
|
(let ((buf (generate-new-buffer (concat "*notmuch-msg-" id "*"))))
|
||||||
(with-current-buffer buf
|
(with-current-buffer buf
|
||||||
(let ((coding-system-for-read 'no-conversion))
|
(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))
|
||||||
,@body)
|
,@body)
|
||||||
|
@ -303,7 +303,7 @@ position of the message in the thread."
|
||||||
("multipart/alternative" ignore identity)
|
("multipart/alternative" ignore identity)
|
||||||
("multipart/mixed" ignore identity)
|
("multipart/mixed" ignore identity)
|
||||||
("multipart/related" ignore identity)
|
("multipart/related" ignore identity)
|
||||||
)))
|
)))
|
||||||
(mm-display-parts (mm-dissect-buffer)))))
|
(mm-display-parts (mm-dissect-buffer)))))
|
||||||
|
|
||||||
(defun notmuch-show-save-attachments ()
|
(defun notmuch-show-save-attachments ()
|
||||||
|
@ -406,43 +406,44 @@ operation on the contents of the current buffer."
|
||||||
cell of (AUTHOR_EMAIL AUTHOR_NAME). Return (ADDRESS nil) if
|
cell of (AUTHOR_EMAIL AUTHOR_NAME). Return (ADDRESS nil) if
|
||||||
parsing fails."
|
parsing fails."
|
||||||
(condition-case nil
|
(condition-case nil
|
||||||
(let (p-name p-address)
|
(let (p-name p-address)
|
||||||
;; It would be convenient to use `mail-header-parse-address',
|
;; It would be convenient to use `mail-header-parse-address',
|
||||||
;; but that expects un-decoded mailbox parts, whereas our
|
;; but that expects un-decoded mailbox parts, whereas our
|
||||||
;; mailbox parts are already decoded (and hence may contain
|
;; mailbox parts are already decoded (and hence may contain
|
||||||
;; UTF-8). Given that notmuch should handle most of the awkward
|
;; UTF-8). Given that notmuch should handle most of the awkward
|
||||||
;; cases, some simple string deconstruction should be sufficient
|
;; cases, some simple string deconstruction should be sufficient
|
||||||
;; here.
|
;; here.
|
||||||
(cond
|
(cond
|
||||||
;; "User <user@dom.ain>" style.
|
;; "User <user@dom.ain>" style.
|
||||||
((string-match "\\(.*\\) <\\(.*\\)>" address)
|
((string-match "\\(.*\\) <\\(.*\\)>" address)
|
||||||
(setq p-name (match-string 1 address)
|
(setq p-name (match-string 1 address)
|
||||||
p-address (match-string 2 address)))
|
p-address (match-string 2 address)))
|
||||||
;; "<user@dom.ain>" style.
|
|
||||||
((string-match "<\\(.*\\)>" address)
|
;; "<user@dom.ain>" style.
|
||||||
(setq p-address (match-string 1 address)))
|
((string-match "<\\(.*\\)>" address)
|
||||||
;; Everything else.
|
(setq p-address (match-string 1 address)))
|
||||||
(t
|
;; Everything else.
|
||||||
(setq p-address address)))
|
(t
|
||||||
(when p-name
|
(setq p-address address)))
|
||||||
;; Remove elements of the mailbox part that are not relevant for
|
(when p-name
|
||||||
;; display, even if they are required during transport:
|
;; Remove elements of the mailbox part that are not relevant for
|
||||||
;;
|
;; display, even if they are required during transport:
|
||||||
;; Backslashes.
|
;;
|
||||||
(setq p-name (replace-regexp-in-string "\\\\" "" p-name))
|
;; Backslashes.
|
||||||
;; Outer single and double quotes, which might be nested.
|
(setq p-name (replace-regexp-in-string "\\\\" "" p-name))
|
||||||
(cl-loop with start-of-loop
|
;; Outer single and double quotes, which might be nested.
|
||||||
do (setq start-of-loop p-name)
|
(cl-loop with start-of-loop
|
||||||
when (string-match "^\"\\(.*\\)\"$" p-name)
|
do (setq start-of-loop p-name)
|
||||||
do (setq p-name (match-string 1 p-name))
|
when (string-match "^\"\\(.*\\)\"$" p-name)
|
||||||
when (string-match "^'\\(.*\\)'$" p-name)
|
do (setq p-name (match-string 1 p-name))
|
||||||
do (setq p-name (match-string 1 p-name))
|
when (string-match "^'\\(.*\\)'$" p-name)
|
||||||
until (string= start-of-loop p-name)))
|
do (setq p-name (match-string 1 p-name))
|
||||||
;; If the address is 'foo@bar.com <foo@bar.com>' then show just
|
until (string= start-of-loop p-name)))
|
||||||
;; 'foo@bar.com'.
|
;; If the address is 'foo@bar.com <foo@bar.com>' then show just
|
||||||
(when (string= p-name p-address)
|
;; 'foo@bar.com'.
|
||||||
(setq p-name nil))
|
(when (string= p-name p-address)
|
||||||
(cons p-address p-name))
|
(setq p-name nil))
|
||||||
|
(cons p-address p-name))
|
||||||
(error (cons address nil))))
|
(error (cons address nil))))
|
||||||
|
|
||||||
(defun notmuch-show-clean-address (address)
|
(defun notmuch-show-clean-address (address)
|
||||||
|
@ -607,9 +608,9 @@ will return nil if the CID is unknown or cannot be retrieved."
|
||||||
"Instruct w3m how to retrieve content from a \"related\" part of a message."
|
"Instruct w3m how to retrieve content from a \"related\" part of a message."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (boundp 'w3m-cid-retrieve-function-alist)
|
(if (boundp 'w3m-cid-retrieve-function-alist)
|
||||||
(unless (assq 'notmuch-show-mode w3m-cid-retrieve-function-alist)
|
(unless (assq 'notmuch-show-mode w3m-cid-retrieve-function-alist)
|
||||||
(push (cons 'notmuch-show-mode #'notmuch-show--cid-w3m-retrieve)
|
(push (cons 'notmuch-show-mode #'notmuch-show--cid-w3m-retrieve)
|
||||||
w3m-cid-retrieve-function-alist)))
|
w3m-cid-retrieve-function-alist)))
|
||||||
(setq mm-html-inhibit-images nil))
|
(setq mm-html-inhibit-images nil))
|
||||||
|
|
||||||
(defvar w3m-current-buffer) ;; From `w3m.el'.
|
(defvar w3m-current-buffer) ;; From `w3m.el'.
|
||||||
|
@ -639,8 +640,8 @@ will return nil if the CID is unknown or cannot be retrieved."
|
||||||
;; should be chosen if there are more than one that match?
|
;; should be chosen if there are more than one that match?
|
||||||
(mapc (lambda (inner-part)
|
(mapc (lambda (inner-part)
|
||||||
(let* ((inner-type (plist-get inner-part :content-type))
|
(let* ((inner-type (plist-get inner-part :content-type))
|
||||||
(hide (not (or notmuch-show-all-multipart/alternative-parts
|
(hide (not (or notmuch-show-all-multipart/alternative-parts
|
||||||
(string= chosen-type inner-type)))))
|
(string= chosen-type inner-type)))))
|
||||||
(notmuch-show-insert-bodypart msg inner-part depth hide)))
|
(notmuch-show-insert-bodypart msg inner-part depth hide)))
|
||||||
inner-parts)
|
inner-parts)
|
||||||
|
|
||||||
|
@ -1008,7 +1009,7 @@ is t, hide the part initially and show the button."
|
||||||
;; Store the computed mime-type for later use (e.g. by attachment handlers).
|
;; Store the computed mime-type for later use (e.g. by attachment handlers).
|
||||||
(plist-put part :computed-type mime-type)
|
(plist-put part :computed-type mime-type)
|
||||||
(if show-part
|
(if show-part
|
||||||
(notmuch-show-insert-bodypart-internal msg part mime-type nth depth button)
|
(notmuch-show-insert-bodypart-internal msg part mime-type nth depth button)
|
||||||
(when button
|
(when button
|
||||||
(button-put button :notmuch-lazy-part
|
(button-put button :notmuch-lazy-part
|
||||||
(list msg part mime-type nth depth button))))
|
(list msg part mime-type nth depth button))))
|
||||||
|
@ -1521,9 +1522,9 @@ All currently available key bindings:
|
||||||
(setq buffer-read-only t
|
(setq buffer-read-only t
|
||||||
truncate-lines t)
|
truncate-lines t)
|
||||||
(setq imenu-prev-index-position-function
|
(setq imenu-prev-index-position-function
|
||||||
#'notmuch-show-imenu-prev-index-position-function)
|
#'notmuch-show-imenu-prev-index-position-function)
|
||||||
(setq imenu-extract-index-name-function
|
(setq imenu-extract-index-name-function
|
||||||
#'notmuch-show-imenu-extract-index-name-function))
|
#'notmuch-show-imenu-extract-index-name-function))
|
||||||
|
|
||||||
(defun notmuch-tree-from-show-current-query ()
|
(defun notmuch-tree-from-show-current-query ()
|
||||||
"Call notmuch tree with the current query."
|
"Call notmuch tree with the current query."
|
||||||
|
@ -1746,8 +1747,8 @@ We only mark it read once: if it is changed back then that is a
|
||||||
user decision and we should not override it."
|
user decision and we should not override it."
|
||||||
(when (and (notmuch-show-message-visible-p)
|
(when (and (notmuch-show-message-visible-p)
|
||||||
(not (notmuch-show-get-prop :seen)))
|
(not (notmuch-show-get-prop :seen)))
|
||||||
(notmuch-show-mark-read)
|
(notmuch-show-mark-read)
|
||||||
(notmuch-show-set-prop :seen t)))
|
(notmuch-show-set-prop :seen t)))
|
||||||
|
|
||||||
(defvar notmuch-show--seen-has-errored nil)
|
(defvar notmuch-show--seen-has-errored nil)
|
||||||
(make-variable-buffer-local 'notmuch-show--seen-has-errored)
|
(make-variable-buffer-local 'notmuch-show--seen-has-errored)
|
||||||
|
@ -1866,9 +1867,9 @@ any effects from previous calls to
|
||||||
(let ((start-of-message (notmuch-show-message-top))
|
(let ((start-of-message (notmuch-show-message-top))
|
||||||
(start-of-window (window-start)))
|
(start-of-window (window-start)))
|
||||||
(cond
|
(cond
|
||||||
;; Either this message is properly aligned with the start of the
|
;; Either this message is properly aligned with the start of the
|
||||||
;; window or the start of this message is not visible on the
|
;; window or the start of this message is not visible on the
|
||||||
;; screen - scroll.
|
;; screen - scroll.
|
||||||
((or (= start-of-message start-of-window)
|
((or (= start-of-message start-of-window)
|
||||||
(< start-of-message start-of-window))
|
(< start-of-message start-of-window))
|
||||||
(scroll-down)
|
(scroll-down)
|
||||||
|
@ -2512,9 +2513,9 @@ beginning of the line."
|
||||||
message."
|
message."
|
||||||
`(save-excursion
|
`(save-excursion
|
||||||
(save-restriction
|
(save-restriction
|
||||||
(let ((extent (notmuch-show-message-extent)))
|
(let ((extent (notmuch-show-message-extent)))
|
||||||
(narrow-to-region (car extent) (cdr extent))
|
(narrow-to-region (car extent) (cdr extent))
|
||||||
,@body))))
|
,@body))))
|
||||||
|
|
||||||
(defun notmuch-show--gather-urls ()
|
(defun notmuch-show--gather-urls ()
|
||||||
"Gather any URLs in the current message."
|
"Gather any URLs in the current message."
|
||||||
|
|
|
@ -236,7 +236,7 @@ DATA is the content of an SVG picture (e.g., as returned by
|
||||||
(defun notmuch-tag-star-icon ()
|
(defun notmuch-tag-star-icon ()
|
||||||
"Return SVG data representing a star icon.
|
"Return SVG data representing a star icon.
|
||||||
This can be used with `notmuch-tag-format-image-data'."
|
This can be used with `notmuch-tag-format-image-data'."
|
||||||
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>
|
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>
|
||||||
<svg version=\"1.1\" width=\"16\" height=\"16\">
|
<svg version=\"1.1\" width=\"16\" height=\"16\">
|
||||||
<g transform=\"translate(-242.81601,-315.59635)\">
|
<g transform=\"translate(-242.81601,-315.59635)\">
|
||||||
<path
|
<path
|
||||||
|
@ -536,7 +536,7 @@ and vice versa."
|
||||||
name)
|
name)
|
||||||
(mapconcat #'identity tag-change " "))))
|
(mapconcat #'identity tag-change " "))))
|
||||||
(push (list key name-string
|
(push (list key name-string
|
||||||
`(lambda () (,tag-function ',tag-change)))
|
`(lambda () (,tag-function ',tag-change)))
|
||||||
action-map)))
|
action-map)))
|
||||||
(push (list notmuch-tag-jump-reverse-key
|
(push (list notmuch-tag-jump-reverse-key
|
||||||
(if reverse
|
(if reverse
|
||||||
|
|
|
@ -245,7 +245,7 @@ This function returns a function (so can be used as a keybinding)
|
||||||
which executes function FUNC in the message pane if it is
|
which executes function FUNC in the message pane if it is
|
||||||
open (if the message pane is closed it does nothing)."
|
open (if the message pane is closed it does nothing)."
|
||||||
`(lambda ()
|
`(lambda ()
|
||||||
,(concat "(In message pane) " (documentation func t))
|
,(concat "(In message pane) " (documentation func t))
|
||||||
(interactive)
|
(interactive)
|
||||||
(when (window-live-p notmuch-tree-message-window)
|
(when (window-live-p notmuch-tree-message-window)
|
||||||
(with-selected-window notmuch-tree-message-window
|
(with-selected-window notmuch-tree-message-window
|
||||||
|
@ -273,7 +273,7 @@ This function returns a function (so can be used as a keybinding)
|
||||||
which closes the message pane if open and then executes function
|
which closes the message pane if open and then executes function
|
||||||
FUNC."
|
FUNC."
|
||||||
`(lambda ()
|
`(lambda ()
|
||||||
,(concat "(Close message pane and) " (documentation func t))
|
,(concat "(Close message pane and) " (documentation func t))
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((notmuch-show-process-crypto
|
(let ((notmuch-show-process-crypto
|
||||||
(notmuch-tree-inherit-from-message-pane 'notmuch-show-process-crypto)))
|
(notmuch-tree-inherit-from-message-pane 'notmuch-show-process-crypto)))
|
||||||
|
@ -891,31 +891,31 @@ A message tree is another name for a single sub-thread: i.e., a
|
||||||
message together with all its descendents."
|
message together with all its descendents."
|
||||||
(let ((msg (car tree))
|
(let ((msg (car tree))
|
||||||
(replies (cadr tree)))
|
(replies (cadr tree)))
|
||||||
(cond
|
(cond
|
||||||
((and (< 0 depth) (not last))
|
((and (< 0 depth) (not last))
|
||||||
(push "├" tree-status))
|
(push "├" tree-status))
|
||||||
((and (< 0 depth) last)
|
((and (< 0 depth) last)
|
||||||
(push "╰" tree-status))
|
(push "╰" tree-status))
|
||||||
((and (eq 0 depth) first last)
|
((and (eq 0 depth) first last)
|
||||||
;; Choice between these two variants is a matter of taste.
|
;; Choice between these two variants is a matter of taste.
|
||||||
;; (push "─" tree-status))
|
;; (push "─" tree-status))
|
||||||
(push " " tree-status))
|
(push " " tree-status))
|
||||||
((and (eq 0 depth) first (not last))
|
((and (eq 0 depth) first (not last))
|
||||||
(push "┬" tree-status))
|
(push "┬" tree-status))
|
||||||
((and (eq 0 depth) (not first) last)
|
((and (eq 0 depth) (not first) last)
|
||||||
(push "╰" tree-status))
|
(push "╰" tree-status))
|
||||||
((and (eq 0 depth) (not first) (not last))
|
((and (eq 0 depth) (not first) (not last))
|
||||||
(push "├" tree-status)))
|
(push "├" tree-status)))
|
||||||
(push (concat (if replies "┬" "─") "►") tree-status)
|
(push (concat (if replies "┬" "─") "►") tree-status)
|
||||||
(setq msg (plist-put msg :first (and first (eq 0 depth))))
|
(setq msg (plist-put msg :first (and first (eq 0 depth))))
|
||||||
(setq msg (plist-put msg :tree-status tree-status))
|
(setq msg (plist-put msg :tree-status tree-status))
|
||||||
(setq msg (plist-put msg :orig-tags (plist-get msg :tags)))
|
(setq msg (plist-put msg :orig-tags (plist-get msg :tags)))
|
||||||
(notmuch-tree-goto-and-insert-msg msg)
|
(notmuch-tree-goto-and-insert-msg msg)
|
||||||
(pop tree-status)
|
(pop tree-status)
|
||||||
(pop tree-status)
|
(pop tree-status)
|
||||||
(if last
|
(if last
|
||||||
(push " " tree-status)
|
(push " " tree-status)
|
||||||
(push "│" tree-status))
|
(push "│" tree-status))
|
||||||
(notmuch-tree-insert-thread replies (1+ depth) tree-status)))
|
(notmuch-tree-insert-thread replies (1+ depth) tree-status)))
|
||||||
|
|
||||||
(defun notmuch-tree-insert-thread (thread depth tree-status)
|
(defun notmuch-tree-insert-thread (thread depth tree-status)
|
||||||
|
@ -966,34 +966,34 @@ Complete list of currently available key bindings:
|
||||||
(exit-status (process-exit-status proc))
|
(exit-status (process-exit-status proc))
|
||||||
(never-found-target-thread nil))
|
(never-found-target-thread nil))
|
||||||
(when (memq status '(exit signal))
|
(when (memq status '(exit signal))
|
||||||
(kill-buffer (process-get proc 'parse-buf))
|
(kill-buffer (process-get proc 'parse-buf))
|
||||||
(if (buffer-live-p buffer)
|
(if (buffer-live-p buffer)
|
||||||
(with-current-buffer buffer
|
(with-current-buffer buffer
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(let ((inhibit-read-only t)
|
(let ((inhibit-read-only t)
|
||||||
(atbob (bobp)))
|
(atbob (bobp)))
|
||||||
(goto-char (point-max))
|
(goto-char (point-max))
|
||||||
(if (eq status 'signal)
|
(if (eq status 'signal)
|
||||||
(insert "Incomplete search results (tree view process was killed).\n"))
|
(insert "Incomplete search results (tree view process was killed).\n"))
|
||||||
(when (eq status 'exit)
|
(when (eq status 'exit)
|
||||||
(insert "End of search results.")
|
(insert "End of search results.")
|
||||||
(unless (= exit-status 0)
|
(unless (= exit-status 0)
|
||||||
(insert (format " (process returned %d)" exit-status)))
|
(insert (format " (process returned %d)" exit-status)))
|
||||||
(insert "\n")))))))))
|
(insert "\n")))))))))
|
||||||
|
|
||||||
(defun notmuch-tree-process-filter (proc string)
|
(defun notmuch-tree-process-filter (proc string)
|
||||||
"Process and filter the output of \"notmuch show\" for tree view."
|
"Process and filter the output of \"notmuch show\" for tree view."
|
||||||
(let ((results-buf (process-buffer proc))
|
(let ((results-buf (process-buffer proc))
|
||||||
(parse-buf (process-get proc 'parse-buf))
|
(parse-buf (process-get proc 'parse-buf))
|
||||||
(inhibit-read-only t)
|
(inhibit-read-only t)
|
||||||
done)
|
done)
|
||||||
(if (not (buffer-live-p results-buf))
|
(if (not (buffer-live-p results-buf))
|
||||||
(delete-process proc)
|
(delete-process proc)
|
||||||
(with-current-buffer parse-buf
|
(with-current-buffer parse-buf
|
||||||
;; Insert new data
|
;; Insert new data
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (point-max))
|
(goto-char (point-max))
|
||||||
(insert string))
|
(insert string))
|
||||||
(notmuch-sexp-parse-partial-list 'notmuch-tree-insert-forest-thread
|
(notmuch-sexp-parse-partial-list 'notmuch-tree-insert-forest-thread
|
||||||
results-buf)))))
|
results-buf)))))
|
||||||
|
|
||||||
|
@ -1020,8 +1020,8 @@ the same as for the function notmuch-tree."
|
||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(let* ((search-args (concat basic-query
|
(let* ((search-args (concat basic-query
|
||||||
(if query-context (concat " and (" query-context ")"))
|
(if query-context (concat " and (" query-context ")"))
|
||||||
))
|
))
|
||||||
(message-arg (if unthreaded "--unthreaded" "--entire-thread")))
|
(message-arg (if unthreaded "--unthreaded" "--entire-thread")))
|
||||||
(if (equal (car (process-lines notmuch-command "count" search-args)) "0")
|
(if (equal (car (process-lines notmuch-command "count" search-args)) "0")
|
||||||
(setq search-args basic-query))
|
(setq search-args basic-query))
|
||||||
|
|
|
@ -373,7 +373,7 @@ style prefix in SUBJECT, or nil if such a prefix can't be found."
|
||||||
(when (string-match
|
(when (string-match
|
||||||
"^ *\\(\\[[^]]*\\] *\\)*\\[[^]]*?\\([0-9]+\\)/[0-9]+[^]]*\\].*"
|
"^ *\\(\\[[^]]*\\] *\\)*\\[[^]]*?\\([0-9]+\\)/[0-9]+[^]]*\\].*"
|
||||||
subject)
|
subject)
|
||||||
(string-to-number (substring subject (match-beginning 2) (match-end 2)))))
|
(string-to-number (substring subject (match-beginning 2) (match-end 2)))))
|
||||||
|
|
||||||
(defun notmuch-wash-subject-to-patch-filename (subject)
|
(defun notmuch-wash-subject-to-patch-filename (subject)
|
||||||
"Convert a patch mail SUBJECT into a filename.
|
"Convert a patch mail SUBJECT into a filename.
|
||||||
|
|
|
@ -117,23 +117,23 @@ there will be called at other points of notmuch execution."
|
||||||
|
|
||||||
(defun notmuch-foreach-mime-part (function mm-handle)
|
(defun notmuch-foreach-mime-part (function mm-handle)
|
||||||
(cond ((stringp (car mm-handle))
|
(cond ((stringp (car mm-handle))
|
||||||
(dolist (part (cdr mm-handle))
|
(dolist (part (cdr mm-handle))
|
||||||
(notmuch-foreach-mime-part function part)))
|
(notmuch-foreach-mime-part function part)))
|
||||||
((bufferp (car mm-handle))
|
((bufferp (car mm-handle))
|
||||||
(funcall function mm-handle))
|
(funcall function mm-handle))
|
||||||
(t (dolist (part mm-handle)
|
(t (dolist (part mm-handle)
|
||||||
(notmuch-foreach-mime-part function part)))))
|
(notmuch-foreach-mime-part function part)))))
|
||||||
|
|
||||||
(defun notmuch-count-attachments (mm-handle)
|
(defun notmuch-count-attachments (mm-handle)
|
||||||
(let ((count 0))
|
(let ((count 0))
|
||||||
(notmuch-foreach-mime-part
|
(notmuch-foreach-mime-part
|
||||||
(lambda (p)
|
(lambda (p)
|
||||||
(let ((disposition (mm-handle-disposition p)))
|
(let ((disposition (mm-handle-disposition p)))
|
||||||
(and (listp disposition)
|
(and (listp disposition)
|
||||||
(or (equal (car disposition) "attachment")
|
(or (equal (car disposition) "attachment")
|
||||||
(and (equal (car disposition) "inline")
|
(and (equal (car disposition) "inline")
|
||||||
(assq 'filename disposition)))
|
(assq 'filename disposition)))
|
||||||
(cl-incf count))))
|
(cl-incf count))))
|
||||||
mm-handle)
|
mm-handle)
|
||||||
count))
|
count))
|
||||||
|
|
||||||
|
@ -142,13 +142,13 @@ there will be called at other points of notmuch execution."
|
||||||
(lambda (p)
|
(lambda (p)
|
||||||
(let ((disposition (mm-handle-disposition p)))
|
(let ((disposition (mm-handle-disposition p)))
|
||||||
(and (listp disposition)
|
(and (listp disposition)
|
||||||
(or (equal (car disposition) "attachment")
|
(or (equal (car disposition) "attachment")
|
||||||
(and (equal (car disposition) "inline")
|
(and (equal (car disposition) "inline")
|
||||||
(assq 'filename disposition)))
|
(assq 'filename disposition)))
|
||||||
(or (not queryp)
|
(or (not queryp)
|
||||||
(y-or-n-p
|
(y-or-n-p
|
||||||
(concat "Save '" (cdr (assq 'filename disposition)) "' ")))
|
(concat "Save '" (cdr (assq 'filename disposition)) "' ")))
|
||||||
(mm-save-part p))))
|
(mm-save-part p))))
|
||||||
mm-handle))
|
mm-handle))
|
||||||
|
|
||||||
(require 'hl-line)
|
(require 'hl-line)
|
||||||
|
@ -272,11 +272,11 @@ there will be called at other points of notmuch execution."
|
||||||
(goto-char (point-min)))
|
(goto-char (point-min)))
|
||||||
|
|
||||||
(defface notmuch-message-summary-face
|
(defface notmuch-message-summary-face
|
||||||
'((((class color) (background light)) (:background "#f0f0f0"))
|
'((((class color) (background light)) (:background "#f0f0f0"))
|
||||||
(((class color) (background dark)) (:background "#303030")))
|
(((class color) (background dark)) (:background "#303030")))
|
||||||
"Face for the single-line message summary in notmuch-show-mode."
|
"Face for the single-line message summary in notmuch-show-mode."
|
||||||
:group 'notmuch-show
|
:group 'notmuch-show
|
||||||
:group 'notmuch-faces)
|
:group 'notmuch-faces)
|
||||||
|
|
||||||
(defface notmuch-search-date
|
(defface notmuch-search-date
|
||||||
'((t :inherit default))
|
'((t :inherit default))
|
||||||
|
@ -392,9 +392,9 @@ Complete list of currently available key bindings:
|
||||||
(setq truncate-lines t)
|
(setq truncate-lines t)
|
||||||
(setq buffer-read-only t)
|
(setq buffer-read-only t)
|
||||||
(setq imenu-prev-index-position-function
|
(setq imenu-prev-index-position-function
|
||||||
#'notmuch-search-imenu-prev-index-position-function)
|
#'notmuch-search-imenu-prev-index-position-function)
|
||||||
(setq imenu-extract-index-name-function
|
(setq imenu-extract-index-name-function
|
||||||
#'notmuch-search-imenu-extract-index-name-function))
|
#'notmuch-search-imenu-extract-index-name-function))
|
||||||
|
|
||||||
(defun notmuch-search-get-result (&optional pos)
|
(defun notmuch-search-get-result (&optional pos)
|
||||||
"Return the result object for the thread at POS (or point).
|
"Return the result object for the thread at POS (or point).
|
||||||
|
@ -689,9 +689,9 @@ of the result."
|
||||||
(not (string= notmuch-search-target-thread "found")))
|
(not (string= notmuch-search-target-thread "found")))
|
||||||
(set 'never-found-target-thread t)))))
|
(set 'never-found-target-thread t)))))
|
||||||
(when (and never-found-target-thread
|
(when (and never-found-target-thread
|
||||||
notmuch-search-target-line)
|
notmuch-search-target-line)
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(forward-line (1- notmuch-search-target-line)))))))))
|
(forward-line (1- notmuch-search-target-line)))))))))
|
||||||
|
|
||||||
(define-widget 'notmuch--custom-face-edit 'lazy
|
(define-widget 'notmuch--custom-face-edit 'lazy
|
||||||
"Custom face edit with a tag Edit Face"
|
"Custom face edit with a tag Edit Face"
|
||||||
|
@ -711,7 +711,7 @@ Here is an example of how to color search results based on tags.
|
||||||
(the following text would be placed in your ~/.emacs file):
|
(the following text would be placed in your ~/.emacs file):
|
||||||
|
|
||||||
(setq notmuch-search-line-faces \\='((\"unread\" . (:foreground \"green\"))
|
(setq notmuch-search-line-faces \\='((\"unread\" . (:foreground \"green\"))
|
||||||
(\"deleted\" . (:foreground \"red\"
|
(\"deleted\" . (:foreground \"red\"
|
||||||
:background \"blue\"))))
|
:background \"blue\"))))
|
||||||
|
|
||||||
The FACE must be a face name (a symbol or string), a property
|
The FACE must be a face name (a symbol or string), a property
|
||||||
|
@ -722,7 +722,7 @@ the above settings would have a green foreground and blue
|
||||||
background."
|
background."
|
||||||
:type '(alist :key-type (string)
|
:type '(alist :key-type (string)
|
||||||
:value-type (radio (face :tag "Face name")
|
:value-type (radio (face :tag "Face name")
|
||||||
(notmuch--custom-face-edit)))
|
(notmuch--custom-face-edit)))
|
||||||
:group 'notmuch-search
|
:group 'notmuch-search
|
||||||
:group 'notmuch-faces)
|
:group 'notmuch-faces)
|
||||||
|
|
||||||
|
@ -919,15 +919,15 @@ See `notmuch-tag' for information on the format of TAG-CHANGES."
|
||||||
PROMPT is the string to prompt with."
|
PROMPT is the string to prompt with."
|
||||||
(let*
|
(let*
|
||||||
((all-tags
|
((all-tags
|
||||||
(mapcar (lambda (tag) (notmuch-escape-boolean-term tag))
|
(mapcar (lambda (tag) (notmuch-escape-boolean-term tag))
|
||||||
(process-lines notmuch-command "search" "--output=tags" "*")))
|
(process-lines notmuch-command "search" "--output=tags" "*")))
|
||||||
(completions
|
(completions
|
||||||
(append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
|
(append (list "folder:" "path:" "thread:" "id:" "date:" "from:" "to:"
|
||||||
"subject:" "attachment:")
|
"subject:" "attachment:")
|
||||||
(mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
|
(mapcar (lambda (tag) (concat "tag:" tag)) all-tags)
|
||||||
(mapcar (lambda (tag) (concat "is:" tag)) all-tags)
|
(mapcar (lambda (tag) (concat "is:" tag)) all-tags)
|
||||||
(mapcar (lambda (mimetype) (concat "mimetype:" mimetype))
|
(mapcar (lambda (mimetype) (concat "mimetype:" mimetype))
|
||||||
(mailcap-mime-types)))))
|
(mailcap-mime-types)))))
|
||||||
(let ((keymap (copy-keymap minibuffer-local-map))
|
(let ((keymap (copy-keymap minibuffer-local-map))
|
||||||
(current-query (cl-case major-mode
|
(current-query (cl-case major-mode
|
||||||
(notmuch-search-mode (notmuch-search-get-query))
|
(notmuch-search-mode (notmuch-search-get-query))
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
(defun notmuch-test-address-cleaning-1 ()
|
(defun notmuch-test-address-cleaning-1 ()
|
||||||
(notmuch-test-expect-equal (notmuch-show-clean-address "dme@dme.org")
|
(notmuch-test-expect-equal (notmuch-show-clean-address "dme@dme.org")
|
||||||
"dme@dme.org"))
|
"dme@dme.org"))
|
||||||
|
|
||||||
(defun notmuch-test-address-cleaning-2 ()
|
(defun notmuch-test-address-cleaning-2 ()
|
||||||
(let* ((input '("foo@bar.com"
|
(let* ((input '("foo@bar.com"
|
||||||
|
|
Loading…
Reference in a new issue