From f002379a87f192b291092ebbd2f17b180a58d6cf Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sun, 7 Mar 2021 22:03:36 +0200 Subject: [PATCH] mu: move mu-view-fields to mu-view.el We need it in both mu-view-old and mu-view-gnus. --- mu4e/mu4e-view-gnus.el | 62 ------------------------------------------ mu4e/mu4e-view-old.el | 9 ------ mu4e/mu4e-view.el | 8 ++++++ 3 files changed, 8 insertions(+), 71 deletions(-) diff --git a/mu4e/mu4e-view-gnus.el b/mu4e/mu4e-view-gnus.el index 63132ba1..ee0a4022 100644 --- a/mu4e/mu4e-view-gnus.el +++ b/mu4e/mu4e-view-gnus.el @@ -87,68 +87,6 @@ found." field (cdr item))))) (funcall func msg))) -(defun mu4e-view-message-text (msg) - "Return the message to display (as a string), based on the MSG plist." - (concat - (mapconcat - (lambda (field) - (let ((fieldval (mu4e-message-field msg field))) - (cl-case field - (:subject (mu4e~view-construct-header field fieldval)) - (:path (mu4e~view-construct-header field fieldval)) - (:maildir (mu4e~view-construct-header field fieldval)) - (:user-agent (mu4e~view-construct-header field fieldval)) - ((:flags :tags) (mu4e~view-construct-flags-tags-header - field fieldval)) - - ;; contact fields - (:to (mu4e~view-construct-contacts-header msg field)) - (:from (mu4e~view-construct-contacts-header msg field)) - (:cc (mu4e~view-construct-contacts-header msg field)) - (:bcc (mu4e~view-construct-contacts-header msg field)) - - ;; if we (`user-mail-address' are the From, show To, otherwise, - ;; show From - (:from-or-to - (let* ((from (mu4e-message-field msg :from)) - (from (and from (cdar from)))) - (if (mu4e-personal-address-p from) - (mu4e~view-construct-contacts-header msg :to) - (mu4e~view-construct-contacts-header msg :from)))) - ;; date - (:date - (let ((datestr - (when fieldval (format-time-string mu4e-view-date-format - fieldval)))) - (if datestr (mu4e~view-construct-header field datestr) ""))) - ;; size - (:size - (mu4e~view-construct-header field (mu4e-display-size fieldval))) - (:mailing-list - (mu4e~view-construct-header field fieldval)) - (:message-id - (mu4e~view-construct-header field fieldval)) - ;; attachments - (:attachments (mu4e~view-construct-attachments-header msg)) - ;; pgp-signatures - (:signature (mu4e~view-construct-signature-header msg)) - ;; pgp-decryption - (:decryption (mu4e~view-construct-decryption-header msg)) - (t (mu4e~view-construct-header field - (mu4e~view-custom-field msg field)))))) - mu4e-view-fields "") - "\n" - (let* ((prefer-html - (cond - ((eq mu4e~view-html-text 'html) t) - ((eq mu4e~view-html-text 'text) nil) - (t mu4e-view-prefer-html))) - (body (mu4e-message-body-text msg prefer-html))) - (setq mu4e~view-html-text nil) - (when (fboundp 'add-face-text-property) - (add-face-text-property 0 (length body) 'mu4e-view-body-face t body)) - body))) - (defun mu4e~view-embedded-winbuf () "Get a buffer (shown in a window) for the embedded message." (let* ((buf (get-buffer-create mu4e~view-embedded-buffer-name)) diff --git a/mu4e/mu4e-view-old.el b/mu4e/mu4e-view-old.el index ab66ad83..a0495e7b 100644 --- a/mu4e/mu4e-view-old.el +++ b/mu4e/mu4e-view-old.el @@ -45,17 +45,8 @@ (require 'calendar) (defvar mu4e~headers-view-win) -(defvar helm-comp-read-use-marked) ;;; Options -(defcustom mu4e-view-fields - '(:from :to :cc :subject :flags :date :maildir :mailing-list :tags - :attachments :signature :decryption) - "Header fields to display in the message view buffer. -For the complete list of available headers, see `mu4e-header-info'." - :type (list 'symbol) - :group 'mu4e-view) - (defcustom mu4e-view-show-addresses nil "Whether to initially show full e-mail addresses for contacts. Otherwise, just show their names." diff --git a/mu4e/mu4e-view.el b/mu4e/mu4e-view.el index b62d5b17..b88b08c0 100644 --- a/mu4e/mu4e-view.el +++ b/mu4e/mu4e-view.el @@ -46,6 +46,14 @@ the end of a message. Otherwise, don't move to the next message." :type 'boolean :group 'mu4e-view) +(defcustom mu4e-view-fields + '(:from :to :cc :subject :flags :date :maildir :mailing-list :tags + :attachments :signature :decryption) + "Header fields to display in the message view buffer. +For the complete list of available headers, see `mu4e-header-info'." + :type (list 'symbol) + :group 'mu4e-view) + (defcustom mu4e-view-actions '( ("capture message" . mu4e-action-capture-message) ("view as pdf" . mu4e-action-view-as-pdf)