* cosmetics

This commit is contained in:
djcb
2012-04-28 13:47:13 +03:00
parent 99c1042769
commit 63711fd046
2 changed files with 53 additions and 54 deletions

View File

@ -780,8 +780,8 @@ current window. "
(let ((inhibit-read-only t))
(erase-buffer)
(insert (propertize "Waiting for message..."
'face 'mu4e-system-face 'intangible t)))
(mu4e~proc-view docid)))
'face 'mu4e-system-face 'intangible t))
(mu4e~proc-view docid))))
(defun mu4e~hdrs-kill-buffer-and-window ()
"Quit the message view and return to the main view."

View File

@ -196,60 +196,57 @@ based on the settings of `mu4e~view-wrap-lines' and
As a side-effect, a message that is being viewed loses its 'unread'
marking if it still had that."
(let ((buf (get-buffer-create mu4e-view-buffer-name))
(inhibit-read-only t))
(let ((buf (get-buffer-create mu4e-view-buffer-name)))
(with-current-buffer buf
(setq mu4e-view-buffer buf)
(erase-buffer)
(insert (mu4e-view-message-text msg))
(let ((inhibit-read-only t))
(setq ;; buffer local
mu4e-current-msg msg
mu4e~view-hdrs-buffer hdrsbuf
mu4e-view-buffer buf)
;; initialize view-mode
(mu4e-view-mode)
(setq ;; these are buffer-local
buffer-read-only t
mu4e-current-msg msg
mu4e~view-hdrs-buffer hdrsbuf
mu4e~view-link-map (make-hash-table :size 32 :rehash-size 2 :weakness nil))
(erase-buffer)
(insert (mu4e-view-message-text msg))
(switch-to-buffer buf)
(goto-char (point-min))
(switch-to-buffer buf)
(goto-char (point-min))
(mu4e~view-fontify-cited)
(mu4e~view-fontify-footer)
(mu4e~view-make-urls-clickable)
(mu4e~view-fontify-cited)
(mu4e~view-fontify-footer)
(mu4e~view-make-urls-clickable)
(unless update
;; if we're showing the message for the first time, use the values of
;; user-settable variables `mu4e~view-wrap-lines' and
;; `mu4e~view-hide-cited' to determine whether we should wrap/hide
(progn
(when mu4e~view-lines-wrapped (mu4e~view-wrap-lines))
(when mu4e~view-cited-hidden (mu4e~view-hide-cited))))
(unless update
;; if we're showing the message for the first time, use the values of
;; user-settable variables `mu4e~view-wrap-lines' and
;; `mu4e~view-hide-cited' to determine whether we should wrap/hide
(progn
(when mu4e~view-lines-wrapped (mu4e~view-wrap-lines))
(when mu4e~view-cited-hidden (mu4e~view-hide-cited))))
;; no use in trying to set flags again
(unless update
(mu4e~view-mark-as-read-maybe)))))
;; no use in trying to set flags again
(unless update
(mu4e~view-mark-as-read-maybe)))
(mu4e-view-mode))))
(defun mu4e~view-construct-header (key val &optional dont-propertize-val)
"Return header KEY with value VAL if VAL is non-nil. If
"Return header KEY with value VAL if VAL is non-nil. If
DONT-PROPERTIZE-VAL is non-nil, do not add text-properties to VAL."
(if val
(with-temp-buffer
(insert (propertize key 'face 'mu4e-view-header-key-face) ": "
(if dont-propertize-val
val
(propertize val 'face 'mu4e-view-header-value-face)) "\n")
;; temporarily set the fill column <margin> positions to the right, so
;; we can indent following lines with positions
(let*((margin 1) (fill-column (- fill-column margin)))
(fill-region (point-min) (point-max))
(goto-char (point-min))
(while (and (zerop (forward-line 1)) (not (looking-at "^$")))
(indent-to-column margin)))
(buffer-string))
""))
(if val
(with-temp-buffer
(insert (propertize key 'face 'mu4e-view-header-key-face) ": "
(if dont-propertize-val
val
(propertize val 'face 'mu4e-view-header-value-face)) "\n")
;; temporarily set the fill column <margin> positions to the right, so
;; we can indent following lines with positions
(let*((margin 1) (fill-column (- fill-column margin)))
(fill-region (point-min) (point-max))
(goto-char (point-min))
(while (and (zerop (forward-line 1)) (not (looking-at "^$")))
(indent-to-column margin)))
(buffer-string))
""))
(defun mu4e~view-construct-contacts (msg field)
"Add a header for a contact field (ie., :to, :from, :cc, :bcc)."
@ -558,6 +555,8 @@ Seen; if the message is not New/Unread, do nothing."
number them so they can be opened using `mu4e-view-go-to-url'."
(let ((num 0))
(save-excursion
(setq mu4e~view-link-map ;; buffer local
(make-hash-table :size 32 :rehash-size 2 :weakness nil))
(goto-char (point-min))
(while (re-search-forward mu4e~view-url-regexp nil t)
(let ((url (match-string 0))