mirror of https://github.com/djcb/mu.git
mu4e-actions: fix whitespace, flycheck warnings
This commit is contained in:
parent
da1cb4e97b
commit
e9970fb890
|
@ -1,6 +1,6 @@
|
|||
;;; mu4e-actions.el -- part of mu4e, the mu mail user agent
|
||||
;;
|
||||
;; Copyright (C) 2011-2017 Dirk-Jan C. Binnema
|
||||
;; Copyright (C) 2011-2019 Dirk-Jan C. Binnema
|
||||
|
||||
;; Author: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||
;; Maintainer: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||
|
@ -37,7 +37,7 @@
|
|||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(defun mu4e-action-count-lines (msg)
|
||||
"Count the number of lines in the e-mail message.
|
||||
"Count the number of lines in the e-mail MSG.
|
||||
Works for headers view and message-view."
|
||||
(message "Number of lines: %s"
|
||||
(shell-command-to-string
|
||||
|
@ -54,10 +54,10 @@ Works for headers view and message-view."
|
|||
"Path to the msg2pdf toy.")
|
||||
|
||||
(defun mu4e-action-view-as-pdf (msg)
|
||||
"Convert the message to pdf, then show it.
|
||||
"Convert MSG to pdf, then show it.
|
||||
Works for the message view."
|
||||
(unless (file-executable-p mu4e-msg2pdf)
|
||||
(mu4e-error "msg2pdf not found; please set `mu4e-msg2pdf'"))
|
||||
(mu4e-error "Program msg2pdf not found; please set `mu4e-msg2pdf'"))
|
||||
(let* ((pdf
|
||||
(shell-command-to-string
|
||||
(concat mu4e-msg2pdf " "
|
||||
|
@ -72,7 +72,7 @@ Works for the message view."
|
|||
|
||||
|
||||
(defun mu4e~write-body-to-html (msg)
|
||||
"Write the body (either html or text) to a temporary file;
|
||||
"Write MSG's body (either html or text) to a temporary file;
|
||||
return the filename."
|
||||
(let* ((html (mu4e-message-field msg :body-html))
|
||||
(txt (mu4e-message-field msg :body-txt))
|
||||
|
@ -116,7 +116,7 @@ return the filename."
|
|||
tmpfile)))
|
||||
|
||||
(defun mu4e-action-view-in-browser (msg)
|
||||
"View the body of the message in a browser.
|
||||
"View the body of MSG in a web browser.
|
||||
You can influence the browser to use with the variable
|
||||
`browse-url-generic-program', and see the discussion of privacy
|
||||
aspects in `(mu4e) Displaying rich-text messages'."
|
||||
|
@ -124,9 +124,9 @@ aspects in `(mu4e) Displaying rich-text messages'."
|
|||
(mu4e~write-body-to-html msg))))
|
||||
|
||||
(defun mu4e-action-view-with-xwidget (msg)
|
||||
"View the body of the message inside xwidget-webkit. This is
|
||||
only available in emacs 25+; also see the discussion of privacy
|
||||
aspects in `(mu4e) Displaying rich-text messages'."
|
||||
"View the body of MSG inside xwidget-webkit.
|
||||
This is only available in Emacs 25+; also see the discussion of
|
||||
privacy aspects in `(mu4e) Displaying rich-text messages'."
|
||||
(unless (fboundp 'xwidget-webkit-browse-url)
|
||||
(mu4e-error "No xwidget support available"))
|
||||
(xwidget-webkit-browse-url
|
||||
|
@ -138,10 +138,10 @@ aspects in `(mu4e) Displaying rich-text messages'."
|
|||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(defconst mu4e-text2speech-command "festival --tts"
|
||||
"Program that speaks out text it receives on standard-input.")
|
||||
"Program that speaks out text it receives on standard input.")
|
||||
|
||||
(defun mu4e-action-message-to-speech (msg)
|
||||
"Pronounce the message text using `mu4e-text2speech-command'."
|
||||
"Pronounce MSG's body text using `mu4e-text2speech-command'."
|
||||
(unless (mu4e-message-field msg :body-txt)
|
||||
(mu4e-warn "No text body for this message"))
|
||||
(with-temp-buffer
|
||||
|
@ -151,18 +151,15 @@ aspects in `(mu4e) Displaying rich-text messages'."
|
|||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(defvar mu4e-captured-message nil
|
||||
"The last-captured message (the s-expression).")
|
||||
"The most recently captured message.")
|
||||
|
||||
(defun mu4e-action-capture-message (msg)
|
||||
"Remember MSG; we can create a an attachment based on this msg
|
||||
with `mu4e-compose-attach-captured-message'."
|
||||
"Remember MSG.
|
||||
Later, we can create an attachment based on this message with
|
||||
`mu4e-compose-attach-captured-message'."
|
||||
(setq mu4e-captured-message msg)
|
||||
(message "Message has been captured"))
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
@ -171,13 +168,10 @@ with `mu4e-compose-attach-captured-message'."
|
|||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(defun mu4e-action-copy-message-file-path (msg)
|
||||
"Save the full path the message file for the current message to
|
||||
the kill-ring."
|
||||
"Save the full path for the current MSG to the kill ring."
|
||||
(kill-new (mu4e-message-field msg :path)))
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(defvar mu4e-org-contacts-file nil
|
||||
|
@ -189,14 +183,13 @@ Needed by `mu4e-action-add-org-contact'.")
|
|||
(defvar org-capture-templates nil)))
|
||||
|
||||
(defun mu4e-action-add-org-contact (msg)
|
||||
"Add an org-contact entry based on the From: address of the
|
||||
current message (in headers or view). You need to set
|
||||
`mu4e-org-contacts-file' to the full path to the file where you
|
||||
store your org-contacts."
|
||||
"Add an org-contact based on the sender ddress of the current MSG.
|
||||
You need to set `mu4e-org-contacts-file' to the full path to the
|
||||
file where you store your org-contacts."
|
||||
(unless (require 'org-capture nil 'noerror)
|
||||
(mu4e-error "org-capture is not available."))
|
||||
(mu4e-error "Feature org-capture is not available"))
|
||||
(unless mu4e-org-contacts-file
|
||||
(mu4e-error "`mu4e-org-contacts-file' is not defined."))
|
||||
(mu4e-error "Variable `mu4e-org-contacts-file' is nil"))
|
||||
(let* ((sender (car-safe (mu4e-message-field msg :from)))
|
||||
(name (car-safe sender)) (email (cdr-safe sender))
|
||||
(blurb
|
||||
|
@ -268,19 +261,17 @@ bother asking for the git tree again (useful for bulk actions)."
|
|||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
(defvar mu4e-action-tags-header "X-Keywords"
|
||||
"Header where tags are stored. Used by `mu4e-action-retag-message'.
|
||||
Make sure it is one of the headers mu recognizes for storing
|
||||
tags: X-Keywords, X-Label, Keywords. Also note that changing
|
||||
this setting on already tagged messages can lead to messages
|
||||
with multiple tags headers.")
|
||||
"Header where tags are stored.
|
||||
Used by `mu4e-action-retag-message'. Make sure it is one of the
|
||||
headers mu recognizes for storing tags: X-Keywords, X-Label,
|
||||
Keywords. Also note that changing this setting on already tagged
|
||||
messages can lead to messages with multiple tags headers.")
|
||||
|
||||
(defvar mu4e-action-tags-completion-list '()
|
||||
"List of tags to show for autocompletion in
|
||||
`mu4e-action-retag-message'.")
|
||||
"List of tags for completion in `mu4e-action-retag-message'.")
|
||||
|
||||
(defun mu4e~contains-line-matching (regexp path)
|
||||
"Determine whether the file at path contains a line matching
|
||||
the given regexp."
|
||||
"Does file at PATH contain a line matching the given REGEXP?"
|
||||
(with-temp-buffer
|
||||
(insert-file-contents path)
|
||||
(save-excursion
|
||||
|
@ -290,8 +281,7 @@ bother asking for the git tree again (useful for bulk actions)."
|
|||
nil))))
|
||||
|
||||
(defun mu4e~replace-first-line-matching (regexp to-string path)
|
||||
"Replace the first line in the file at path that matches regexp
|
||||
with the string replace."
|
||||
"Replace first line matching REGEXP in PATH with TO-STRING."
|
||||
(with-temp-file path
|
||||
(insert-file-contents path)
|
||||
(save-excursion
|
||||
|
@ -300,11 +290,11 @@ bother asking for the git tree again (useful for bulk actions)."
|
|||
(replace-match to-string nil nil)))))
|
||||
|
||||
(defun mu4e-action-retag-message (msg &optional retag-arg)
|
||||
"Change tags of a message. Accepts a comma-separated list of
|
||||
additions and removals.
|
||||
"Change tags of MSG with RETAG-ARG.
|
||||
|
||||
RETAG-ARG is a comma-separated list of additions and removals.
|
||||
|
||||
Example: +tag,+long tag,-oldtag
|
||||
|
||||
would add 'tag' and 'long tag', and remove 'oldtag'."
|
||||
(let* (
|
||||
(path (mu4e-message-field msg :path))
|
||||
|
@ -357,10 +347,10 @@ bother asking for the git tree again (useful for bulk actions)."
|
|||
(mu4e-refresh-message path maildir)))
|
||||
|
||||
(defun mu4e-action-show-thread (msg)
|
||||
"Show all messages that are in the same thread as the message
|
||||
at point. Point remains on the message with the message-id where
|
||||
the action was invoked. If invoked in view-mode, continue to
|
||||
display the message."
|
||||
"Show thread for message at point with point remaining on MSG.
|
||||
I.e., point remains on the message with the message-id where the
|
||||
action was invoked. If invoked in view mode, continue to display
|
||||
the message."
|
||||
(let ((msgid (mu4e-message-field msg :message-id)))
|
||||
(when msgid
|
||||
(let ((mu4e-headers-show-threads t)
|
||||
|
@ -372,5 +362,5 @@ display the message."
|
|||
(not (eq mu4e-split-view 'single-window))))))))
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
||||
(provide 'mu4e-actions)
|
||||
;;; mu4e-actions.el ends here
|
||||
|
|
Loading…
Reference in New Issue