comparison lisp/mh-e/mh-mime.el @ 67246:bce5c0d2041c

* 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.
author Bill Wohler <wohler@newt.com>
date Fri, 02 Dec 2005 05:54:33 +0000
parents 06ed4e88d849
children 3a8785724cca
comparison
equal deleted inserted replaced
67245:4b8cea82e2d9 67246:bce5c0d2041c
797 (defvar mh-mime-save-parts-directory nil 797 (defvar mh-mime-save-parts-directory nil
798 "Default to use for `mh-mime-save-parts-default-directory'. 798 "Default to use for `mh-mime-save-parts-default-directory'.
799 Set from last use.") 799 Set from last use.")
800 800
801 ;;;###mh-autoload 801 ;;;###mh-autoload
802 (defun mh-mime-save-parts (arg) 802 (defun mh-mime-save-parts (prompt)
803 "Store the MIME parts of the current message. 803 "Save attachments.
804 If ARG, prompt for directory, else use that specified by the variable 804
805 `mh-mime-save-parts-default-directory'. These directories may be superseded by 805 You can save all of the attachments at once with this command. The attachments
806 MH profile components, since this function calls on mhstore to do the work." 806 are saved in the directory specified by the option
807 `mh-mime-save-parts-default-directory' unless you use a prefix argument PROMPT
808 in which case you are prompted for the directory. These directories may be
809 superseded by MH profile components, since this function calls on
810 \"mhstore\" (\"mhn\") to do the work."
807 (interactive "P") 811 (interactive "P")
808 (let ((msg (if (eq major-mode 'mh-show-mode) 812 (let ((msg (if (eq major-mode 'mh-show-mode)
809 (mh-show-buffer-message-number) 813 (mh-show-buffer-message-number)
810 (mh-get-msg-num t))) 814 (mh-get-msg-num t)))
811 (folder (if (eq major-mode 'mh-show-mode) 815 (folder (if (eq major-mode 'mh-show-mode)
812 mh-show-folder-buffer 816 mh-show-folder-buffer
813 mh-current-folder)) 817 mh-current-folder))
814 (command (if (mh-variant-p 'nmh) "mhstore" "mhn")) 818 (command (if (mh-variant-p 'nmh) "mhstore" "mhn"))
815 (directory 819 (directory
816 (cond 820 (cond
817 ((and (or arg 821 ((and (or prompt
818 (equal nil mh-mime-save-parts-default-directory) 822 (equal nil mh-mime-save-parts-default-directory)
819 (equal t mh-mime-save-parts-default-directory)) 823 (equal t mh-mime-save-parts-default-directory))
820 (not mh-mime-save-parts-directory)) 824 (not mh-mime-save-parts-directory))
821 (read-file-name "Store in directory: " nil nil t nil)) 825 (read-file-name "Store in directory: " nil nil t nil))
822 ((and (or arg 826 ((and (or prompt
823 (equal t mh-mime-save-parts-default-directory)) 827 (equal t mh-mime-save-parts-default-directory))
824 mh-mime-save-parts-directory) 828 mh-mime-save-parts-directory)
825 (read-file-name (format 829 (read-file-name (format
826 "Store in directory: [%s] " 830 "Store in directory: [%s] "
827 mh-mime-save-parts-directory) 831 mh-mime-save-parts-directory)
875 (gnus-strip-whitespace cte)))) 879 (gnus-strip-whitespace cte))))
876 (car ct)))))) 880 (car ct))))))
877 881
878 ;;;###mh-autoload 882 ;;;###mh-autoload
879 (defun mh-toggle-mh-decode-mime-flag () 883 (defun mh-toggle-mh-decode-mime-flag ()
880 "Toggle whether MH-E should decode MIME or not." 884 "Toggle the value of `mh-decode-mime-flag'."
881 (interactive) 885 (interactive)
882 (setq mh-decode-mime-flag (not mh-decode-mime-flag)) 886 (setq mh-decode-mime-flag (not mh-decode-mime-flag))
883 (mh-show nil t) 887 (mh-show nil t)
884 (message "(setq mh-decode-mime-flag %s)" mh-decode-mime-flag)) 888 (message "%s" (if mh-decode-mime-flag
889 "Processing attachments normally"
890 "Displaying raw message")))
885 891
886 ;;;###mh-autoload 892 ;;;###mh-autoload
887 (defun mh-decode-message-header () 893 (defun mh-decode-message-header ()
888 "Decode RFC2047 encoded message header fields." 894 "Decode RFC2047 encoded message header fields."
889 (when mh-decode-mime-flag 895 (when mh-decode-mime-flag
1182 (equal (mm-handle-media-supertype handle) 1188 (equal (mm-handle-media-supertype handle)
1183 "image")) 1189 "image"))
1184 (goto-char (point-min)) 1190 (goto-char (point-min))
1185 (delete-char 1)) 1191 (delete-char 1))
1186 (when (equal (mm-handle-media-supertype handle) "text") 1192 (when (equal (mm-handle-media-supertype handle) "text")
1187 (when (eq mh-highlight-citation-p 'gnus) 1193 (when (eq mh-highlight-citation-style 'gnus)
1188 (mh-gnus-article-highlight-citation)) 1194 (mh-gnus-article-highlight-citation))
1189 (mh-display-smileys) 1195 (mh-display-smileys)
1190 (mh-display-emphasis) 1196 (mh-display-emphasis)
1191 (mh-signature-highlight handle)) 1197 (mh-signature-highlight handle))
1192 (setq region (cons (progn (goto-char (point-min)) 1198 (setq region (cons (progn (goto-char (point-min))
1203 (add-text-properties (line-beginning-position) (line-end-position) 1209 (add-text-properties (line-beginning-position) (line-end-position)
1204 `(mh-region ,region))))))) 1210 `(mh-region ,region)))))))
1205 1211
1206 ;;;###mh-autoload 1212 ;;;###mh-autoload
1207 (defun mh-press-button () 1213 (defun mh-press-button ()
1208 "Press MIME button. 1214 "View contents of button.
1209 If the MIME part is visible then it is removed. Otherwise the part is 1215
1210 displayed." 1216 This command is a toggle so if you use it again on the same attachment, the
1217 attachment is hidden."
1211 (interactive) 1218 (interactive)
1212 (let ((mm-inline-media-tests mh-mm-inline-media-tests) 1219 (let ((mm-inline-media-tests mh-mm-inline-media-tests)
1213 (data (get-text-property (point) 'mh-data)) 1220 (data (get-text-property (point) 'mh-data))
1214 (function (get-text-property (point) 'mh-callback)) 1221 (function (get-text-property (point) 'mh-callback))
1215 (buffer-read-only nil) 1222 (buffer-read-only nil)
1277 (goto-char point) 1284 (goto-char point)
1278 (set-buffer-modified-p nil))) 1285 (set-buffer-modified-p nil)))
1279 1286
1280 ;;;###mh-autoload 1287 ;;;###mh-autoload
1281 (defun mh-display-with-external-viewer (part-index) 1288 (defun mh-display-with-external-viewer (part-index)
1282 "View MIME PART-INDEX externally." 1289 "View attachment externally.
1290
1291 If Emacs does not know how to view an attachment, you could save it into a
1292 file and then run some program to open it. It is easier, however, to launch
1293 the program directly from MH-E with this command. While you'll most likely use
1294 this to view spreadsheets and documents, it is also useful to use your browser
1295 to view HTML attachments with higher fidelity than what Emacs can provide.
1296
1297 This command displays the attachment associated with the button under the
1298 cursor. If the cursor is not located over a button, then the cursor first
1299 moves to the next button, wrapping to the beginning of the message if
1300 necessary. You can provide a numeric prefix argument PART-INDEX to view the
1301 attachment labeled with that number.
1302
1303 This command tries to provide a reasonable default for the viewer by calling
1304 the Emacs function `mailcap-mime-info'. This function usually reads the file
1305 \"/etc/mailcap\"."
1283 (interactive "P") 1306 (interactive "P")
1284 (when (consp part-index) (setq part-index (car part-index))) 1307 (when (consp part-index) (setq part-index (car part-index)))
1285 (mh-folder-mime-action 1308 (mh-folder-mime-action
1286 part-index 1309 part-index
1287 #'(lambda () 1310 #'(lambda ()
1288 (let* ((part (get-text-property (point) 'mh-data)) 1311 (let* ((part (get-text-property (point) 'mh-data))
1289 (type (mm-handle-media-type part)) 1312 (type (mm-handle-media-type part))
1290 (methods (mapcar (lambda (x) (list (cdr (assoc 'viewer x)))) 1313 (methods (mapcar (lambda (x) (list (cdr (assoc 'viewer x))))
1291 (mailcap-mime-info type 'all))) 1314 (mailcap-mime-info type 'all)))
1292 (def (caar methods)) 1315 (def (caar methods))
1293 (prompt (format "Viewer: %s" (if def (format "[%s] " def) ""))) 1316 (prompt (format "Viewer%s: " (if def
1317 (format " (default %s)" def)
1318 "")))
1294 (method (completing-read prompt methods nil nil nil nil def)) 1319 (method (completing-read prompt methods nil nil nil nil def))
1295 (folder mh-show-folder-buffer) 1320 (folder mh-show-folder-buffer)
1296 (buffer-read-only nil)) 1321 (buffer-read-only nil))
1297 (when (string-match "^[^% \t]+$" method) 1322 (when (string-match "^[^% \t]+$" method)
1298 (setq method (concat method " %s"))) 1323 (setq method (concat method " %s")))
1462 (t 1487 (t
1463 (mh-start-of-uncleaned-message))) 1488 (mh-start-of-uncleaned-message)))
1464 (mh-decode-message-header) 1489 (mh-decode-message-header)
1465 (mh-show-addr) 1490 (mh-show-addr)
1466 ;; The other highlighting types don't need anything special 1491 ;; The other highlighting types don't need anything special
1467 (when (eq mh-highlight-citation-p 'gnus) 1492 (when (eq mh-highlight-citation-style 'gnus)
1468 (mh-gnus-article-highlight-citation)) 1493 (mh-gnus-article-highlight-citation))
1469 (goto-char (point-min)) 1494 (goto-char (point-min))
1470 (insert "\n------- Forwarded Message\n\n") 1495 (insert "\n------- Forwarded Message\n\n")
1471 (mh-display-smileys) 1496 (mh-display-smileys)
1472 (mh-display-emphasis) 1497 (mh-display-emphasis)