1 |
;;; mh-utils.el --- MH-E code needed for both sending and reading |
\;;; mh-utils.el --- MH-E code needed for both sending and reading |
2 |
|
|
3 |
;; Copyright (C) 1993, 1995, 1997, |
;; Copyright (C) 1993, 1995, 1997, |
4 |
;; 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
;; 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
414 |
|
|
415 |
(defun mh-show-font-lock-fontify-region (beg end loudly) |
(defun mh-show-font-lock-fontify-region (beg end loudly) |
416 |
"Limit font-lock in `mh-show-mode' to the header. |
"Limit font-lock in `mh-show-mode' to the header. |
417 |
Used when `mh-highlight-citation-p' is set to \"'gnus\", leaving the body to |
|
418 |
be dealt with by gnus highlighting. The region between BEG and END is given |
Used when the option `mh-highlight-citation-style' is set to \"Gnus\", leaving |
419 |
over to be fontified and LOUDLY controls if a user sees a message about the |
the body to be dealt with by Gnus highlighting. The region between BEG and END |
420 |
fontification operation." |
is given over to be fontified and LOUDLY controls if a user sees a message |
421 |
|
about the fontification operation." |
422 |
(let ((header-end (mh-mail-header-end))) |
(let ((header-end (mh-mail-header-end))) |
423 |
(cond |
(cond |
424 |
((and (< beg header-end)(< end header-end)) |
((and (< beg header-end)(< end header-end)) |
875 |
(mh-defun-show-buffer mh-show-index-sequenced-messages |
(mh-defun-show-buffer mh-show-index-sequenced-messages |
876 |
mh-index-sequenced-messages) |
mh-index-sequenced-messages) |
877 |
(mh-defun-show-buffer mh-show-catchup mh-catchup) |
(mh-defun-show-buffer mh-show-catchup mh-catchup) |
|
(mh-defun-show-buffer mh-show-ps-print-toggle-mime mh-ps-print-toggle-mime) |
|
878 |
(mh-defun-show-buffer mh-show-ps-print-toggle-color mh-ps-print-toggle-color) |
(mh-defun-show-buffer mh-show-ps-print-toggle-color mh-ps-print-toggle-color) |
879 |
(mh-defun-show-buffer mh-show-ps-print-toggle-faces mh-ps-print-toggle-faces) |
(mh-defun-show-buffer mh-show-ps-print-toggle-faces mh-ps-print-toggle-faces) |
880 |
(mh-defun-show-buffer mh-show-ps-print-msg-file mh-ps-print-msg-file) |
(mh-defun-show-buffer mh-show-ps-print-msg-file mh-ps-print-msg-file) |
881 |
(mh-defun-show-buffer mh-show-ps-print-msg mh-ps-print-msg) |
(mh-defun-show-buffer mh-show-ps-print-msg mh-ps-print-msg) |
|
(mh-defun-show-buffer mh-show-ps-print-msg-show mh-ps-print-msg-show) |
|
882 |
(mh-defun-show-buffer mh-show-toggle-mime-buttons mh-toggle-mime-buttons) |
(mh-defun-show-buffer mh-show-toggle-mime-buttons mh-toggle-mime-buttons) |
883 |
(mh-defun-show-buffer mh-show-display-with-external-viewer |
(mh-defun-show-buffer mh-show-display-with-external-viewer |
884 |
mh-display-with-external-viewer) |
mh-display-with-external-viewer) |
961 |
|
|
962 |
(gnus-define-keys (mh-show-ps-print-map "P" mh-show-mode-map) |
(gnus-define-keys (mh-show-ps-print-map "P" mh-show-mode-map) |
963 |
"?" mh-prefix-help |
"?" mh-prefix-help |
|
"A" mh-show-ps-print-toggle-mime |
|
964 |
"C" mh-show-ps-print-toggle-color |
"C" mh-show-ps-print-toggle-color |
965 |
"F" mh-show-ps-print-toggle-faces |
"F" mh-show-ps-print-toggle-faces |
|
"M" mh-show-ps-print-toggle-mime |
|
966 |
"f" mh-show-ps-print-msg-file |
"f" mh-show-ps-print-msg-file |
967 |
"l" mh-show-print-msg |
"l" mh-show-print-msg |
968 |
"p" mh-show-ps-print-msg |
"p" mh-show-ps-print-msg) |
|
"s" mh-show-ps-print-msg-show) |
|
969 |
|
|
970 |
(gnus-define-keys (mh-show-thread-map "T" mh-show-mode-map) |
(gnus-define-keys (mh-show-thread-map "T" mh-show-mode-map) |
971 |
"?" mh-prefix-help |
"?" mh-prefix-help |
1106 |
(make-local-variable 'font-lock-defaults) |
(make-local-variable 'font-lock-defaults) |
1107 |
;;(set (make-local-variable 'font-lock-support-mode) nil) |
;;(set (make-local-variable 'font-lock-support-mode) nil) |
1108 |
(cond |
(cond |
1109 |
((equal mh-highlight-citation-p 'font-lock) |
((equal mh-highlight-citation-style 'font-lock) |
1110 |
(setq font-lock-defaults '(mh-show-font-lock-keywords-with-cite t))) |
(setq font-lock-defaults '(mh-show-font-lock-keywords-with-cite t))) |
1111 |
((equal mh-highlight-citation-p 'gnus) |
((equal mh-highlight-citation-style 'gnus) |
1112 |
(setq font-lock-defaults '((mh-show-font-lock-keywords) |
(setq font-lock-defaults '((mh-show-font-lock-keywords) |
1113 |
t nil nil nil |
t nil nil nil |
1114 |
(font-lock-fontify-region-function |
(font-lock-fontify-region-function |
1254 |
(defun mh-show-xface () |
(defun mh-show-xface () |
1255 |
"Display X-Face." |
"Display X-Face." |
1256 |
(when (and window-system mh-show-use-xface-flag |
(when (and window-system mh-show-use-xface-flag |
1257 |
(or mh-decode-mime-flag mhl-formfile |
(or mh-decode-mime-flag mh-mhl-format-file |
1258 |
mh-clean-message-header-flag)) |
mh-clean-message-header-flag)) |
1259 |
(funcall mh-show-xface-function))) |
(funcall mh-show-xface-function))) |
1260 |
|
|
1556 |
(if mh-showing-mode (mh-show msg))) |
(if mh-showing-mode (mh-show msg))) |
1557 |
|
|
1558 |
(defun mh-show (&optional message redisplay-flag) |
(defun mh-show (&optional message redisplay-flag) |
1559 |
"Show message at cursor. |
"Display message\\<mh-folder-mode-map>. |
1560 |
If optional argument MESSAGE is non-nil, display that message instead. |
|
1561 |
Force a two-window display with the folder window on top (size given by the |
If the message under the cursor is already displayed, this command scrolls to |
1562 |
variable `mh-summary-height') and the show buffer below it. |
the beginning of the message. MH-E normally hides a lot of the superfluous |
1563 |
If the message is already visible, display the start of the message. |
header fields that mailers add to a message, but if you wish to see all of |
1564 |
|
them, use the command \\[mh-header-display]. |
1565 |
If REDISPLAY-FLAG is non-nil, the default when called interactively, the |
|
1566 |
message is redisplayed even if the show buffer was already displaying the |
From a program, optional argument MESSAGE can be used to display an |
1567 |
correct message. |
alternative message. The optional argument REDISPLAY-FLAG forces the redisplay |
1568 |
|
of the message even if the show buffer was already displaying the correct |
1569 |
Display of the message is controlled by setting the variables |
message. |
1570 |
`mh-clean-message-header-flag' and `mhl-formfile'. The default behavior is |
|
1571 |
to scroll uninteresting headers off the top of the window. |
See the \"mh-show\" customization group for a litany of options that control |
1572 |
Type \"\\[mh-header-display]\" to see the message with all its headers." |
what displayed messages look like." |
1573 |
(interactive (list nil t)) |
(interactive (list nil t)) |
1574 |
(when (or redisplay-flag |
(when (or redisplay-flag |
1575 |
(and mh-showing-with-headers |
(and mh-showing-with-headers |
1576 |
(or mhl-formfile mh-clean-message-header-flag))) |
(or mh-mhl-format-file mh-clean-message-header-flag))) |
1577 |
(mh-invalidate-show-buffer)) |
(mh-invalidate-show-buffer)) |
1578 |
(mh-show-msg message)) |
(mh-show-msg message)) |
1579 |
|
|
1635 |
(run-hooks 'mh-show-hook))) |
(run-hooks 'mh-show-hook))) |
1636 |
|
|
1637 |
(defun mh-modify (&optional message) |
(defun mh-modify (&optional message) |
1638 |
"Edit message at cursor. |
"Edit message. |
|
If optional argument MESSAGE is non-nil, edit that message instead. |
|
|
Force a two-window display with the folder window on top (size given by the |
|
|
value of the variable `mh-summary-height') and the message editing buffer below |
|
|
it. |
|
1639 |
|
|
1640 |
The message is displayed in raw form." |
There are times when you need to edit a message. For example, you may need to |
1641 |
|
fix a broken Content-Type header field. You can do this with this command. It |
1642 |
|
displays the raw message in an editable buffer. When you are done editing, |
1643 |
|
save and kill the buffer as you would any other. |
1644 |
|
|
1645 |
|
From a program, edit MESSAGE instead if it is non-nil." |
1646 |
(interactive) |
(interactive) |
1647 |
(let* ((message (or message (mh-get-msg-num t))) |
(let* ((message (or message (mh-get-msg-num t))) |
1648 |
(msg-filename (mh-msg-filename message)) |
(msg-filename (mh-msg-filename message)) |
1697 |
(unless (mh-buffer-data) |
(unless (mh-buffer-data) |
1698 |
(setf (mh-buffer-data) (mh-make-buffer-data))) |
(setf (mh-buffer-data) (mh-make-buffer-data))) |
1699 |
;; Bind variables in folder buffer in case they are local |
;; Bind variables in folder buffer in case they are local |
1700 |
(let ((formfile mhl-formfile) |
(let ((formfile mh-mhl-format-file) |
1701 |
(clean-message-header mh-clean-message-header-flag) |
(clean-message-header mh-clean-message-header-flag) |
1702 |
(invisible-headers mh-invisible-header-fields-compiled) |
(invisible-headers mh-invisible-header-fields-compiled) |
1703 |
(visible-headers nil) |
(visible-headers nil) |
1846 |
(mh-thread-update-scan-line-map msg notation offset))))))) |
(mh-thread-update-scan-line-map msg notation offset))))))) |
1847 |
|
|
1848 |
(defun mh-goto-msg (number &optional no-error-if-no-message dont-show) |
(defun mh-goto-msg (number &optional no-error-if-no-message dont-show) |
1849 |
"Position the cursor at message NUMBER. |
"Go to a message\\<mh-folder-mode-map>. |
1850 |
Optional non-nil second argument NO-ERROR-IF-NO-MESSAGE means return nil |
|
1851 |
instead of signaling an error if message does not exist; in this case, the |
You can enter the message NUMBER either before or after typing |
1852 |
cursor is positioned near where the message would have been. |
\\[mh-goto-msg]. In the latter case, Emacs prompts you. |
1853 |
Non-nil third argument DONT-SHOW means not to show the message." |
|
1854 |
|
In a program, optional non-nil second argument NO-ERROR-IF-NO-MESSAGE means |
1855 |
|
return nil instead of signaling an error if message does not exist\; in this |
1856 |
|
case, the cursor is positioned near where the message would have been. Non-nil |
1857 |
|
third argument DONT-SHOW means not to show the message." |
1858 |
(interactive "NGo to message: ") |
(interactive "NGo to message: ") |
1859 |
(setq number (prefix-numeric-value number)) |
(setq number (prefix-numeric-value number)) |
1860 |
(let ((point (point)) |
(let ((point (point)) |