mu4e: cosmetic
Clear up some overly long lines.
This commit is contained in:
@ -58,28 +58,28 @@ Works for the message view."
|
|||||||
(unless (file-executable-p mu4e-msg2pdf)
|
(unless (file-executable-p mu4e-msg2pdf)
|
||||||
(mu4e-error "msg2pdf not found; please set `mu4e-msg2pdf'"))
|
(mu4e-error "msg2pdf not found; please set `mu4e-msg2pdf'"))
|
||||||
(let* ((pdf
|
(let* ((pdf
|
||||||
(shell-command-to-string
|
(shell-command-to-string
|
||||||
(concat mu4e-msg2pdf " "
|
(concat mu4e-msg2pdf " "
|
||||||
(shell-quote-argument (mu4e-message-field msg :path))
|
(shell-quote-argument (mu4e-message-field msg :path))
|
||||||
" 2> /dev/null")))
|
" 2> /dev/null")))
|
||||||
(pdf (and pdf (> (length pdf) 5)
|
(pdf (and pdf (> (length pdf) 5)
|
||||||
(substring pdf 0 -1)))) ;; chop \n
|
(substring pdf 0 -1)))) ;; chop \n
|
||||||
(unless (and pdf (file-exists-p pdf))
|
(unless (and pdf (file-exists-p pdf))
|
||||||
(mu4e-warn "Failed to create PDF file"))
|
(mu4e-warn "Failed to create PDF file"))
|
||||||
(find-file pdf)))
|
(find-file pdf)))
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
|
||||||
(defun mu4e~write-body-to-html (msg)
|
(defun mu4e~write-body-to-html (msg)
|
||||||
"Write the body (either html or text) to a temporary file;
|
"Write the body (either html or text) to a temporary file;
|
||||||
return the filename."
|
return the filename."
|
||||||
(let* ((html (mu4e-message-field msg :body-html))
|
(let* ((html (mu4e-message-field msg :body-html))
|
||||||
(txt (mu4e-message-field msg :body-txt))
|
(txt (mu4e-message-field msg :body-txt))
|
||||||
(tmpfile (mu4e-make-temp-file "html"))
|
(tmpfile (mu4e-make-temp-file "html"))
|
||||||
(attachments (remove-if (lambda (part)
|
(attachments (remove-if (lambda (part)
|
||||||
(or (null (plist-get part :attachment))
|
(or (null (plist-get part :attachment))
|
||||||
(null (plist-get part :cid))))
|
(null (plist-get part :cid))))
|
||||||
(mu4e-message-field msg :parts))))
|
(mu4e-message-field msg :parts))))
|
||||||
(unless (or html txt)
|
(unless (or html txt)
|
||||||
(mu4e-error "No body part for this message"))
|
(mu4e-error "No body part for this message"))
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
@ -89,14 +89,19 @@ return the filename."
|
|||||||
;; rewrite attachment urls
|
;; rewrite attachment urls
|
||||||
(mapc (lambda (attachment)
|
(mapc (lambda (attachment)
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(while (re-search-forward (format "src=\"cid:%s\"" (plist-get attachment :cid)) nil t)
|
(while (re-search-forward (format "src=\"cid:%s\""
|
||||||
|
(plist-get attachment :cid)) nil t)
|
||||||
(if (plist-get attachment :temp)
|
(if (plist-get attachment :temp)
|
||||||
(replace-match (format "src=\"%s\"" (plist-get attachment :temp)))
|
(replace-match (format "src=\"%s\"" (plist-get attachment :temp)))
|
||||||
(replace-match (format "src=\"%s%s\"" temporary-file-directory (plist-get attachment :name)))
|
(replace-match (format "src=\"%s%s\"" temporary-file-directory
|
||||||
(let ((tmp-attachment-name (format "%s%s" temporary-file-directory (plist-get attachment :name))))
|
(plist-get attachment :name)))
|
||||||
(mu4e~proc-extract 'save (mu4e-message-field msg :docid) (plist-get attachment :index) mu4e-decryption-policy tmp-attachment-name)
|
(let ((tmp-attachment-name (format "%s%s" temporary-file-directory
|
||||||
|
(plist-get attachment :name))))
|
||||||
|
(mu4e~proc-extract 'save (mu4e-message-field msg :docid)
|
||||||
|
(plist-get attachment :index)
|
||||||
|
mu4e-decryption-policy tmp-attachment-name)
|
||||||
(mu4e-remove-file-later tmp-attachment-name)))))
|
(mu4e-remove-file-later tmp-attachment-name)))))
|
||||||
attachments)
|
attachments)
|
||||||
(save-buffer)
|
(save-buffer)
|
||||||
tmpfile)))
|
tmpfile)))
|
||||||
|
|
||||||
@ -120,7 +125,7 @@ aspects in `(mu4e) Displaying rich-text messages'."
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
(defconst mu4e-text2speech-command "festival --tts"
|
(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.")
|
||||||
@ -201,10 +206,10 @@ store your org-contacts."
|
|||||||
(defun mu4e-action-git-apply-patch (msg)
|
(defun mu4e-action-git-apply-patch (msg)
|
||||||
"Apply the git [patch] message."
|
"Apply the git [patch] message."
|
||||||
(let ((path (ido-read-directory-name "Target directory: "
|
(let ((path (ido-read-directory-name "Target directory: "
|
||||||
(car ido-work-directory-list)
|
(car ido-work-directory-list)
|
||||||
"~/" t)))
|
"~/" t)))
|
||||||
(setf ido-work-directory-list
|
(setf ido-work-directory-list
|
||||||
(cons path (delete path ido-work-directory-list)))
|
(cons path (delete path ido-work-directory-list)))
|
||||||
(shell-command
|
(shell-command
|
||||||
(format "cd %s; git apply %s"
|
(format "cd %s; git apply %s"
|
||||||
path
|
path
|
||||||
@ -219,14 +224,14 @@ bother asking for the git tree again (useful for bulk actions)."
|
|||||||
(let ((cwd (car ido-work-directory-list)))
|
(let ((cwd (car ido-work-directory-list)))
|
||||||
(unless (and (stringp cwd) (string= default-directory cwd))
|
(unless (and (stringp cwd) (string= default-directory cwd))
|
||||||
(setq cwd (ido-read-directory-name "Target directory: "
|
(setq cwd (ido-read-directory-name "Target directory: "
|
||||||
cwd
|
cwd
|
||||||
"~/" t))
|
"~/" t))
|
||||||
(setf ido-work-directory-list
|
(setf ido-work-directory-list
|
||||||
(cons cwd (delete cwd ido-work-directory-list))))
|
(cons cwd (delete cwd ido-work-directory-list))))
|
||||||
(shell-command
|
(shell-command
|
||||||
(format "cd %s; git am %s"
|
(format "cd %s; git am %s"
|
||||||
(shell-quote-argument cwd)
|
(shell-quote-argument cwd)
|
||||||
(shell-quote-argument (mu4e-message-field msg :path))))))
|
(shell-quote-argument (mu4e-message-field msg :path))))))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
@ -273,16 +278,19 @@ bother asking for the git tree again (useful for bulk actions)."
|
|||||||
|
|
||||||
would add 'tag' and 'long tag', and remove 'oldtag'."
|
would add 'tag' and 'long tag', and remove 'oldtag'."
|
||||||
(let* (
|
(let* (
|
||||||
(path (mu4e-message-field msg :path))
|
(path (mu4e-message-field msg :path))
|
||||||
(maildir (mu4e-message-field msg :maildir))
|
(maildir (mu4e-message-field msg :maildir))
|
||||||
(oldtags (mu4e-message-field msg :tags))
|
(oldtags (mu4e-message-field msg :tags))
|
||||||
(tags-completion (append
|
(tags-completion
|
||||||
mu4e-action-tags-completion-list
|
(append
|
||||||
(mapcar (lambda (tag) (format "+%s" tag)) mu4e-action-tags-completion-list)
|
mu4e-action-tags-completion-list
|
||||||
(mapcar (lambda (tag) (format "-%s" tag)) oldtags)))
|
(mapcar (lambda (tag) (format "+%s" tag))
|
||||||
(retag (if retag-arg
|
mu4e-action-tags-completion-list)
|
||||||
(split-string retag-arg ",")
|
(mapcar (lambda (tag) (format "-%s" tag))
|
||||||
(completing-read-multiple "Tags: " tags-completion)))
|
oldtags)))
|
||||||
|
(retag (if retag-arg
|
||||||
|
(split-string retag-arg ",")
|
||||||
|
(completing-read-multiple "Tags: " tags-completion)))
|
||||||
(header mu4e-action-tags-header)
|
(header mu4e-action-tags-header)
|
||||||
(sep (cond ((string= header "Keywords") ", ")
|
(sep (cond ((string= header "Keywords") ", ")
|
||||||
((string= header "X-Label") " ")
|
((string= header "X-Label") " ")
|
||||||
@ -314,7 +322,7 @@ bother asking for the git tree again (useful for bulk actions)."
|
|||||||
(mu4e~replace-first-line-matching
|
(mu4e~replace-first-line-matching
|
||||||
(concat header ":.*")
|
(concat header ":.*")
|
||||||
(concat header ": " tagstr)
|
(concat header ": " tagstr)
|
||||||
path))
|
path))
|
||||||
|
|
||||||
(mu4e-message (concat "tagging: " (mapconcat 'identity taglist ", ")))
|
(mu4e-message (concat "tagging: " (mapconcat 'identity taglist ", ")))
|
||||||
(mu4e-refresh-message path maildir)))
|
(mu4e-refresh-message path maildir)))
|
||||||
@ -329,9 +337,9 @@ display the message."
|
|||||||
(let ((mu4e-headers-show-threads t)
|
(let ((mu4e-headers-show-threads t)
|
||||||
(mu4e-headers-include-related t))
|
(mu4e-headers-include-related t))
|
||||||
(mu4e-headers-search
|
(mu4e-headers-search
|
||||||
(format "msgid:%s" msgid)
|
(format "msgid:%s" msgid)
|
||||||
nil nil nil
|
nil nil nil
|
||||||
msgid (eq major-mode 'mu4e-view-mode))))))
|
msgid (eq major-mode 'mu4e-view-mode))))))
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user