Commit 553fb735 authored by Bill Wohler's avatar Bill Wohler
Browse files

* mh-comp.el (mh-letter-mode): Use mh-highlight-citation-style instead

of mh-highlight-citation-p.
(mh-letter-toggle-header-field-display): "Ellipsed" isn't a word, I
think, so use "truncated".

* mh-customize.el (mh-folder, mh-folder-faces): Group's manual section
is Folders, not Organizing. Parent of mh-folder-faces is mh-folder,
not mh-show.
(mh-speed): Rename to mh-speedbar for consistency with mh-toolbar.
(mh-thread): New group that corresponds with manual's Threading
chapter.
(mh-letter-faces): Group's manual section is Editing Drafts, not
Sending Mail.
(mh-sortm-args): New customization variable that used to be a defvar.
(mh-index-new-messages-folders, mh-index-ticked-messages-folders):
Move from mh-index group to mh-folders group.
(mh-alias-local-users-prefix, mh-large-folder)
(mh-recursive-folders-flag, mh-before-quit-hook)
(mh-folder-mode-hook, mh-kill-folder-suppress-prompt-hook)
(mh-quit-hook, mh-refile-msg-hook): Move from mh-show group to
mh-folder group.
(mh-highlight-citation-style): Rename from mh-highlight-citation-p.
Sync docstrings with manual.
(mh-mhl-format-file): Rename from mhl-formfile. Sync docstrings with
manual.
(mh-show-threads-flag): Move from mh-show group to mh-thread group.
(mh-find-path-hook): Move from mh-show group to mh-e group.
(mh-folder-updated-hook): Add to mh-folder group.
(mh-forward-hook): Move from mh-folder to mh-sending-mail group.
(mh-unseen-updated-hook): Move from mh-show to mh-sequences group.
(mh-bury-show-buffer-flag, mh-clean-message-header-flag)
(mh-decode-mime-flag, mh-display-buttons-for-alternatives-flag)
(mh-display-buttons-for-inline-parts-flag)
(mh-do-not-confirm-flag, mh-fetch-x-image-url)
(mh-graphical-smileys-flag, mh-graphical-emphasis-flag)
(mh-invisible-header-fields-default, mh-invisible-header-fields)
(mh-lpr-command-format, mh-max-inline-image-height)
(mh-max-inline-image-width)
(mh-mime-save-parts-default-directory, mh-print-background-flag)
(mh-show-maximum-size, mh-show-use-goto-addr-flag)
(mh-show-use-xface-flag, mh-store-default-directory)
(mh-summary-height, mh-delete-msg-hook
(mh-show-hook, mh-show-mode-hook): Sync docstrings with manual.

* mh-e.el (mh-scan-format-mh, mh-scan-good-msg-regexp)
(mh-scan-deleted-msg-regexp, mh-scan-refiled-msg-regexp)
(mh-scan-cur-msg-number-regexp, mh-scan-subject-regexp): Use
non-fontification instead of non-fontifying.
(mh-header-display): Use mh-mhl-format-file instead of mhl-formfile.
Sync docstrings with manual.
(mh-next-undeleted-msg, mh-previous-undeleted-msg): Rename arg to
count. Sync docstrings with manual.
(mh-refile-or-write-again): Use output from mh-write-msg-to-file so
that message doesn't change when using this command. Sync docstrings
with manual.
(mh-page-msg, mh-previous-page): Rename arg to lines. Sync docstrings
with manual.
(mh-write-msg-to-file): Rename msg to message. Rename no-headers to
no-header. Sync docstrings with manual.
(mh-ps-print-map): Delete keybindings for deleted commands
mh-ps-print-toggle-mime and mh-ps-print-msg-show.
(mh-help-messages): Updated printing help.
(mh-delete-msg, mh-delete-msg-no-motion, mh-first-msg)
(mh-last-msg, mh-previous-unread-msg, mh-next-button)
(mh-prev-button, mh-folder-toggle-mime-part)
(mh-folder-inline-mime-part, mh-folder-save-mime-part)
(mh-next-unread-msg, mh-toggle-mime-buttons): Sync docstrings with
manual.

* mh-funcs.el (mh-sortm-args): Now a customization option and in
mh-customize.el.
(mh-pipe-msg): Rename include-headers to include-header. Sync
docstrings with manual.
(mh-burst-digest, mh-page-digest, mh-page-digest-backwards)
(mh-store-msg): Sync docstrings with manual.

* mh-mime.el (mh-mime-save-parts): Rename arg to prompt. Sync
docstrings with manual.
(mh-toggle-mh-decode-mime-flag): Use English in message, not Lisp.
Sync docstrings with manual.
(mh-mm-display-part, mh-mm-inline-message): Use
mh-highlight-citation-style instead of mh-highlight-citation-p.
(mh-press-button): Sync docstrings with manual.
(mh-display-with-external-viewer): Fix default output in minibuffer.
Sync docstrings with manual.

* mh-print.el: (mh-ps-print-mime, mh-ps-print-toggle-mime): Deleted.
(mh-ps-print-color-option): Incorporate docstring from
ps-print-color-p.
(mh-ps-spool-buffer): Remove unused code. Fix indent. Slimline
docstring.
(mh-ps-spool-msg): Slimline docstring. Rename from mh-ps-spool-a-msg.
Rewrote to use existing show buffer when available.
(mh-ps-print-range): Extract method from common code in
mh-ps-print-msg and mh-ps-print-msg-file.
(mh-ps-print-preprint): Clean docstring. Use filename "mh-%s".
(mh-ps-print-msg-show): Delete. Can use either mh-ps-print-msg-show or
mh-ps-print-msg-show to same effect with new code in mh-ps-spool-msg.
(mh-print-msg): Use mh-mhl-format-file instead of mhl-formfile. Sync
docstrings with manual.
(mh-ps-print-msg, mh-ps-print-msg-file)
(mh-ps-print-toggle-faces, mh-ps-print-toggle-color): Sync docstrings
with manual.

* mh-utils.el (mh-show-ps-print-msg-show)
(mh-show-ps-print-toggle-mime): Delete.
(mh-show-ps-print-map): Updated accordingly.
(mh-show-mode): Use mh-highlight-citation-style instead of
mh-highlight-citation-p.
(mh-show-xface, mh-display-msg): Use mh-mhl-format-file instead of
mhl-formfile.
(mh-show): Use mh-mhl-format-file instead of mhl-formfile. Sync
docstrings with manual.
(mh-show-font-lock-fontify-region, mh-modify, mh-goto-msg): Sync
docstrings with manual.
parent 1a18223e
2005-12-01 Bill Wohler <wohler@newt.com>
Rewrote Reading Mail chapter in manual which affected mh-show
customization group and related functions.
* mh-comp.el (mh-letter-mode): Use mh-highlight-citation-style
instead of mh-highlight-citation-p.
(mh-letter-toggle-header-field-display): "Ellipsed" isn't a word,
I think, so use "truncated".
* mh-customize.el (mh-folder, mh-folder-faces): Group's manual
section is Folders, not Organizing. Parent of mh-folder-faces is
mh-folder, not mh-show.
(mh-speed): Rename to mh-speedbar for consistency with mh-toolbar.
(mh-thread): New group that corresponds with manual's Threading
chapter.
(mh-letter-faces): Group's manual section is Editing Drafts, not
Sending Mail.
(mh-sortm-args): New customization variable that used to be a
defvar.
(mh-index-new-messages-folders, mh-index-ticked-messages-folders):
Move from mh-index group to mh-folders group.
(mh-alias-local-users-prefix, mh-large-folder)
(mh-recursive-folders-flag, mh-before-quit-hook)
(mh-folder-mode-hook, mh-kill-folder-suppress-prompt-hook)
(mh-quit-hook, mh-refile-msg-hook): Move from mh-show group to
mh-folder group.
(mh-highlight-citation-style): Rename from
mh-highlight-citation-p. Sync docstrings with manual.
(mh-mhl-format-file): Rename from mhl-formfile. Sync docstrings
with manual.
(mh-show-threads-flag): Move from mh-show group to mh-thread
group.
(mh-find-path-hook): Move from mh-show group to mh-e group.
(mh-folder-updated-hook): Add to mh-folder group.
(mh-forward-hook): Move from mh-folder to mh-sending-mail group.
(mh-unseen-updated-hook): Move from mh-show to mh-sequences group.
(mh-bury-show-buffer-flag, mh-clean-message-header-flag)
(mh-decode-mime-flag, mh-display-buttons-for-alternatives-flag)
(mh-display-buttons-for-inline-parts-flag)
(mh-do-not-confirm-flag, mh-fetch-x-image-url)
(mh-graphical-smileys-flag, mh-graphical-emphasis-flag)
(mh-invisible-header-fields-default, mh-invisible-header-fields)
(mh-lpr-command-format, mh-max-inline-image-height)
(mh-max-inline-image-width)
(mh-mime-save-parts-default-directory, mh-print-background-flag)
(mh-show-maximum-size, mh-show-use-goto-addr-flag)
(mh-show-use-xface-flag, mh-store-default-directory)
(mh-summary-height, mh-delete-msg-hook
(mh-show-hook, mh-show-mode-hook): Sync docstrings with manual.
* mh-e.el
(mh-scan-format-mh, mh-scan-good-msg-regexp)
(mh-scan-deleted-msg-regexp, mh-scan-refiled-msg-regexp)
(mh-scan-cur-msg-number-regexp, mh-scan-subject-regexp): Use
non-fontification instead of non-fontifying.
(mh-header-display): Use mh-mhl-format-file instead of
mhl-formfile. Sync docstrings with manual.
(mh-next-undeleted-msg, mh-previous-undeleted-msg): Rename arg to
count. Sync docstrings with manual.
(mh-refile-or-write-again): Use output from mh-write-msg-to-file
so that message doesn't change when using this command. Sync
docstrings with manual.
(mh-page-msg, mh-previous-page): Rename arg to lines. Sync
docstrings with manual.
(mh-write-msg-to-file): Rename msg to message. Rename no-headers
to no-header. Sync docstrings with manual.
(mh-ps-print-map): Delete keybindings for deleted commands
mh-ps-print-toggle-mime and mh-ps-print-msg-show.
(mh-help-messages): Updated printing help.
(mh-delete-msg, mh-delete-msg-no-motion, mh-first-msg)
(mh-last-msg, mh-previous-unread-msg, mh-next-button)
(mh-prev-button, mh-folder-toggle-mime-part)
(mh-folder-inline-mime-part, mh-folder-save-mime-part)
(mh-next-unread-msg, mh-toggle-mime-buttons): Sync docstrings with
manual.
* mh-funcs.el (mh-sortm-args): Now a customization option and
in mh-customize.el.
(mh-pipe-msg): Rename include-headers to include-header. Sync
docstrings with manual.
(mh-burst-digest, mh-page-digest, mh-page-digest-backwards)
(mh-store-msg): Sync docstrings with manual.
* mh-mime.el (mh-mime-save-parts): Rename arg to prompt. Sync
docstrings with manual.
(mh-toggle-mh-decode-mime-flag): Use English in message, not Lisp.
Sync docstrings with manual.
(mh-mm-display-part, mh-mm-inline-message): Use
mh-highlight-citation-style instead of mh-highlight-citation-p.
(mh-press-button): Sync docstrings with manual.
(mh-display-with-external-viewer): Fix default output in
minibuffer. Sync docstrings with manual.
* mh-print.el: (mh-ps-print-mime, mh-ps-print-toggle-mime):
Deleted.
(mh-ps-print-color-option): Incorporate docstring from
ps-print-color-p.
(mh-ps-spool-buffer): Remove unused code. Fix indent. Slimline
docstring.
(mh-ps-spool-msg): Slimline docstring. Rename from
mh-ps-spool-a-msg. Rewrote to use existing show buffer when
available.
(mh-ps-print-range): Extract method from common code in
mh-ps-print-msg and mh-ps-print-msg-file.
(mh-ps-print-preprint): Clean docstring. Use filename "mh-%s".
(mh-ps-print-msg-show): Delete. Can use either
mh-ps-print-msg-show or mh-ps-print-msg-show to same effect with
new code in mh-ps-spool-msg.
(mh-print-msg): Use mh-mhl-format-file instead of mhl-formfile.
Sync docstrings with manual.
(mh-ps-print-msg, mh-ps-print-msg-file)
(mh-ps-print-toggle-faces, mh-ps-print-toggle-color): Sync
docstrings with manual.
* mh-utils.el (mh-show-ps-print-msg-show,
mh-show-ps-print-toggle-mime): Delete.
(mh-show-ps-print-map): Updated accordingly.
(mh-show-mode): Use mh-highlight-citation-style instead of
mh-highlight-citation-p.
(mh-show-xface, mh-display-msg): Use mh-mhl-format-file instead of
mhl-formfile.
(mh-show): Use mh-mhl-format-file instead of mhl-formfile. Sync
docstrings with manual.
(mh-show-font-lock-fontify-region, mh-modify, mh-goto-msg): Sync
docstrings with manual.
2005-12-01 Bill Wohler <wohler@newt.com>
* mh-init.el (mh-defface-compat): Checkdoc fix.
* mh-junk.el (mh-bogofilter-blacklist, mh-bogofilter-whitelist):
Bogofilter is lowercase except at beginning of sentence and in
titles.
2005-11-04 Bill Wohler <wohler@newt.com>
* mh-customize.el (mh-min-colors-defined-flag, mh-defface-compat):
......
......@@ -1000,8 +1000,8 @@ When a message is composed, the hooks `text-mode-hook' and
(mh-funcall-if-exists mh-toolbar-init :letter)
(make-local-variable 'font-lock-defaults)
(cond
((or (equal mh-highlight-citation-p 'font-lock)
(equal mh-highlight-citation-p 'gnus))
((or (equal mh-highlight-citation-style 'font-lock)
(equal mh-highlight-citation-style 'gnus))
;; Let's use font-lock even if gnus is used in show-mode. The reason
;; is that gnus uses static text properties which are not appropriate
;; for a buffer that will be edited. So the choice here is either fontify
......@@ -1950,7 +1950,7 @@ except that it is callable from a mouse button."
(defun mh-letter-toggle-header-field-display (arg)
"Toggle display of header field at point.
Use this command to display ellipsed header fields. This command is a toggle
Use this command to display truncated header fields. This command is a toggle
so entering it again will hide the field. This command takes a prefix argument
ARG: if negative then the field is hidden, if positive then the field is
displayed."
......
This diff is collapsed.
This diff is collapsed.
;;; mh-funcs.el --- MH-E functions not everyone will use right away
;; Copyright (C) 1993, 1995,
;; 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
;; 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
;; Author: Bill Wohler <wohler@newt.com>
;; Maintainer: Bill Wohler <wohler@newt.com>
......@@ -39,15 +39,6 @@
(mh-require-cl)
(require 'mh-e)
;;; Customization
(defvar mh-sortm-args nil
"Extra arguments to have \\[mh-sort-folder] pass to the \"sortm\" command.
The arguments are passed to sortm if \\[mh-sort-folder] is given a
prefix argument. Normally default arguments to sortm are specified in the
MH profile.
For example, '(\"-nolimit\" \"-textfield\" \"subject\") is a useful setting.")
;;; Scan Line Formats
(defvar mh-note-copied "C"
......@@ -60,9 +51,19 @@ For example, '(\"-nolimit\" \"-textfield\" \"subject\") is a useful setting.")
;;;###mh-autoload
(defun mh-burst-digest ()
"Burst apart the current message, which should be a digest.
The message is replaced by its table of contents and the messages from the
digest are inserted into the folder after that message."
"Break up digest into separate messages\\<mh-folder-mode-map>.
This command uses the MH command \"burst\" to break out each message in the
digest into its own message. Using this command, you can quickly delete
unwanted messages, like this: Once the digest is split up, toggle out of
MH-Folder Show mode with \\[mh-toggle-showing] so that the scan lines fill the
screen and messages aren't displayed. Then use \\[mh-delete-msg] to quickly
delete messages that you don't want to read (based on the \"Subject:\" header
field). You can also burst the digest to reply directly to the people who
posted the messages in the digest. One problem you may encounter is that the
\"From:\" header fields are preceded with a \">\" so that your reply can't
create the \"To:\" field correctly. In this case, you must correct the \"To:\"
field yourself."
(interactive)
(let ((digest (mh-get-msg-num t)))
(mh-process-or-undo-commands mh-current-folder)
......@@ -186,10 +187,12 @@ entire folder."
(mh-regenerate-headers range))
;;;###mh-autoload
(defun mh-pipe-msg (command include-headers)
"Pipe the current message through the given shell COMMAND.
If INCLUDE-HEADERS (prefix argument) is provided, send the entire message.
Otherwise just send the message's body without the headers."
(defun mh-pipe-msg (command include-header)
"Pipe message through shell command COMMAND.
You are prompted for the Unix command through which you wish to run your
message. If you give an argument INCLUDE-HEADER to this command, the message
header is included in the text passed to the command."
(interactive
(list (read-string "Shell command on message: ") current-prefix-arg))
(let ((msg-file-to-pipe (mh-msg-filename (mh-get-msg-num t)))
......@@ -199,13 +202,13 @@ Otherwise just send the message's body without the headers."
(erase-buffer)
(insert-file-contents msg-file-to-pipe)
(goto-char (point-min))
(if (not include-headers) (search-forward "\n\n"))
(if (not include-header) (search-forward "\n\n"))
(let ((default-directory message-directory))
(shell-command-on-region (point) (point-max) command nil)))))
;;;###mh-autoload
(defun mh-page-digest ()
"Advance displayed message to next digested message."
"Display next message in digest."
(interactive)
(mh-in-show-buffer (mh-show-buffer)
;; Go to top of screen (in case user moved point).
......@@ -222,7 +225,7 @@ Otherwise just send the message's body without the headers."
;;;###mh-autoload
(defun mh-page-digest-backwards ()
"Back up displayed message to previous digested message."
"Display previous message in digest."
(interactive)
(mh-in-show-buffer (mh-show-buffer)
;; Go to top of screen (in case user moved point).
......@@ -274,10 +277,13 @@ argument EXTRA-ARGS is given."
;;;###mh-autoload
(defun mh-store-msg (directory)
"Store the file(s) contained in the current message into DIRECTORY.
The message can contain a shar file or uuencoded file.
Default directory is the last directory used, or initially the value of
`mh-store-default-directory' or the current directory."
"Unpack message created with `uudecode' or `shar'.
The default DIRECTORY for extraction is the current directory; however, you
have a chance to specify a different extraction directory. The next time you
use this command, the default directory is the last directory you used. If you
would like to change the initial default directory, customize the option
`mh-store-default-directory'."
(interactive (list (let ((udir (or mh-store-default-directory
default-directory)))
(read-file-name "Store message in directory: "
......
......@@ -799,11 +799,15 @@ This is used to decide if smileys and graphical emphasis will be displayed."
Set from last use.")
;;;###mh-autoload
(defun mh-mime-save-parts (arg)
"Store the MIME parts of the current message.
If ARG, prompt for directory, else use that specified by the variable
`mh-mime-save-parts-default-directory'. These directories may be superseded by
MH profile components, since this function calls on mhstore to do the work."
(defun mh-mime-save-parts (prompt)
"Save attachments.
You can save all of the attachments at once with this command. The attachments
are saved in the directory specified by the option
`mh-mime-save-parts-default-directory' unless you use a prefix argument PROMPT
in which case you are prompted for the directory. These directories may be
superseded by MH profile components, since this function calls on
\"mhstore\" (\"mhn\") to do the work."
(interactive "P")
(let ((msg (if (eq major-mode 'mh-show-mode)
(mh-show-buffer-message-number)
......@@ -814,12 +818,12 @@ MH profile components, since this function calls on mhstore to do the work."
(command (if (mh-variant-p 'nmh) "mhstore" "mhn"))
(directory
(cond
((and (or arg
((and (or prompt
(equal nil mh-mime-save-parts-default-directory)
(equal t mh-mime-save-parts-default-directory))
(not mh-mime-save-parts-directory))
(read-file-name "Store in directory: " nil nil t nil))
((and (or arg
((and (or prompt
(equal t mh-mime-save-parts-default-directory))
mh-mime-save-parts-directory)
(read-file-name (format
......@@ -877,11 +881,13 @@ If message has been encoded for transfer take that into account."
;;;###mh-autoload
(defun mh-toggle-mh-decode-mime-flag ()
"Toggle whether MH-E should decode MIME or not."
"Toggle the value of `mh-decode-mime-flag'."
(interactive)
(setq mh-decode-mime-flag (not mh-decode-mime-flag))
(mh-show nil t)
(message "(setq mh-decode-mime-flag %s)" mh-decode-mime-flag))
(message "%s" (if mh-decode-mime-flag
"Processing attachments normally"
"Displaying raw message")))
;;;###mh-autoload
(defun mh-decode-message-header ()
......@@ -1184,7 +1190,7 @@ like \"K v\" which operate on individual MIME parts."
(goto-char (point-min))
(delete-char 1))
(when (equal (mm-handle-media-supertype handle) "text")
(when (eq mh-highlight-citation-p 'gnus)
(when (eq mh-highlight-citation-style 'gnus)
(mh-gnus-article-highlight-citation))
(mh-display-smileys)
(mh-display-emphasis)
......@@ -1205,9 +1211,10 @@ like \"K v\" which operate on individual MIME parts."
;;;###mh-autoload
(defun mh-press-button ()
"Press MIME button.
If the MIME part is visible then it is removed. Otherwise the part is
displayed."
"View contents of button.
This command is a toggle so if you use it again on the same attachment, the
attachment is hidden."
(interactive)
(let ((mm-inline-media-tests mh-mm-inline-media-tests)
(data (get-text-property (point) 'mh-data))
......@@ -1279,7 +1286,23 @@ button."
;;;###mh-autoload
(defun mh-display-with-external-viewer (part-index)
"View MIME PART-INDEX externally."
"View attachment externally.
If Emacs does not know how to view an attachment, you could save it into a
file and then run some program to open it. It is easier, however, to launch
the program directly from MH-E with this command. While you'll most likely use
this to view spreadsheets and documents, it is also useful to use your browser
to view HTML attachments with higher fidelity than what Emacs can provide.
This command displays the attachment associated with the button under the
cursor. If the cursor is not located over a button, then the cursor first
moves to the next button, wrapping to the beginning of the message if
necessary. You can provide a numeric prefix argument PART-INDEX to view the
attachment labeled with that number.
This command tries to provide a reasonable default for the viewer by calling
the Emacs function `mailcap-mime-info'. This function usually reads the file
\"/etc/mailcap\"."
(interactive "P")
(when (consp part-index) (setq part-index (car part-index)))
(mh-folder-mime-action
......@@ -1290,7 +1313,9 @@ button."
(methods (mapcar (lambda (x) (list (cdr (assoc 'viewer x))))
(mailcap-mime-info type 'all)))
(def (caar methods))
(prompt (format "Viewer: %s" (if def (format "[%s] " def) "")))
(prompt (format "Viewer%s: " (if def
(format " (default %s)" def)
"")))
(method (completing-read prompt methods nil nil nil nil def))
(folder mh-show-folder-buffer)
(buffer-read-only nil))
......@@ -1464,7 +1489,7 @@ message multiple times."
(mh-decode-message-header)
(mh-show-addr)
;; The other highlighting types don't need anything special
(when (eq mh-highlight-citation-p 'gnus)
(when (eq mh-highlight-citation-style 'gnus)
(mh-gnus-article-highlight-citation))
(goto-char (point-min))
(insert "\n------- Forwarded Message\n\n")
......
......@@ -25,13 +25,6 @@
;; Boston, MA 02110-1301, USA.
;;; Commentary:
;; Pp Print to lpr | Default inline settings
;; Pf Print to file | Generate a postscript file
;; Ps Print show buffer | Fails if no show buffer
;;
;; PA Toggle inline/attachments
;; PC Toggle color
;; PF Toggle faces
;;; Change Log:
......@@ -44,125 +37,120 @@
(require 'mh-funcs)
(eval-when-compile (require 'mh-seq))
(defvar mh-ps-print-mime nil
"Control printing of MIME parts.
The three possible states are:
1. nil to not print inline parts
2. t to print inline parts
3. non-zero to print inline parts and attachments")
(defvar mh-ps-print-color-option ps-print-color-p
"MH-E's version of `\\[ps-print-color-p]'.")
"Specify how buffer's text color is printed.
Valid values are:
nil - Do not print colors.
t - Print colors.
black-white - Print colors on black/white printer.
See also `ps-black-white-faces'.
Any other value is treated as t. This variable is initialized from
`ps-print-color-p'.")
(defvar mh-ps-print-func 'ps-spool-buffer-with-faces
"Function to use to spool a buffer.
Sensible choices are the functions `ps-spool-buffer' and
`ps-spool-buffer-with-faces'.")
;; XXX - If buffer is already being displayed, use that buffer
;; XXX - What about showing MIME content?
;; XXX - Default print buffer is bogus
(defun mh-ps-spool-buffer (buffer)
"Send BUFFER to printer queue."
"Spool BUFFER."
(save-excursion
(set-buffer buffer)
(let ((ps-print-color-p mh-ps-print-color-option)
(ps-left-header
(list
(concat "("
(mh-get-header-field "Subject:") ")")
(concat "("
(mh-get-header-field "From:") ")")))
(ps-right-header
(list
"/pagenumberstring load"
(concat "("
(mh-get-header-field "Date:") ")"))))
(funcall mh-ps-print-func))))
(defun mh-ps-spool-a-msg (msg buffer)
"Print MSG.
First the message is decoded in BUFFER before the results are sent to the
printer."
(let ((mh-show-buffer mh-show-buffer)
(folder mh-current-folder)
;; The following is commented out because
;; `clean-message-header-flag' isn't used anywhere. I
;; commented rather than deleted in case somebody had some
;; future plans for it. --SY.
;(clean-message-header-flag mh-clean-message-header-flag)
)
(ps-left-header
(list
(concat "(" (mh-get-header-field "Subject:") ")")
(concat "(" (mh-get-header-field "From:") ")")))
(ps-right-header
(list
"/pagenumberstring load"
(concat "(" (mh-get-header-field "Date:") ")"))))
(funcall mh-ps-print-func))))
(defun mh-ps-spool-msg (msg)
"Spool MSG."
(let* ((folder mh-current-folder)
(buffer (mh-in-show-buffer (mh-show-buffer)
(if (not (equal (mh-msg-filename msg folder)
buffer-file-name))
(get-buffer-create mh-temp-buffer)))))
(unwind-protect
(save-excursion
(if buffer
(let ((mh-show-buffer buffer))
(mh-display-msg msg folder)))
(mh-ps-spool-buffer (if buffer buffer mh-show-buffer)))
(if buffer
(kill-buffer buffer)))))
(defun mh-ps-print-range (range file)
"Print the messages in RANGE to FILE.
This is the function that actually does the work.
If FILE is nil, then the messages are spooled to the printer."
(mh-iterate-on-range msg range
(unwind-protect
(progn
(setq mh-show-buffer buffer)
(save-excursion
;;
;; XXX - Use setting of mh-ps-print-mime
;;
(mh-display-msg msg folder)
(mh-ps-spool-buffer mh-show-buffer)
(kill-buffer mh-show-buffer))))))
(mh-ps-spool-msg msg))
(mh-notate msg mh-note-printed mh-cmd-note))
(ps-despool file))
(defun mh-ps-print-preprint (prefix-arg)
"Provide a better default file name for `ps-print-preprint'.
Pass along the PREFIX-ARG to it."
(let ((buffer-file-name (format "mh-%s" (substring (buffer-name) 1))))
(ps-print-preprint prefix-arg)))
;;;###mh-autoload
(defun mh-ps-print-msg (range)
"Print the messages in RANGE.
"Print the messages in RANGE\\<mh-folder-mode-map>.
Check the documentation of `mh-interactive-range' to see how RANGE is read in
interactive use."
(interactive (list (mh-interactive-range "Print")))
(mh-iterate-on-range msg range
(let ((buffer (get-buffer-create mh-temp-buffer)))
(unwind-protect
(mh-ps-spool-a-msg msg buffer)
(kill-buffer buffer)))
(mh-notate nil mh-note-printed mh-cmd-note))
(ps-despool nil))
interactive use.
(defun mh-ps-print-preprint (prefix-arg)
"Replacement for `ps-print-preprint'.
The original function does not handle the fact that MH folders are directories
nicely, when generating the default file name. This function works around
that. The function is passed the interactive PREFIX-ARG."
(let ((buffer-file-name (format "/tmp/%s" (substring (buffer-name) 1))))
(ps-print-preprint prefix-arg)))
This command will print inline text attachments but will not decrypt messages.
However, when a message is displayed in an MH-Show buffer, then that buffer is
used verbatim for printing with the caveat that only text attachments, if
opened inline, are printed. Therefore, encrypted messages can be printed by
showing and decrypting them first.
MH-E uses the \"ps-print\" package to do the printing, so you can customize
the printing further by going to the `ps-print' customization group. This
command does not use the options `mh-lpr-command-format' or
`mh-print-background-flag'. See also the commands \\[mh-ps-print-toggle-color]
and \\[mh-ps-print-toggle-faces]."
(interactive (list (mh-interactive-range "Print")))
(mh-ps-print-range range nil))
;;;###mh-autoload
(defun mh-ps-print-msg-file (file range)
"Print to FILE the messages in RANGE.
(defun mh-ps-print-msg-file (range file)
"Print the messages in RANGE to FILE\\<mh-folder-mode-map>.
Check the documentation of `mh-interactive-range' to see how RANGE is read in
interactive use."
(interactive (list
(mh-ps-print-preprint 1)
(mh-interactive-range "Print")))
(mh-iterate-on-range msg range
(let ((buffer (get-buffer-create mh-temp-buffer)))
(unwind-protect
(mh-ps-spool-a-msg msg buffer)
(kill-buffer buffer)))
(mh-notate nil mh-note-printed mh-cmd-note))
(ps-despool file))
interactive use.
;;;###mh-autoload
(defun mh-ps-print-msg-show (file)
"Print current show buffer to FILE."
(interactive (list (mh-ps-print-preprint current-prefix-arg)))
(let ((msg (mh-get-msg-num t))
(folder mh-current-folder)
(show-buffer mh-show-buffer)
(show-window (get-buffer-window mh-show-buffer)))
(if (and show-buffer show-window)
(mh-in-show-buffer (show-buffer)
(if (equal (mh-msg-filename msg folder) buffer-file-name)
(progn
(mh-ps-spool-buffer show-buffer)
(ps-despool file))
(message "Current message is not being shown(1)")))
(message "Current message is not being shown(2)"))))
This command will print inline text attachments but will not decrypt messages.
However, when a message is displayed in an MH-Show buffer, then that buffer is
used verbatim for printing with the caveat that only text attachments, if
opened inline, are printed. Therefore, encrypted messages can be printed by
showing and decrypting them first.
MH-E uses the \"ps-print\" package to do the printing, so you can customize
the printing further by going to the `ps-print' customization group. This
command does not use the options `mh-lpr-command-format' or
`mh-print-background-flag'. See also the commands \\[mh-ps-print-toggle-color]
and \\[mh-ps-print-toggle-faces]."
(interactive (list (mh-interactive-range "Print") (mh-ps-print-preprint 1)))
(mh-ps-print-range range file))
;;;###mh-autoload
(defun mh-ps-print-toggle-faces ()
"Toggle whether printing is done with faces or not."
"Toggle whether printing is done with faces or not.
When faces are enabled, the printed message will look very similar to the
message in the MH-Show buffer."
(interactive)
(if (eq mh-ps-print-func 'ps-spool-buffer-with-faces)
(progn
......@@ -173,7 +161,15 @@ interactive use."
;;;###mh-autoload
(defun mh-ps-print-toggle-color ()
"Toggle whether color is used in printing messages."
"Toggle whether color is used in printing messages.
Colors are emulated on black-and-white printers with shades of gray. This
might produce illegible output, even if your screen colors only use shades of
gray. If this is the case, try using this command to toggle between color, no
color, and a black and white representation of the colors and see which works
best. You change this setting permanently by customizing the option
`ps-print-color-p'."
(interactive)
(if (eq mh-ps-print-color-option nil)
(progn
......@@ -186,36 +182,18 @@ interactive use."
(setq mh-ps-print-color-option nil)