diff options
| author | Bill Wohler | 2005-10-23 21:26:17 +0000 |
|---|---|---|
| committer | Bill Wohler | 2005-10-23 21:26:17 +0000 |
| commit | 0c47b17c563d364cfbd1936dbcd62d271e4d4c39 (patch) | |
| tree | e2be48197c7f31fdbb65ea0315fd74db6ce282dc | |
| parent | a4b0e228b6576d8926e6272d8edd733155c3e03a (diff) | |
| download | emacs-0c47b17c563d364cfbd1936dbcd62d271e4d4c39.tar.gz emacs-0c47b17c563d364cfbd1936dbcd62d271e4d4c39.zip | |
* mh-comp.el (mh-letter-menu): Rename
mh-mhn-compose-external-compressed-tar to
mh-mh-compose-external-compressed-tar. Rename mh-mhn-compose-anon-ftp
to mh-mh-compose-anon-ftp. Rename mh-edit-mhn to mh-mh-to-mime. Rename
mh-mhn-directive-present-p to mh-mh-directive-present-p. Rename
mh-revert-mhn-edit to mh-mh-to-mime-undo. Rename
mh-gnus-pgp-support-flag to mh-pgp-support-flag. Rename
mh-compose-insertion value from 'mhn to 'mh.
(mh-insert-signature): Rename mh-mhn-directive-present-p to
mh-mh-directive-present-p.
(mh-send-letter): Rename mh-mhn-directive-present-p to
mh-mh-directive-present-p. Rename mh-edit-mhn to mh-mh-to-mime.
(mh-letter-mode-map): Rename mh-edit-mhn to mh-mh-to-mime. Rename
mh-mhn-compose-anon-ftp to mh-mh-compose-anon-ftp. Rename
mh-mhn-compose-external-compressed-tar to
mh-mh-compose-external-compressed-tar. Rename mh-revert-mhn-edit to
mh-mh-to-mime-undo. Rename mh-mhn-compose-external-type to
mh-mh-compose-external-type. Rename mh-mhn-compose-anon-ftp to
mh-mh-compose-anon-ftp. Rename mh-mhn-compose-external-compressed-tar
to mh-mh-compose-external-compressed-tar. Rename mh-revert-mhn-edit to
mh-mh-to-mime-undo. Rename mh-mhn-compose-external-type to
mh-mh-compose-external-type.
(mh-send-letter, mh-letter-mode-map): Rename mh-edit-mhn to
mh-mh-to-mime, mh-revert-mhn-edit to mh-mh-to-mime-undo.
(mh-reply, mh-yank-cur-msg, mh-insert-prefix-string): Rename
mh-yank-from-start-of-msg to mh-yank-behavior. (mh-letter-mode,
mh-to-field, mh-to-fcc, mh-insert-signature) (mh-check-whom,
mh-insert-auto-fields, mh-send-letter) (mh-insert-letter,
mh-yank-cur-msg, mh-insert-prefix-string) (mh-fully-kill-draft,
mh-open-line, mh-letter-complete) (mh-letter-complete-or-space,
mh-letter-confirm-address) (mh-letter-next-header-field-or-indent)
(mh-letter-previous-header-field)
(mh-letter-toggle-header-field-display): Sync docstrings with manual.
* mh-customize.el (mh-edit-mhn-hook): Rename to mh-mh-to-mime-hook.
(mh-yank-from-start-of-msg): Rename to mh-yank-behavior.
(mh-compose-insertion): Rename values from 'gnus and 'mhn to 'mh and
user-visible values from mhn and Gnus to MH and MML.
(mh-before-send-letter-hook): Added 'ispell-message option.
(mh-mml-method-default): Rename mh-gnus-pgp-support-flag to
mh-pgp-support-flag. (mh-compose-insertion,
mh-compose-space-does-completion-flag)
(mh-delete-yanked-msg-window-flag) (mh-extract-from-attribution-verb,
mh-ins-buf-prefix) (mh-letter-complete-function,
mh-letter-fill-column) (mh-mml-method-default, mh-signature-file-name)
(mh-signature-separator-flag, mh-x-face-file) (mh-yank-behavior,
mail-citation-hook)
(mh-before-send-letter-hook, mh-mh-to-mime-hook): Sync docstrings with
manual.
* mh-gnus.el (mml-minibuffer-read-disposition): New function provided
for Emacs 21 environments that lack it.
* mh-mime.el (mh-mml-query-cryptographic-method): Use default prompt
convention.
(mh-compose-forward): mh-mh-forward-message requires string arg.
(mh-minibuffer-read-type): New function.
(mh-mhn-args): Rename to mh-mh-to-mime-args.
(mh-mhn-compose-insertion): Rename to mh-mh-attach-file.
(mh-mhn-compose-forw): Rename to mh-mh-forward-message.
(mh-mhn-compose-type): Rename to mh-mh-compose-type.
(mh-mhn-compose-anon-ftp): Rename to mh-mh-compose-anon-ftp. Rename
mh-mhn-compose-external-type to mh-mh-compose-external-type.
(mh-mhn-compose-external-compressed-tar): Rename to
mh-mh-compose-external-compressed-tar. Rename
mh-mhn-compose-external-type to mh-mh-compose-external-type.
(mh-mhn-compose-external-type): Rename to mh-mh-compose-external-type.
(mh-edit-mhn): Rename to mh-mh-to-mime. Rename mh-mhn-args to
mh-mh-to-mime-args. Rename mh-edit-mhn-hook to mh-mh-to-mime-hook. Use
correct program in message.
(mh-mhn-directive-present-p): Rename to mh-mh-directive-present-p.
(mh-mml-directive-present-p): Rename to mh-mml-tag-present-p.
(mh-compose-forward, mh-mh-attach-file) (mh-mh-compose-anon-ftp,
mh-mh-compose-external-compressed-tar) (mh-mh-compose-external-type,
mh-mh-forward-message)
(mh-mml-attach-file): Use mml-minibuffer-read-description,
mh-minibuffer-read-type.
(mh-mime-content-types): Moved comment about only being used in Emacs
20 to docstring.
(mh-mh-compose-external-type): Rename extra-param argument to
parameters. (mh-mml-to-mime, mh-secure-message)
(mh-mml-unsecure-message, mh-mime-display-part)
(mh-mime-display-single): Rename mh-gnus-pgp-support-flag to
mh-pgp-support-flag.
(mh-compose-insertion): Rename mh-mhn-compose-insertion to
mh-mh-attach-file.
(mh-compose-forward): Rename mh-mhn-compose-forw to
mh-mh-forward-message.
(mh-mhn-compose-insertion): Rename mh-mhn-compose-type to
mh-mh-compose-type. (mh-compose-insertion, mh-compose-forward,
mh-mh-to-mime-args) (mh-mh-attach-file, mh-mh-compose-type)
(mh-mh-compose-anon-ftp, mh-mh-compose-external-compressed-tar)
(mh-mh-compose-external-compressed-tar) (mh-mh-compose-external-type,
mh-mh-forward-message) (mh-mh-to-mime, mh-mh-quote-unescaped-sharp,
(mh-mh-to-mime-undo, mh-mh-directive-present-p, mh-mml-to-mime)
(mh-mml-attach-file, mh-secure-message, mh-mml-unsecure-message)
(mh-mml-secure-message-sign, mh-mml-secure-message-encrypt)
(mh-mml-directive-present-p, mh-destroy-postponed-handles)
(mh-display-smileys, mh-display-emphasis, mh-mime-save-parts): Sync
docstrings with manual.
* mh-utils.el (mh-gnus-pgp-support-flag): Rename to
mh-pgp-support-flag.
| -rw-r--r-- | lisp/mh-e/ChangeLog | 117 | ||||
| -rw-r--r-- | lisp/mh-e/mh-comp.el | 280 | ||||
| -rw-r--r-- | lisp/mh-e/mh-customize.el | 190 | ||||
| -rw-r--r-- | lisp/mh-e/mh-gnus.el | 37 | ||||
| -rw-r--r-- | lisp/mh-e/mh-mime.el | 422 | ||||
| -rw-r--r-- | lisp/mh-e/mh-utils.el | 14 |
6 files changed, 625 insertions, 435 deletions
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index 1f37898af76..b3434f6d001 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog | |||
| @@ -1,3 +1,120 @@ | |||
| 1 | 2005-10-23 Bill Wohler <wohler@newt.com> | ||
| 2 | |||
| 3 | * mh-comp.el (mh-letter-menu): Rename | ||
| 4 | mh-mhn-compose-external-compressed-tar to | ||
| 5 | mh-mh-compose-external-compressed-tar. Rename | ||
| 6 | mh-mhn-compose-anon-ftp to mh-mh-compose-anon-ftp. Rename | ||
| 7 | mh-edit-mhn to mh-mh-to-mime. Rename mh-mhn-directive-present-p to | ||
| 8 | mh-mh-directive-present-p. Rename mh-revert-mhn-edit to | ||
| 9 | mh-mh-to-mime-undo. Rename mh-gnus-pgp-support-flag to | ||
| 10 | mh-pgp-support-flag. Rename mh-compose-insertion value from 'mhn | ||
| 11 | to 'mh. | ||
| 12 | (mh-insert-signature): Rename mh-mhn-directive-present-p to | ||
| 13 | mh-mh-directive-present-p. | ||
| 14 | (mh-send-letter): Rename mh-mhn-directive-present-p to | ||
| 15 | mh-mh-directive-present-p. Rename mh-edit-mhn to mh-mh-to-mime. | ||
| 16 | (mh-letter-mode-map): Rename mh-edit-mhn to mh-mh-to-mime. Rename | ||
| 17 | mh-mhn-compose-anon-ftp to mh-mh-compose-anon-ftp. Rename | ||
| 18 | mh-mhn-compose-external-compressed-tar to | ||
| 19 | mh-mh-compose-external-compressed-tar. Rename mh-revert-mhn-edit | ||
| 20 | to mh-mh-to-mime-undo. Rename mh-mhn-compose-external-type to | ||
| 21 | mh-mh-compose-external-type. Rename mh-mhn-compose-anon-ftp to | ||
| 22 | mh-mh-compose-anon-ftp. Rename | ||
| 23 | mh-mhn-compose-external-compressed-tar to | ||
| 24 | mh-mh-compose-external-compressed-tar. Rename mh-revert-mhn-edit | ||
| 25 | to mh-mh-to-mime-undo. Rename mh-mhn-compose-external-type to | ||
| 26 | mh-mh-compose-external-type. | ||
| 27 | (mh-send-letter, mh-letter-mode-map): Rename mh-edit-mhn to | ||
| 28 | mh-mh-to-mime, mh-revert-mhn-edit to mh-mh-to-mime-undo. | ||
| 29 | (mh-reply, mh-yank-cur-msg, mh-insert-prefix-string): Rename | ||
| 30 | mh-yank-from-start-of-msg to mh-yank-behavior. | ||
| 31 | (mh-letter-mode, mh-to-field, mh-to-fcc, mh-insert-signature) | ||
| 32 | (mh-check-whom, mh-insert-auto-fields, mh-send-letter) | ||
| 33 | (mh-insert-letter, mh-yank-cur-msg, mh-insert-prefix-string) | ||
| 34 | (mh-fully-kill-draft, mh-open-line, mh-letter-complete) | ||
| 35 | (mh-letter-complete-or-space, mh-letter-confirm-address) | ||
| 36 | (mh-letter-next-header-field-or-indent) | ||
| 37 | (mh-letter-previous-header-field) | ||
| 38 | (mh-letter-toggle-header-field-display): Sync docstrings with | ||
| 39 | manual. | ||
| 40 | |||
| 41 | * mh-customize.el (mh-edit-mhn-hook): Rename to | ||
| 42 | mh-mh-to-mime-hook. | ||
| 43 | (mh-yank-from-start-of-msg): Rename to mh-yank-behavior. | ||
| 44 | (mh-compose-insertion): Rename values from 'gnus and 'mhn to 'mh | ||
| 45 | and user-visible values from mhn and Gnus to MH and MML. | ||
| 46 | (mh-before-send-letter-hook): Added 'ispell-message option. | ||
| 47 | (mh-mml-method-default): Rename mh-gnus-pgp-support-flag to | ||
| 48 | mh-pgp-support-flag. | ||
| 49 | (mh-compose-insertion, mh-compose-space-does-completion-flag) | ||
| 50 | (mh-delete-yanked-msg-window-flag) | ||
| 51 | (mh-extract-from-attribution-verb, mh-ins-buf-prefix) | ||
| 52 | (mh-letter-complete-function, mh-letter-fill-column) | ||
| 53 | (mh-mml-method-default, mh-signature-file-name) | ||
| 54 | (mh-signature-separator-flag, mh-x-face-file) | ||
| 55 | (mh-yank-behavior, mail-citation-hook) | ||
| 56 | (mh-before-send-letter-hook, mh-mh-to-mime-hook): Sync docstrings | ||
| 57 | with manual. | ||
| 58 | |||
| 59 | * mh-gnus.el (mml-minibuffer-read-disposition): New function | ||
| 60 | provided for Emacs 21 environments that lack it. | ||
| 61 | |||
| 62 | * mh-mime.el (mh-mml-query-cryptographic-method): Use default | ||
| 63 | prompt convention. | ||
| 64 | (mh-compose-forward): mh-mh-forward-message requires string arg. | ||
| 65 | (mh-minibuffer-read-type): New function. | ||
| 66 | (mh-mhn-args): Rename to mh-mh-to-mime-args. | ||
| 67 | (mh-mhn-compose-insertion): Rename to mh-mh-attach-file. | ||
| 68 | (mh-mhn-compose-forw): Rename to mh-mh-forward-message. | ||
| 69 | (mh-mhn-compose-type): Rename to mh-mh-compose-type. | ||
| 70 | (mh-mhn-compose-anon-ftp): Rename to mh-mh-compose-anon-ftp. | ||
| 71 | Rename mh-mhn-compose-external-type to | ||
| 72 | mh-mh-compose-external-type. | ||
| 73 | (mh-mhn-compose-external-compressed-tar): Rename to | ||
| 74 | mh-mh-compose-external-compressed-tar. Rename | ||
| 75 | mh-mhn-compose-external-type to mh-mh-compose-external-type. | ||
| 76 | (mh-mhn-compose-external-type): Rename to | ||
| 77 | mh-mh-compose-external-type. | ||
| 78 | (mh-edit-mhn): Rename to mh-mh-to-mime. Rename mh-mhn-args to | ||
| 79 | mh-mh-to-mime-args. Rename mh-edit-mhn-hook to mh-mh-to-mime-hook. | ||
| 80 | Use correct program in message. | ||
| 81 | (mh-mhn-directive-present-p): Rename to mh-mh-directive-present-p. | ||
| 82 | (mh-mml-directive-present-p): Rename to mh-mml-tag-present-p. | ||
| 83 | (mh-compose-forward, mh-mh-attach-file) | ||
| 84 | (mh-mh-compose-anon-ftp, mh-mh-compose-external-compressed-tar) | ||
| 85 | (mh-mh-compose-external-type, mh-mh-forward-message) | ||
| 86 | (mh-mml-attach-file): Use mml-minibuffer-read-description, | ||
| 87 | mh-minibuffer-read-type. | ||
| 88 | (mh-mime-content-types): Moved comment about only being used in | ||
| 89 | Emacs 20 to docstring. | ||
| 90 | (mh-mh-compose-external-type): Rename extra-param argument to | ||
| 91 | parameters. | ||
| 92 | (mh-mml-to-mime, mh-secure-message) | ||
| 93 | (mh-mml-unsecure-message, mh-mime-display-part) | ||
| 94 | (mh-mime-display-single): Rename mh-gnus-pgp-support-flag to | ||
| 95 | mh-pgp-support-flag. | ||
| 96 | (mh-compose-insertion): Rename mh-mhn-compose-insertion to | ||
| 97 | mh-mh-attach-file. | ||
| 98 | (mh-compose-forward): Rename mh-mhn-compose-forw to | ||
| 99 | mh-mh-forward-message. | ||
| 100 | (mh-mhn-compose-insertion): Rename mh-mhn-compose-type to | ||
| 101 | mh-mh-compose-type. | ||
| 102 | (mh-compose-insertion, mh-compose-forward, mh-mh-to-mime-args) | ||
| 103 | (mh-mh-attach-file, mh-mh-compose-type) | ||
| 104 | (mh-mh-compose-anon-ftp, mh-mh-compose-external-compressed-tar) | ||
| 105 | (mh-mh-compose-external-compressed-tar) | ||
| 106 | (mh-mh-compose-external-type, mh-mh-forward-message) | ||
| 107 | (mh-mh-to-mime, mh-mh-quote-unescaped-sharp, | ||
| 108 | (mh-mh-to-mime-undo, mh-mh-directive-present-p, mh-mml-to-mime) | ||
| 109 | (mh-mml-attach-file, mh-secure-message, mh-mml-unsecure-message) | ||
| 110 | (mh-mml-secure-message-sign, mh-mml-secure-message-encrypt) | ||
| 111 | (mh-mml-directive-present-p, mh-destroy-postponed-handles) | ||
| 112 | (mh-display-smileys, mh-display-emphasis, mh-mime-save-parts): | ||
| 113 | Sync docstrings with manual. | ||
| 114 | |||
| 115 | * mh-utils.el (mh-gnus-pgp-support-flag): Rename to | ||
| 116 | mh-pgp-support-flag. | ||
| 117 | |||
| 1 | 2005-10-17 Peter S Galbraith <psg@debian.org> | 118 | 2005-10-17 Peter S Galbraith <psg@debian.org> |
| 2 | 119 | ||
| 3 | * mh-identity.el (mh-identity-field-handler): Use | 120 | * mh-identity.el (mh-identity-field-handler): Use |
diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el index 753f4ad50aa..6d26fae36a5 100644 --- a/lisp/mh-e/mh-comp.el +++ b/lisp/mh-e/mh-comp.el | |||
| @@ -350,8 +350,8 @@ See also `mh-send'." | |||
| 350 | (mh-forwarded-letter-subject orig-from orig-subject))) | 350 | (mh-forwarded-letter-subject orig-from orig-subject))) |
| 351 | (mh-insert-fields "Subject:" forw-subject) | 351 | (mh-insert-fields "Subject:" forw-subject) |
| 352 | (goto-char (point-min)) | 352 | (goto-char (point-min)) |
| 353 | ;; If using MML, translate mhn | 353 | ;; If using MML, translate MH-style directive |
| 354 | (if (equal mh-compose-insertion 'gnus) | 354 | (if (equal mh-compose-insertion 'mml) |
| 355 | (save-excursion | 355 | (save-excursion |
| 356 | (goto-char (mh-mail-header-end)) | 356 | (goto-char (mh-mail-header-end)) |
| 357 | (while | 357 | (while |
| @@ -527,8 +527,8 @@ See also `mh-send'." | |||
| 527 | (group-reply (if (mh-variant-p 'nmh 'mu-mh) | 527 | (group-reply (if (mh-variant-p 'nmh 'mu-mh) |
| 528 | '("-group" "-nocc" "me") | 528 | '("-group" "-nocc" "me") |
| 529 | '("-cc" "all" "-nocc" "me")))) | 529 | '("-cc" "all" "-nocc" "me")))) |
| 530 | (cond ((or (eq mh-yank-from-start-of-msg 'autosupercite) | 530 | (cond ((or (eq mh-yank-behavior 'autosupercite) |
| 531 | (eq mh-yank-from-start-of-msg 'autoattrib)) | 531 | (eq mh-yank-behavior 'autoattrib)) |
| 532 | '("-noformat")) | 532 | '("-noformat")) |
| 533 | (includep '("-filter" "mhl.reply")) | 533 | (includep '("-filter" "mhl.reply")) |
| 534 | (t '()))) | 534 | (t '()))) |
| @@ -551,8 +551,8 @@ See also `mh-send'." | |||
| 551 | (message "Composing a reply...done") | 551 | (message "Composing a reply...done") |
| 552 | (mh-compose-and-send-mail draft "" folder message to subject cc | 552 | (mh-compose-and-send-mail draft "" folder message to subject cc |
| 553 | mh-note-repl "Replied:" config)) | 553 | mh-note-repl "Replied:" config)) |
| 554 | (when (and (or (eq 'autosupercite mh-yank-from-start-of-msg) | 554 | (when (and (or (eq 'autosupercite mh-yank-behavior) |
| 555 | (eq 'autoattrib mh-yank-from-start-of-msg)) | 555 | (eq 'autoattrib mh-yank-behavior)) |
| 556 | (eq (mh-show-buffer-message-number) mh-sent-from-msg)) | 556 | (eq (mh-show-buffer-message-number) mh-sent-from-msg)) |
| 557 | (undo-boundary) | 557 | (undo-boundary) |
| 558 | (mh-yank-cur-msg)) | 558 | (mh-yank-cur-msg)) |
| @@ -788,13 +788,13 @@ Returns t if found, nil if not." | |||
| 788 | ["Insert Signature" mh-insert-signature t] | 788 | ["Insert Signature" mh-insert-signature t] |
| 789 | ("Encrypt/Sign Message" | 789 | ("Encrypt/Sign Message" |
| 790 | ["Sign Message" | 790 | ["Sign Message" |
| 791 | mh-mml-secure-message-sign mh-gnus-pgp-support-flag] | 791 | mh-mml-secure-message-sign mh-pgp-support-flag] |
| 792 | ["Encrypt Message" | 792 | ["Encrypt Message" |
| 793 | mh-mml-secure-message-encrypt mh-gnus-pgp-support-flag] | 793 | mh-mml-secure-message-encrypt mh-pgp-support-flag] |
| 794 | ["Sign+Encrypt Message" | 794 | ["Sign+Encrypt Message" |
| 795 | mh-mml-secure-message-signencrypt mh-gnus-pgp-support-flag] | 795 | mh-mml-secure-message-signencrypt mh-pgp-support-flag] |
| 796 | ["Disable Security" | 796 | ["Disable Security" |
| 797 | mh-mml-unsecure-message mh-gnus-pgp-support-flag] | 797 | mh-mml-unsecure-message mh-pgp-support-flag] |
| 798 | "--" | 798 | "--" |
| 799 | "Security Method" | 799 | "Security Method" |
| 800 | ["PGP (MIME)" (setq mh-mml-method-default "pgpmime") | 800 | ["PGP (MIME)" (setq mh-mml-method-default "pgpmime") |
| @@ -810,19 +810,19 @@ Returns t if found, nil if not." | |||
| 810 | ["Save Method as Default" | 810 | ["Save Method as Default" |
| 811 | (customize-save-variable 'mh-mml-method-default mh-mml-method-default) t] | 811 | (customize-save-variable 'mh-mml-method-default mh-mml-method-default) t] |
| 812 | ) | 812 | ) |
| 813 | ["Compose Insertion (MIME)..." mh-compose-insertion t] | 813 | ["Compose Insertion..." mh-compose-insertion t] |
| 814 | ["Compose Compressed tar (MIME)..." | 814 | ["Compose Compressed tar (MH)..." |
| 815 | mh-mhn-compose-external-compressed-tar t] | 815 | mh-mh-compose-external-compressed-tar t] |
| 816 | ["Compose Get File (MIME)..." mh-mhn-compose-anon-ftp t] | 816 | ["Compose Get File (MH)..." mh-mh-compose-anon-ftp t] |
| 817 | ["Compose Forward (MIME)..." mh-compose-forward t] | 817 | ["Compose Forward..." mh-compose-forward t] |
| 818 | ;; The next two will have to be merged. But I also need to make sure the | 818 | ;; The next two will have to be merged. But I also need to make sure the |
| 819 | ;; user can't mix directives of both types. | 819 | ;; user can't mix tags of both types. |
| 820 | ["Pull in All Compositions (mhn)" | 820 | ["Pull in All Compositions (MH)" |
| 821 | mh-edit-mhn (mh-mhn-directive-present-p)] | 821 | mh-mh-to-mime (mh-mh-directive-present-p)] |
| 822 | ["Pull in All Compositions (gnus)" | 822 | ["Pull in All Compositions (MML)" |
| 823 | mh-mml-to-mime (mh-mml-directive-present-p)] | 823 | mh-mml-to-mime (mh-mml-tag-present-p)] |
| 824 | ["Revert to Non-MIME Edit (mhn)" | 824 | ["Revert to Non-MIME Edit (MH)" |
| 825 | mh-revert-mhn-edit (equal mh-compose-insertion 'mhn)] | 825 | mh-mh-to-mime-undo (equal mh-compose-insertion 'mh)] |
| 826 | ["Kill This Draft" mh-fully-kill-draft t])) | 826 | ["Kill This Draft" mh-fully-kill-draft t])) |
| 827 | 827 | ||
| 828 | ;;; Help Messages | 828 | ;;; Help Messages |
| @@ -878,16 +878,13 @@ work better in MH-Letter mode." | |||
| 878 | When you have finished composing, type \\[mh-send-letter] to send the message | 878 | When you have finished composing, type \\[mh-send-letter] to send the message |
| 879 | using the MH mail handling system. | 879 | using the MH mail handling system. |
| 880 | 880 | ||
| 881 | There are two types of MIME directives used by MH-E: Gnus and MH. The option | 881 | There are two types of tags used by MH-E when composing MIME messages: MML and |
| 882 | `mh-compose-insertion' controls what type of directives are inserted by MH-E | 882 | MH. The option `mh-compose-insertion' controls what type of tags are inserted |
| 883 | commands. These directives can be converted to MIME body parts by running | 883 | by MH-E commands. These tags can be converted to MIME body parts by running |
| 884 | \\[mh-edit-mhn] for mhn directives or \\[mh-mml-to-mime] for Gnus directives. | 884 | \\[mh-mh-to-mime] for MH-style directives or \\[mh-mml-to-mime] for MML tags. |
| 885 | This step is mandatory if these directives are added manually. If the | ||
| 886 | directives are inserted with MH-E commands such as \\[mh-compose-insertion], | ||
| 887 | the directives are expanded automatically when the letter is sent. | ||
| 888 | 885 | ||
| 889 | Options that control this mode can be changed with | 886 | Options that control this mode can be changed with \\[customize-group]; |
| 890 | \\[customize-group]; specify the \"mh-compose\" group. | 887 | specify the \"mh-compose\" group. |
| 891 | 888 | ||
| 892 | When a message is composed, the hooks `text-mode-hook' and | 889 | When a message is composed, the hooks `text-mode-hook' and |
| 893 | `mh-letter-mode-hook' are run. | 890 | `mh-letter-mode-hook' are run. |
| @@ -1016,7 +1013,7 @@ Header is treated specially by inserting a tab before continuation lines." | |||
| 1016 | 1013 | ||
| 1017 | ;;;###mh-autoload | 1014 | ;;;###mh-autoload |
| 1018 | (defun mh-to-field () | 1015 | (defun mh-to-field () |
| 1019 | "Move point to the end of a specified header field. | 1016 | "Move to specified header field. |
| 1020 | The field is indicated by the previous keystroke (the last keystroke | 1017 | The field is indicated by the previous keystroke (the last keystroke |
| 1021 | of the command) according to the list in the variable `mh-to-field-choices'. | 1018 | of the command) according to the list in the variable `mh-to-field-choices'. |
| 1022 | Create the field if it does not exist. Set the mark to point before moving." | 1019 | Create the field if it does not exist. Set the mark to point before moving." |
| @@ -1047,8 +1044,9 @@ Create the field if it does not exist. Set the mark to point before moving." | |||
| 1047 | 1044 | ||
| 1048 | ;;;###mh-autoload | 1045 | ;;;###mh-autoload |
| 1049 | (defun mh-to-fcc (&optional folder) | 1046 | (defun mh-to-fcc (&optional folder) |
| 1050 | "Insert an Fcc: FOLDER field in the current message. | 1047 | "Move to \"Fcc:\" header field. |
| 1051 | Prompt for the field name with a completion list of the current folders." | 1048 | This command will prompt you for the FOLDER name in which to file a copy of |
| 1049 | the draft." | ||
| 1052 | (interactive) | 1050 | (interactive) |
| 1053 | (or folder | 1051 | (or folder |
| 1054 | (setq folder (mh-prompt-for-folder | 1052 | (setq folder (mh-prompt-for-folder |
| @@ -1080,23 +1078,33 @@ Prompt for the field name with a completion list of the current folders." | |||
| 1080 | 1078 | ||
| 1081 | ;;;###mh-autoload | 1079 | ;;;###mh-autoload |
| 1082 | (defun mh-insert-signature (&optional file) | 1080 | (defun mh-insert-signature (&optional file) |
| 1083 | "Insert the signature specified by `mh-signature-file-name' or FILE at point. | 1081 | "Insert signature in message. |
| 1084 | A signature separator (`-- ') will be added if the signature block does not | 1082 | This command inserts your signature at the current cursor location. |
| 1083 | |||
| 1084 | By default, the text of your signature is taken from the file | ||
| 1085 | \"~/.signature\". You can read from other sources by changing the option | ||
| 1086 | `mh-signature-file-name'. | ||
| 1087 | |||
| 1088 | A signature separator (\"-- \") will be added if the signature block does not | ||
| 1085 | contain one and `mh-signature-separator-flag' is on. | 1089 | contain one and `mh-signature-separator-flag' is on. |
| 1090 | |||
| 1086 | The value of `mh-letter-insert-signature-hook' is a list of functions to be | 1091 | The value of `mh-letter-insert-signature-hook' is a list of functions to be |
| 1087 | called, with no arguments, after the signature is inserted. | 1092 | called, with no arguments, after the signature is inserted. These functions |
| 1088 | The signature can also be inserted with `mh-identity-list'." | 1093 | may access the actual name of the file or the function used to insert the |
| 1089 | (interactive) | 1094 | signature with `mh-signature-file-name'. |
| 1095 | |||
| 1096 | The signature can also be inserted using Identities (see `mh-identity-list')" | ||
| 1097 | (interactive) | ||
| 1090 | (save-excursion | 1098 | (save-excursion |
| 1091 | (insert "\n") | 1099 | (insert "\n") |
| 1092 | (let ((mh-signature-file-name (or file mh-signature-file-name)) | 1100 | (let ((mh-signature-file-name (or file mh-signature-file-name)) |
| 1093 | (mh-mhn-p (mh-mhn-directive-present-p)) | 1101 | (mh-mh-p (mh-mh-directive-present-p)) |
| 1094 | (mh-mml-p (mh-mml-directive-present-p))) | 1102 | (mh-mml-p (mh-mml-tag-present-p))) |
| 1095 | (save-restriction | 1103 | (save-restriction |
| 1096 | (narrow-to-region (point) (point)) | 1104 | (narrow-to-region (point) (point)) |
| 1097 | (cond | 1105 | (cond |
| 1098 | ((mh-file-is-vcard-p mh-signature-file-name) | 1106 | ((mh-file-is-vcard-p mh-signature-file-name) |
| 1099 | (if (equal mh-compose-insertion 'gnus) | 1107 | (if (equal mh-compose-insertion 'mml) |
| 1100 | (insert "<#part type=\"text/x-vcard\" filename=\"" | 1108 | (insert "<#part type=\"text/x-vcard\" filename=\"" |
| 1101 | mh-signature-file-name | 1109 | mh-signature-file-name |
| 1102 | "\" disposition=inline description=VCard>\n<#/part>") | 1110 | "\" disposition=inline description=VCard>\n<#/part>") |
| @@ -1105,7 +1113,7 @@ The signature can also be inserted with `mh-identity-list'." | |||
| 1105 | "\" [VCard] " (expand-file-name mh-signature-file-name)))) | 1113 | "\" [VCard] " (expand-file-name mh-signature-file-name)))) |
| 1106 | (t | 1114 | (t |
| 1107 | (cond | 1115 | (cond |
| 1108 | (mh-mhn-p | 1116 | (mh-mh-p |
| 1109 | (insert "#\n" "Content-Description: Signature\n")) | 1117 | (insert "#\n" "Content-Description: Signature\n")) |
| 1110 | (mh-mml-p | 1118 | (mh-mml-p |
| 1111 | (mml-insert-tag 'part 'type "text/plain" 'disposition "inline" | 1119 | (mml-insert-tag 'part 'type "text/plain" 'disposition "inline" |
| @@ -1124,7 +1132,7 @@ The signature can also be inserted with `mh-identity-list'." | |||
| 1124 | mh-signature-separator-flag | 1132 | mh-signature-separator-flag |
| 1125 | (> (point-max) (point-min)) | 1133 | (> (point-max) (point-min)) |
| 1126 | (not (mh-signature-separator-p))) | 1134 | (not (mh-signature-separator-p))) |
| 1127 | (cond (mh-mhn-p | 1135 | (cond (mh-mh-p |
| 1128 | (forward-line 2)) | 1136 | (forward-line 2)) |
| 1129 | (mh-mml-p | 1137 | (mh-mml-p |
| 1130 | (forward-line 1))) | 1138 | (forward-line 1))) |
| @@ -1135,7 +1143,10 @@ The signature can also be inserted with `mh-identity-list'." | |||
| 1135 | 1143 | ||
| 1136 | ;;;###mh-autoload | 1144 | ;;;###mh-autoload |
| 1137 | (defun mh-check-whom () | 1145 | (defun mh-check-whom () |
| 1138 | "Verify recipients of the current letter, showing expansion of any aliases." | 1146 | "Verify recipients, showing expansion of any aliases. |
| 1147 | This command expands aliases so you can check the actual address(es) in the | ||
| 1148 | alias. A new buffer named \"*MH-E Recipients*\" is created with the output of | ||
| 1149 | \"whom\"." | ||
| 1139 | (interactive) | 1150 | (interactive) |
| 1140 | (let ((file-name buffer-file-name)) | 1151 | (let ((file-name buffer-file-name)) |
| 1141 | (save-buffer) | 1152 | (save-buffer) |
| @@ -1215,7 +1226,7 @@ The versions of MH-E, Emacs, and MH are shown." | |||
| 1215 | 1226 | ||
| 1216 | ;;;###mh-autoload | 1227 | ;;;###mh-autoload |
| 1217 | (defun mh-insert-auto-fields (&optional non-interactive) | 1228 | (defun mh-insert-auto-fields (&optional non-interactive) |
| 1218 | "Insert custom fields if To or Cc match `mh-auto-fields-list'. | 1229 | "Insert custom fields if recipient matches `mh-auto-fields-list'. |
| 1219 | Sets buffer-local `mh-insert-auto-fields-done-local' when done and inserted | 1230 | Sets buffer-local `mh-insert-auto-fields-done-local' when done and inserted |
| 1220 | something. If NON-INTERACTIVE is non-nil, do not be verbose and only | 1231 | something. If NON-INTERACTIVE is non-nil, do not be verbose and only |
| 1221 | attempt matches if `mh-insert-auto-fields-done-local' is nil. | 1232 | attempt matches if `mh-insert-auto-fields-done-local' is nil. |
| @@ -1348,12 +1359,17 @@ there." | |||
| 1348 | 1359 | ||
| 1349 | ;;;###mh-autoload | 1360 | ;;;###mh-autoload |
| 1350 | (defun mh-send-letter (&optional arg) | 1361 | (defun mh-send-letter (&optional arg) |
| 1351 | "Send the draft letter in the current buffer. | 1362 | "Save draft and send message. |
| 1352 | If optional prefix argument ARG is provided, monitor delivery. | 1363 | When you are all through editing a message, you send it with this command. You |
| 1353 | The value of `mh-before-send-letter-hook' is a list of functions to be called, | 1364 | can give an argument ARG to monitor the first stage of the delivery\; this |
| 1354 | with no arguments, before doing anything. | 1365 | output can be found in a buffer called \"*MH-E Mail Delivery*\". |
| 1355 | Run `\\[mh-edit-mhn]' if mhn directives are present; otherwise | 1366 | |
| 1356 | run `\\[mh-mml-to-mime]' if mml directives are present." | 1367 | The value of `mh-before-send-letter-hook' is a list of functions to be called |
| 1368 | at the beginning of this command. For example, if you want to check your | ||
| 1369 | spelling in your message before sending, add the `ispell-message' function. | ||
| 1370 | |||
| 1371 | In case the MH \"send\" program is installed under a different name, use | ||
| 1372 | `mh-send-prog' to tell MH-E the name." | ||
| 1357 | (interactive "P") | 1373 | (interactive "P") |
| 1358 | (run-hooks 'mh-before-send-letter-hook) | 1374 | (run-hooks 'mh-before-send-letter-hook) |
| 1359 | (if (and (mh-insert-auto-fields t) | 1375 | (if (and (mh-insert-auto-fields t) |
| @@ -1361,9 +1377,9 @@ run `\\[mh-mml-to-mime]' if mml directives are present." | |||
| 1361 | (goto-char (point-min))) | 1377 | (goto-char (point-min))) |
| 1362 | (if (not (y-or-n-p "Auto fields inserted, send? ")) | 1378 | (if (not (y-or-n-p "Auto fields inserted, send? ")) |
| 1363 | (error "Send aborted"))) | 1379 | (error "Send aborted"))) |
| 1364 | (cond ((mh-mhn-directive-present-p) | 1380 | (cond ((mh-mh-directive-present-p) |
| 1365 | (mh-edit-mhn)) | 1381 | (mh-mh-to-mime)) |
| 1366 | ((or (mh-mml-directive-present-p) (not (mh-ascii-buffer-p))) | 1382 | ((or (mh-mml-tag-present-p) (not (mh-ascii-buffer-p))) |
| 1367 | (mh-mml-to-mime))) | 1383 | (mh-mml-to-mime))) |
| 1368 | (save-buffer) | 1384 | (save-buffer) |
| 1369 | (message "Sending...") | 1385 | (message "Sending...") |
| @@ -1419,15 +1435,16 @@ run `\\[mh-mml-to-mime]' if mml directives are present." | |||
| 1419 | 1435 | ||
| 1420 | ;;;###mh-autoload | 1436 | ;;;###mh-autoload |
| 1421 | (defun mh-insert-letter (folder message verbatim) | 1437 | (defun mh-insert-letter (folder message verbatim) |
| 1422 | "Insert a message into the current letter. | 1438 | "Insert a message. |
| 1423 | Removes the header fields according to the variable | 1439 | This command prompts you for the FOLDER and MESSAGE number and inserts the |
| 1424 | `mh-invisible-header-fields-compiled'. | 1440 | message, indented by `mh-ins-buf-prefix' (\"> \") unless `mh-yank-behavior' is |
| 1425 | Prefixes each non-blank line with `mh-ins-buf-prefix', unless | 1441 | set to one of the supercite flavors in which case supercite is used to format |
| 1426 | `mh-yank-from-start-of-msg' is set for supercite in which case supercite is | 1442 | the message. Certain undesirable header fields (see |
| 1427 | used to format the message. | 1443 | `mh-invisible-header-fields-compiled') are removed before insertion. |
| 1428 | Prompts for FOLDER and MESSAGE. If prefix argument VERBATIM provided, do | 1444 | |
| 1429 | not indent and do not delete headers. Leaves the mark before the letter | 1445 | If given a prefix argument VERBATIM, the header is left intact, the message is |
| 1430 | and point after it." | 1446 | not indented, and \"> \" is not inserted before each line. This command leaves |
| 1447 | the mark before the letter and point after it." | ||
| 1431 | (interactive | 1448 | (interactive |
| 1432 | (list (mh-prompt-for-folder "Message from" mh-sent-from-folder nil) | 1449 | (list (mh-prompt-for-folder "Message from" mh-sent-from-folder nil) |
| 1433 | (read-string (concat "Message number" | 1450 | (read-string (concat "Message number" |
| @@ -1468,13 +1485,25 @@ and point after it." | |||
| 1468 | ;;;###mh-autoload | 1485 | ;;;###mh-autoload |
| 1469 | (defun mh-yank-cur-msg () | 1486 | (defun mh-yank-cur-msg () |
| 1470 | "Insert the current message into the draft buffer. | 1487 | "Insert the current message into the draft buffer. |
| 1471 | Prefix each non-blank line in the message with the string in | 1488 | |
| 1472 | `mh-ins-buf-prefix'. If a region is set in the message's buffer, then | 1489 | It is often useful to insert a snippet of text from a letter that someone |
| 1473 | only the region will be inserted. Otherwise, the entire message will | 1490 | mailed to provide some context for your reply. This command does this by |
| 1474 | be inserted if `mh-yank-from-start-of-msg' is non-nil. If this variable | 1491 | adding an attribution, yanking a portion of text from the message to which |
| 1475 | is nil, the portion of the message following the point will be yanked. | 1492 | you're replying, and inserting `mh-ins-buf-prefix' (`> ') before each line. |
| 1476 | If `mh-delete-yanked-msg-window-flag' is non-nil, any window displaying the | 1493 | |
| 1477 | yanked message will be deleted." | 1494 | The attribution consists of the sender's name and email address |
| 1495 | followed by the content of the `mh-extract-from-attribution-verb' | ||
| 1496 | option. | ||
| 1497 | |||
| 1498 | You can also turn on the `mh-delete-yanked-msg-window-flag' option to delete | ||
| 1499 | the window containing the original message after yanking it to make more room | ||
| 1500 | on your screen for your reply. | ||
| 1501 | |||
| 1502 | You can control how the message to which you are replying is yanked | ||
| 1503 | into your reply using `mh-yank-behavior'. | ||
| 1504 | |||
| 1505 | If this isn't enough, you can gain full control over the appearance of the | ||
| 1506 | included text by setting `mail-citation-hook' to a function that modifies it." | ||
| 1478 | (interactive) | 1507 | (interactive) |
| 1479 | (if (and mh-sent-from-folder | 1508 | (if (and mh-sent-from-folder |
| 1480 | (save-excursion (set-buffer mh-sent-from-folder) mh-show-buffer) | 1509 | (save-excursion (set-buffer mh-sent-from-folder) mh-show-buffer) |
| @@ -1491,9 +1520,9 @@ yanked message will be deleted." | |||
| 1491 | (yank-region (mh-mark-active-p nil)) | 1520 | (yank-region (mh-mark-active-p nil)) |
| 1492 | (mh-ins-str | 1521 | (mh-ins-str |
| 1493 | (cond ((and yank-region | 1522 | (cond ((and yank-region |
| 1494 | (or (eq 'supercite mh-yank-from-start-of-msg) | 1523 | (or (eq 'supercite mh-yank-behavior) |
| 1495 | (eq 'autosupercite mh-yank-from-start-of-msg) | 1524 | (eq 'autosupercite mh-yank-behavior) |
| 1496 | (eq t mh-yank-from-start-of-msg))) | 1525 | (eq t mh-yank-behavior))) |
| 1497 | ;; supercite needs the full header | 1526 | ;; supercite needs the full header |
| 1498 | (concat | 1527 | (concat |
| 1499 | (buffer-substring (point-min) (mh-mail-header-end)) | 1528 | (buffer-substring (point-min) (mh-mail-header-end)) |
| @@ -1501,20 +1530,18 @@ yanked message will be deleted." | |||
| 1501 | (buffer-substring (region-beginning) (region-end)))) | 1530 | (buffer-substring (region-beginning) (region-end)))) |
| 1502 | (yank-region | 1531 | (yank-region |
| 1503 | (buffer-substring (region-beginning) (region-end))) | 1532 | (buffer-substring (region-beginning) (region-end))) |
| 1504 | ((or (eq 'body mh-yank-from-start-of-msg) | 1533 | ((or (eq 'body mh-yank-behavior) |
| 1505 | (eq 'attribution | 1534 | (eq 'attribution mh-yank-behavior) |
| 1506 | mh-yank-from-start-of-msg) | 1535 | (eq 'autoattrib mh-yank-behavior)) |
| 1507 | (eq 'autoattrib | ||
| 1508 | mh-yank-from-start-of-msg)) | ||
| 1509 | (buffer-substring | 1536 | (buffer-substring |
| 1510 | (save-excursion | 1537 | (save-excursion |
| 1511 | (goto-char (point-min)) | 1538 | (goto-char (point-min)) |
| 1512 | (mh-goto-header-end 1) | 1539 | (mh-goto-header-end 1) |
| 1513 | (point)) | 1540 | (point)) |
| 1514 | (point-max))) | 1541 | (point-max))) |
| 1515 | ((or (eq 'supercite mh-yank-from-start-of-msg) | 1542 | ((or (eq 'supercite mh-yank-behavior) |
| 1516 | (eq 'autosupercite mh-yank-from-start-of-msg) | 1543 | (eq 'autosupercite mh-yank-behavior) |
| 1517 | (eq t mh-yank-from-start-of-msg)) | 1544 | (eq t mh-yank-behavior)) |
| 1518 | (buffer-substring (point-min) (point-max))) | 1545 | (buffer-substring (point-min) (point-max))) |
| 1519 | (t | 1546 | (t |
| 1520 | (buffer-substring (point) (point-max)))))) | 1547 | (buffer-substring (point) (point-max)))))) |
| @@ -1526,8 +1553,8 @@ yanked message will be deleted." | |||
| 1526 | (push-mark) ;Needed for sc-cite-original | 1553 | (push-mark) ;Needed for sc-cite-original |
| 1527 | (goto-char (point-min)) ;Needed for sc-cite-original | 1554 | (goto-char (point-min)) ;Needed for sc-cite-original |
| 1528 | (mh-insert-prefix-string mh-ins-buf-prefix) | 1555 | (mh-insert-prefix-string mh-ins-buf-prefix) |
| 1529 | (when (or (eq 'attribution mh-yank-from-start-of-msg) | 1556 | (when (or (eq 'attribution mh-yank-behavior) |
| 1530 | (eq 'autoattrib mh-yank-from-start-of-msg)) | 1557 | (eq 'autoattrib mh-yank-behavior)) |
| 1531 | (insert from-attr) | 1558 | (insert from-attr) |
| 1532 | (mh-identity-insert-attribution-verb nil) | 1559 | (mh-identity-insert-attribution-verb nil) |
| 1533 | (insert "\n\n")) | 1560 | (insert "\n\n")) |
| @@ -1569,12 +1596,12 @@ yanked message will be deleted." | |||
| 1569 | 1596 | ||
| 1570 | (defun mh-insert-prefix-string (mh-ins-string) | 1597 | (defun mh-insert-prefix-string (mh-ins-string) |
| 1571 | "Insert prefix string before each line in buffer. | 1598 | "Insert prefix string before each line in buffer. |
| 1572 | The inserted letter is cited using `sc-cite-original' if | 1599 | The inserted letter is cited using `sc-cite-original' if `mh-yank-behavior' is |
| 1573 | `mh-yank-from-start-of-msg' is one of 'supercite or 'autosupercite. Otherwise, | 1600 | one of 'supercite or 'autosupercite. Otherwise, simply insert MH-INS-STRING |
| 1574 | simply insert MH-INS-STRING before each line." | 1601 | before each line." |
| 1575 | (goto-char (point-min)) | 1602 | (goto-char (point-min)) |
| 1576 | (cond ((or (eq mh-yank-from-start-of-msg 'supercite) | 1603 | (cond ((or (eq mh-yank-behavior 'supercite) |
| 1577 | (eq mh-yank-from-start-of-msg 'autosupercite)) | 1604 | (eq mh-yank-behavior 'autosupercite)) |
| 1578 | (sc-cite-original)) | 1605 | (sc-cite-original)) |
| 1579 | (mail-citation-hook | 1606 | (mail-citation-hook |
| 1580 | (run-hooks 'mail-citation-hook)) | 1607 | (run-hooks 'mail-citation-hook)) |
| @@ -1589,8 +1616,10 @@ simply insert MH-INS-STRING before each line." | |||
| 1589 | 1616 | ||
| 1590 | ;;;###mh-autoload | 1617 | ;;;###mh-autoload |
| 1591 | (defun mh-fully-kill-draft () | 1618 | (defun mh-fully-kill-draft () |
| 1592 | "Kill the draft message file and the draft message buffer. | 1619 | "Quit editing and delete draft message. |
| 1593 | Use \\[kill-buffer] if you don't want to delete the draft message file." | 1620 | If for some reason you are not happy with the draft, you can use the this |
| 1621 | command to kill the draft buffer and delete the draft message. Use the | ||
| 1622 | \\[kill-buffer] command if you don't want to delete the draft message." | ||
| 1594 | (interactive) | 1623 | (interactive) |
| 1595 | (if (y-or-n-p "Kill draft message? ") | 1624 | (if (y-or-n-p "Kill draft message? ") |
| 1596 | (let ((config mh-previous-window-config)) | 1625 | (let ((config mh-previous-window-config)) |
| @@ -1618,8 +1647,10 @@ Use \\[kill-buffer] if you don't want to delete the draft message file." | |||
| 1618 | ;;;###mh-autoload | 1647 | ;;;###mh-autoload |
| 1619 | (defun mh-open-line () | 1648 | (defun mh-open-line () |
| 1620 | "Insert a newline and leave point after it. | 1649 | "Insert a newline and leave point after it. |
| 1621 | In addition, insert newline and quoting characters before text after point. | 1650 | This command is similar to the \\[open-line] command in that it inserts a |
| 1622 | This is useful in breaking up paragraphs in replies." | 1651 | newline after point. It differs in that it also inserts the right number of |
| 1652 | quoting characters and spaces so that the next line begins in the same column | ||
| 1653 | as it was. This is useful when breaking up paragraphs in replies." | ||
| 1623 | (interactive) | 1654 | (interactive) |
| 1624 | (let ((column (current-column)) | 1655 | (let ((column (current-column)) |
| 1625 | (prefix (mh-current-fill-prefix))) | 1656 | (prefix (mh-current-fill-prefix))) |
| @@ -1707,10 +1738,12 @@ Any match found replaces the text from BEGIN to END." | |||
| 1707 | 1738 | ||
| 1708 | (defun mh-letter-complete (arg) | 1739 | (defun mh-letter-complete (arg) |
| 1709 | "Perform completion on header field or word preceding point. | 1740 | "Perform completion on header field or word preceding point. |
| 1710 | If the field contains addresses (for example, `To:' or `Cc:') or folders (for | 1741 | If the field contains addresses (for example, \"To:\" or \"Cc:\") or folders |
| 1711 | example, `Fcc:') then this function will provide alias completion. Elsewhere, | 1742 | \(for example, \"Fcc:\") then this command will provide alias completion. In |
| 1712 | this function runs `mh-letter-complete-function' instead and passes the prefix | 1743 | the body of the message, this command runs `mh-letter-complete-function' |
| 1713 | ARG, if present." | 1744 | instead, which is set to \"'ispell-complete-word\" by default. This command |
| 1745 | takes a prefix argument ARG that is passed to the | ||
| 1746 | `mh-letter-complete-function'." | ||
| 1714 | (interactive "P") | 1747 | (interactive "P") |
| 1715 | (let ((func nil)) | 1748 | (let ((func nil)) |
| 1716 | (cond ((not (mh-in-header-p)) | 1749 | (cond ((not (mh-in-header-p)) |
| @@ -1722,11 +1755,8 @@ ARG, if present." | |||
| 1722 | 1755 | ||
| 1723 | (defun mh-letter-complete-or-space (arg) | 1756 | (defun mh-letter-complete-or-space (arg) |
| 1724 | "Perform completion or insert space. | 1757 | "Perform completion or insert space. |
| 1725 | If `mh-compose-space-does-completion-flag' is nil (the default) a space is | 1758 | Turn on the `mh-compose-space-does-completion-flag' option to use this command |
| 1726 | inserted. | 1759 | to perform completion in the header. Otherwise, a space is inserted. |
| 1727 | |||
| 1728 | Otherwise, if point is in the message header and the preceding character is | ||
| 1729 | not whitespace then do completion. Otherwise insert a space character. | ||
| 1730 | 1760 | ||
| 1731 | ARG is the number of spaces inserted." | 1761 | ARG is the number of spaces inserted." |
| 1732 | (interactive "p") | 1762 | (interactive "p") |
| @@ -1744,7 +1774,10 @@ ARG is the number of spaces inserted." | |||
| 1744 | (t (self-insert-command arg))))) | 1774 | (t (self-insert-command arg))))) |
| 1745 | 1775 | ||
| 1746 | (defun mh-letter-confirm-address () | 1776 | (defun mh-letter-confirm-address () |
| 1747 | "Flash alias expansion if `mh-alias-flash-on-comma' is non-nil." | 1777 | "Flash alias expansion. |
| 1778 | Addresses are separated by a comma\; and when you press the comma, this | ||
| 1779 | command flashes the alias expansion in the minibuffer if | ||
| 1780 | `mh-alias-flash-on-comma' is turned on." | ||
| 1748 | (interactive) | 1781 | (interactive) |
| 1749 | (cond ((not (mh-in-header-p)) (self-insert-command 1)) | 1782 | (cond ((not (mh-in-header-p)) (self-insert-command 1)) |
| 1750 | ((eq (cdr (assoc (mh-letter-header-field-at-point) | 1783 | ((eq (cdr (assoc (mh-letter-header-field-at-point) |
| @@ -1768,8 +1801,12 @@ name." | |||
| 1768 | ;;;###mh-autoload | 1801 | ;;;###mh-autoload |
| 1769 | (defun mh-letter-next-header-field-or-indent (arg) | 1802 | (defun mh-letter-next-header-field-or-indent (arg) |
| 1770 | "Move to next field or indent depending on point. | 1803 | "Move to next field or indent depending on point. |
| 1771 | In the message header, go to the next field. Elsewhere call | 1804 | Within the header of the message, this command moves between fields, but skips |
| 1772 | `indent-relative' as usual with optional prefix ARG." | 1805 | those fields listed in `mh-compose-skipped-header-fields'. After the last |
| 1806 | field, this command then moves point to the message body before cycling back | ||
| 1807 | to the first field. If point is already past the first line of the message | ||
| 1808 | body, then this command indents by calling `indent-relative' with the given | ||
| 1809 | prefix argument ARG." | ||
| 1773 | (interactive "P") | 1810 | (interactive "P") |
| 1774 | (let ((header-end (save-excursion | 1811 | (let ((header-end (save-excursion |
| 1775 | (goto-char (mh-mail-header-end)) | 1812 | (goto-char (mh-mail-header-end)) |
| @@ -1801,7 +1838,10 @@ If we are at the last header field go to the start of the message body." | |||
| 1801 | ;;;###mh-autoload | 1838 | ;;;###mh-autoload |
| 1802 | (defun mh-letter-previous-header-field () | 1839 | (defun mh-letter-previous-header-field () |
| 1803 | "Cycle to the previous header field. | 1840 | "Cycle to the previous header field. |
| 1804 | If we are at the first header field go to the start of the message body." | 1841 | This command moves backwards between the fields and cycles to the body of the |
| 1842 | message after the first field. Unlike the | ||
| 1843 | \\[mh-letter-next-header-field-or-indent] command, it will always take point | ||
| 1844 | to the last field from anywhere in the body." | ||
| 1805 | (interactive) | 1845 | (interactive) |
| 1806 | (let ((header-end (mh-mail-header-end))) | 1846 | (let ((header-end (mh-mail-header-end))) |
| 1807 | (if (>= (point) header-end) | 1847 | (if (>= (point) header-end) |
| @@ -1851,11 +1891,11 @@ except that it is callable from a mouse button." | |||
| 1851 | 1891 | ||
| 1852 | (defun mh-letter-toggle-header-field-display (arg) | 1892 | (defun mh-letter-toggle-header-field-display (arg) |
| 1853 | "Toggle display of header field at point. | 1893 | "Toggle display of header field at point. |
| 1854 | If the header is long or spread over multiple lines then hiding it will show | ||
| 1855 | the first few characters and replace the rest with an ellipsis. | ||
| 1856 | 1894 | ||
| 1857 | If ARG is negative then header is hidden, if positive it is displayed. If ARG | 1895 | Use this command to display ellipsed header fields. This command is a toggle |
| 1858 | is the symbol `long' then keep at most the first 4 lines." | 1896 | so entering it again will hide the field. This command takes a prefix argument |
| 1897 | ARG: if negative then the field is hidden, if positive then the field is | ||
| 1898 | displayed." | ||
| 1859 | (interactive (list nil)) | 1899 | (interactive (list nil)) |
| 1860 | (when (and (mh-in-header-p) | 1900 | (when (and (mh-in-header-p) |
| 1861 | (progn | 1901 | (progn |
| @@ -1881,6 +1921,8 @@ is the symbol `long' then keep at most the first 4 lines." | |||
| 1881 | (remove-text-properties begin end '(invisible nil)) | 1921 | (remove-text-properties begin end '(invisible nil)) |
| 1882 | (search-forward ":" (line-end-position) t) | 1922 | (search-forward ":" (line-end-position) t) |
| 1883 | (mh-letter-skip-leading-whitespace-in-header-field)) | 1923 | (mh-letter-skip-leading-whitespace-in-header-field)) |
| 1924 | ;; XXX Redesign to make usable by user. Perhaps use a positive | ||
| 1925 | ;; numeric prefix to make that many lines visible. | ||
| 1884 | ((eq arg 'long) | 1926 | ((eq arg 'long) |
| 1885 | (end-of-line 4) | 1927 | (end-of-line 4) |
| 1886 | (mh-letter-truncate-header-field end) | 1928 | (mh-letter-truncate-header-field end) |
| @@ -1939,7 +1981,7 @@ Otherwise return the empty string." | |||
| 1939 | "\C-c\C-^" mh-insert-signature ;if no C-s | 1981 | "\C-c\C-^" mh-insert-signature ;if no C-s |
| 1940 | "\C-c\C-c" mh-send-letter | 1982 | "\C-c\C-c" mh-send-letter |
| 1941 | "\C-c\C-d" mh-insert-identity | 1983 | "\C-c\C-d" mh-insert-identity |
| 1942 | "\C-c\C-e" mh-edit-mhn | 1984 | "\C-c\C-e" mh-mh-to-mime |
| 1943 | "\C-c\C-f\C-b" mh-to-field | 1985 | "\C-c\C-f\C-b" mh-to-field |
| 1944 | "\C-c\C-f\C-c" mh-to-field | 1986 | "\C-c\C-f\C-c" mh-to-field |
| 1945 | "\C-c\C-f\C-d" mh-to-field | 1987 | "\C-c\C-f\C-d" mh-to-field |
| @@ -1957,26 +1999,26 @@ Otherwise return the empty string." | |||
| 1957 | "\C-c\C-i" mh-insert-letter | 1999 | "\C-c\C-i" mh-insert-letter |
| 1958 | "\C-c\C-m\C-e" mh-mml-secure-message-encrypt | 2000 | "\C-c\C-m\C-e" mh-mml-secure-message-encrypt |
| 1959 | "\C-c\C-m\C-f" mh-compose-forward | 2001 | "\C-c\C-m\C-f" mh-compose-forward |
| 1960 | "\C-c\C-m\C-g" mh-mhn-compose-anon-ftp | 2002 | "\C-c\C-m\C-g" mh-mh-compose-anon-ftp |
| 1961 | "\C-c\C-m\C-i" mh-compose-insertion | 2003 | "\C-c\C-m\C-i" mh-compose-insertion |
| 1962 | "\C-c\C-m\C-m" mh-mml-to-mime | 2004 | "\C-c\C-m\C-m" mh-mml-to-mime |
| 1963 | "\C-c\C-m\C-n" mh-mml-unsecure-message | 2005 | "\C-c\C-m\C-n" mh-mml-unsecure-message |
| 1964 | "\C-c\C-m\C-s" mh-mml-secure-message-sign | 2006 | "\C-c\C-m\C-s" mh-mml-secure-message-sign |
| 1965 | "\C-c\C-m\C-t" mh-mhn-compose-external-compressed-tar | 2007 | "\C-c\C-m\C-t" mh-mh-compose-external-compressed-tar |
| 1966 | "\C-c\C-m\C-u" mh-revert-mhn-edit | 2008 | "\C-c\C-m\C-u" mh-mh-to-mime-undo |
| 1967 | "\C-c\C-m\C-x" mh-mhn-compose-external-type | 2009 | "\C-c\C-m\C-x" mh-mh-compose-external-type |
| 1968 | "\C-c\C-mee" mh-mml-secure-message-encrypt | 2010 | "\C-c\C-mee" mh-mml-secure-message-encrypt |
| 1969 | "\C-c\C-mes" mh-mml-secure-message-signencrypt | 2011 | "\C-c\C-mes" mh-mml-secure-message-signencrypt |
| 1970 | "\C-c\C-mf" mh-compose-forward | 2012 | "\C-c\C-mf" mh-compose-forward |
| 1971 | "\C-c\C-mg" mh-mhn-compose-anon-ftp | 2013 | "\C-c\C-mg" mh-mh-compose-anon-ftp |
| 1972 | "\C-c\C-mi" mh-compose-insertion | 2014 | "\C-c\C-mi" mh-compose-insertion |
| 1973 | "\C-c\C-mm" mh-mml-to-mime | 2015 | "\C-c\C-mm" mh-mml-to-mime |
| 1974 | "\C-c\C-mn" mh-mml-unsecure-message | 2016 | "\C-c\C-mn" mh-mml-unsecure-message |
| 1975 | "\C-c\C-mse" mh-mml-secure-message-signencrypt | 2017 | "\C-c\C-mse" mh-mml-secure-message-signencrypt |
| 1976 | "\C-c\C-mss" mh-mml-secure-message-sign | 2018 | "\C-c\C-mss" mh-mml-secure-message-sign |
| 1977 | "\C-c\C-mt" mh-mhn-compose-external-compressed-tar | 2019 | "\C-c\C-mt" mh-mh-compose-external-compressed-tar |
| 1978 | "\C-c\C-mu" mh-revert-mhn-edit | 2020 | "\C-c\C-mu" mh-mh-to-mime-undo |
| 1979 | "\C-c\C-mx" mh-mhn-compose-external-type | 2021 | "\C-c\C-mx" mh-mh-compose-external-type |
| 1980 | "\C-c\C-o" mh-open-line | 2022 | "\C-c\C-o" mh-open-line |
| 1981 | "\C-c\C-q" mh-fully-kill-draft | 2023 | "\C-c\C-q" mh-fully-kill-draft |
| 1982 | "\C-c\C-s" mh-insert-signature | 2024 | "\C-c\C-s" mh-insert-signature |
diff --git a/lisp/mh-e/mh-customize.el b/lisp/mh-e/mh-customize.el index d26819d6f63..29a6c62e753 100644 --- a/lisp/mh-e/mh-customize.el +++ b/lisp/mh-e/mh-customize.el | |||
| @@ -762,13 +762,15 @@ installed and you want to use BogoFilter, then you can set this option to | |||
| 762 | 762 | ||
| 763 | ;;; Editing a Draft (:group 'mh-letter) | 763 | ;;; Editing a Draft (:group 'mh-letter) |
| 764 | 764 | ||
| 765 | (defcustom mh-compose-insertion (if (locate-library "mml") 'gnus 'mhn) | 765 | (defcustom mh-compose-insertion (if (locate-library "mml") 'mml 'mh) |
| 766 | "Type of MIME message directives in messages. | 766 | "Type of tags used when composing MIME messages. In addition to MH-style |
| 767 | 767 | directives, MH-E also supports MML (MIME Meta Language) tags. (see Info node | |
| 768 | By default, this option is set to `Gnus' if it is supported. This option can | 768 | `(emacs-mime)Composing'). This option can be used to choose between them. By |
| 769 | also be set manually to `mhn' if mhn directives are preferred." | 769 | default, this option is set to \"MML\" if it is supported since it provides a |
| 770 | :type '(choice (const :tag "Gnus" gnus) | 770 | lot more functionality. This option can also be set to \"MH\" if MH-style |
| 771 | (const :tag "mhn" mhn)) | 771 | directives are preferred." |
| 772 | :type '(choice (const :tag "MML" mml) | ||
| 773 | (const :tag "MH" mh)) | ||
| 772 | :group 'mh-letter) | 774 | :group 'mh-letter) |
| 773 | 775 | ||
| 774 | (defcustom mh-compose-skipped-header-fields | 776 | (defcustom mh-compose-skipped-header-fields |
| @@ -779,20 +781,24 @@ also be set manually to `mhn' if mhn directives are preferred." | |||
| 779 | :group 'mh-letter) | 781 | :group 'mh-letter) |
| 780 | 782 | ||
| 781 | (defcustom mh-compose-space-does-completion-flag nil | 783 | (defcustom mh-compose-space-does-completion-flag nil |
| 782 | "*Non-nil means that <SPC> does completion in message header." | 784 | "*On means \\<mh-letter-mode-map>\\[mh-letter-complete-or-space] does completion in message header." |
| 783 | :type 'boolean | 785 | :type 'boolean |
| 784 | :group 'mh-letter) | 786 | :group 'mh-letter) |
| 785 | 787 | ||
| 786 | (defcustom mh-delete-yanked-msg-window-flag nil | 788 | (defcustom mh-delete-yanked-msg-window-flag nil |
| 787 | "*Non-nil means delete any window displaying the message. | 789 | "*On means delete any window displaying the message. |
| 788 | If this option is on, yanking the current message into a draft letter with | 790 | This deletes the window containing the original message after yanking it with |
| 789 | \\<mh-letter-mode-map>\\[mh-yank-cur-msg] deletes any windows displaying the | 791 | \\<mh-letter-mode-map>\\[mh-yank-cur-msg] to make more room on your screen for |
| 790 | message." | 792 | your reply." |
| 791 | :type 'boolean | 793 | :type 'boolean |
| 792 | :group 'mh-letter) | 794 | :group 'mh-letter) |
| 793 | 795 | ||
| 794 | (defcustom mh-extract-from-attribution-verb "wrote:" | 796 | (defcustom mh-extract-from-attribution-verb "wrote:" |
| 795 | "*Verb to use for attribution when a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg]." | 797 | "*Verb to use for attribution when a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg]. |
| 798 | The attribution consists of the sender's name and email address followed by | ||
| 799 | the content of this option. This option can be set to \"wrote:\", \"a | ||
| 800 | écrit:\", and \"schrieb:\". You can also use the \"Custom String\" menu item | ||
| 801 | to enter your own verb." | ||
| 796 | :type '(choice (const "wrote:") | 802 | :type '(choice (const "wrote:") |
| 797 | (const "a écrit:") | 803 | (const "a écrit:") |
| 798 | (const "schrieb:") | 804 | (const "schrieb:") |
| @@ -800,28 +806,41 @@ message." | |||
| 800 | :group 'mh-letter) | 806 | :group 'mh-letter) |
| 801 | 807 | ||
| 802 | (defcustom mh-ins-buf-prefix "> " | 808 | (defcustom mh-ins-buf-prefix "> " |
| 803 | "*String to put before each non-blank line of a yanked or inserted message. | 809 | "*String to put before each line of a yanked or inserted message. |
| 804 | Used when the message is inserted into an outgoing letter | 810 | The prefix \"> \" is the default setting of this option. I suggest that you |
| 805 | by \\<mh-letter-mode-map>\\[mh-insert-letter] or \\[mh-yank-cur-msg]." | 811 | not modify this option since it is used by many mailers and news readers: |
| 812 | messages are far easier to read if several included messages have all been | ||
| 813 | indented by the same string." | ||
| 806 | :type 'string | 814 | :type 'string |
| 807 | :group 'mh-letter) | 815 | :group 'mh-letter) |
| 808 | 816 | ||
| 809 | (defcustom mh-letter-complete-function 'ispell-complete-word | 817 | (defcustom mh-letter-complete-function 'ispell-complete-word |
| 810 | "*Function to call when completing outside of address or folder fields. | 818 | "*Function to call when completing outside of address or folder fields. |
| 811 | By default, this is set to `ispell-complete-word'." | 819 | In the body of the message, \\<mh-letter-mode-map>\\[mh-letter-complete] runs |
| 820 | this function, which is set to \"ispell-complete-word\" by default." | ||
| 812 | :type '(choice function (const nil)) | 821 | :type '(choice function (const nil)) |
| 813 | :group 'mh-letter) | 822 | :group 'mh-letter) |
| 814 | 823 | ||
| 815 | (defcustom mh-letter-fill-column 72 | 824 | (defcustom mh-letter-fill-column 72 |
| 816 | "*Fill column to use in `mh-letter-mode'. | 825 | "*Fill column to use in MH Letter mode. |
| 817 | This is usually less than in other text modes because email messages get | 826 | By default, this option is 72 to allow others to quote your message without |
| 818 | quoted by some prefix (sometimes many times) when they are replied to, | 827 | line wrapping." |
| 819 | and it's best to avoid quoted lines that span more than 80 columns." | ||
| 820 | :type 'integer | 828 | :type 'integer |
| 821 | :group 'mh-letter) | 829 | :group 'mh-letter) |
| 822 | 830 | ||
| 823 | (defcustom mh-mml-method-default (if mh-gnus-pgp-support-flag "pgpmime" "none") | 831 | (defcustom mh-mml-method-default (if mh-pgp-support-flag "pgpmime" "none") |
| 824 | "Default method to use in security directives." | 832 | "Default method to use in security tags. |
| 833 | This option is used to select between a variety of mail security mechanisms. | ||
| 834 | The default is \"PGP (MIME)\" if it is supported\; otherwise, the default is | ||
| 835 | \"None\". Other mechanisms include vanilla \"PGP\" and \"S/MIME\". | ||
| 836 | |||
| 837 | The `pgg' customization group may have some settings which may interest you | ||
| 838 | \(see Info node `(pgg)'). | ||
| 839 | |||
| 840 | In particular, I set the option `pgg-encrypt-for-me' to t so that all messages | ||
| 841 | I encrypt are encrypted with my public key as well. If you keep a copy of all | ||
| 842 | of your outgoing mail with a \"Fcc:\" header field, this setting is vital so | ||
| 843 | that you can read the mail you write!" | ||
| 825 | :type '(choice (const :tag "PGP (MIME)" "pgpmime") | 844 | :type '(choice (const :tag "PGP (MIME)" "pgpmime") |
| 826 | (const :tag "PGP" "pgp") | 845 | (const :tag "PGP" "pgp") |
| 827 | (const :tag "S/MIME" "smime") | 846 | (const :tag "S/MIME" "smime") |
| @@ -831,13 +850,13 @@ and it's best to avoid quoted lines that span more than 80 columns." | |||
| 831 | (defcustom mh-signature-file-name "~/.signature" | 850 | (defcustom mh-signature-file-name "~/.signature" |
| 832 | "*Source of user's signature. | 851 | "*Source of user's signature. |
| 833 | 852 | ||
| 834 | By default, the text of your signature is taken from the file `~/.signature'. | 853 | By default, the text of your signature is taken from the file \"~/.signature\". |
| 835 | You can read from other files by changing this option. This file may contain a | 854 | You can read from other files by changing this option. This file may contain a |
| 836 | vCard in which case an attachment is added with the vCard. | 855 | vCard in which case an attachment is added with the vCard. |
| 837 | 856 | ||
| 838 | This option may also be a symbol, in which case that function is called. You | 857 | This option may also be a symbol, in which case that function is called. You |
| 839 | may not want a signature separator to be added for you; instead you may want | 858 | may not want a signature separator to be added for you; instead you may want |
| 840 | to insert one yourself. Variables that you may find useful to do this include | 859 | to insert one yourself. Options that you may find useful to do this include |
| 841 | `mh-signature-separator' (when inserting a signature separator) and | 860 | `mh-signature-separator' (when inserting a signature separator) and |
| 842 | `mh-signature-separator-regexp' (for finding said separator). The function | 861 | `mh-signature-separator-regexp' (for finding said separator). The function |
| 843 | `mh-signature-separator-p', which reports t if the buffer contains a | 862 | `mh-signature-separator-p', which reports t if the buffer contains a |
| @@ -850,7 +869,7 @@ option." | |||
| 850 | :group 'mh-letter) | 869 | :group 'mh-letter) |
| 851 | 870 | ||
| 852 | (defcustom mh-signature-separator-flag t | 871 | (defcustom mh-signature-separator-flag t |
| 853 | "*Non-nil means a signature separator should be inserted. | 872 | "*On means a signature separator should be inserted. |
| 854 | It is not recommended that you change this option since various mail user | 873 | It is not recommended that you change this option since various mail user |
| 855 | agents, including MH-E, use the separator to present the signature | 874 | agents, including MH-E, use the separator to present the signature |
| 856 | differently, and to suppress the signature when replying or yanking a letter | 875 | differently, and to suppress the signature when replying or yanking a letter |
| @@ -861,21 +880,21 @@ into a draft." | |||
| 861 | (defcustom mh-x-face-file "~/.face" | 880 | (defcustom mh-x-face-file "~/.face" |
| 862 | "*File containing face header field to insert in outgoing mail. | 881 | "*File containing face header field to insert in outgoing mail. |
| 863 | 882 | ||
| 864 | If the file starts with either of the strings `X-Face:', `Face:' or | 883 | If the file starts with either of the strings \"X-Face:\", \"Face:\" or |
| 865 | `X-Image-URL:' then the contents are added to the message header verbatim. | 884 | \"X-Image-URL:\" then the contents are added to the message header verbatim. |
| 866 | Otherwise it is assumed that the file contains the value of the `X-Face:' | 885 | Otherwise it is assumed that the file contains the value of the \"X-Face:\" |
| 867 | header field. | 886 | header field. |
| 868 | 887 | ||
| 869 | The `X-Face:' header field, which is a low-resolution, black and white image, | 888 | The \"X-Face:\" header field, which is a low-resolution, black and white |
| 870 | can be generated using the `compface' command, which can be obtained from | 889 | image, can be generated using the \"compface\" |
| 871 | ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z. The \"Online | 890 | (ftp://ftp.cs.indiana.edu/pub/faces/compface/compface.tar.Z) command. The |
| 872 | X-Face Convertor\" at http://www.dairiki.org/xface/ is a useful resource for | 891 | \"Online X-Face Converter\" (http://www.dairiki.org/xface/) is a useful |
| 873 | quick conversion of images into `X-Face:' header fields. | 892 | resource for quick conversion of images into \"X-Face:\" header fields. |
| 874 | 893 | ||
| 875 | Use the `make-face' script (http://quimby.gnus.org/circus/face/make-face) to | 894 | Use the \"make-face\" (http://quimby.gnus.org/circus/face/make-face) script to |
| 876 | convert a JPEG image to the higher resolution, color, `Face:' header field. | 895 | convert a JPEG image to the higher resolution, color, \"Face:\" header field. |
| 877 | 896 | ||
| 878 | The URL of any image can be used for the `X-Image-URL:' field and no | 897 | The URL of any image can be used for the \"X-Image-URL:\" field and no |
| 879 | processing of the image is required. | 898 | processing of the image is required. |
| 880 | 899 | ||
| 881 | To prevent the setting of any of these header fields, either set | 900 | To prevent the setting of any of these header fields, either set |
| @@ -884,39 +903,34 @@ doesn't exist." | |||
| 884 | :type 'file | 903 | :type 'file |
| 885 | :group 'mh-letter) | 904 | :group 'mh-letter) |
| 886 | 905 | ||
| 887 | (defcustom mh-yank-from-start-of-msg 'attribution | 906 | (defcustom mh-yank-behavior 'attribution |
| 888 | "*Controls which part of a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg]. | 907 | "*Controls which part of a message is yanked by \\<mh-letter-mode-map>\\[mh-yank-cur-msg]. |
| 889 | If t, include the entire message, with full headers. This is historically | ||
| 890 | here for use with supercite, but is now deprecated in favor of the setting | ||
| 891 | `supercite' below. | ||
| 892 | |||
| 893 | If the symbol `body', then yank the message minus the header. | ||
| 894 | |||
| 895 | If the symbol `supercite', include the entire message, with full headers. | ||
| 896 | This also causes the invocation of `sc-cite-original' without the setting | ||
| 897 | of `mail-citation-hook', now deprecated practice. | ||
| 898 | |||
| 899 | If the symbol `autosupercite', do as for `supercite' automatically when | ||
| 900 | show buffer matches the message being replied-to. When this option is used, | ||
| 901 | the -noformat switch is passed to the repl program to override a -filter or | ||
| 902 | -format switch. | ||
| 903 | |||
| 904 | If the symbol `attribution', then yank the message minus the header and add | ||
| 905 | a simple attribution line at the top. | ||
| 906 | |||
| 907 | If the symbol `autoattrib', do as for `attribution' automatically when show | ||
| 908 | buffer matches the message being replied-to. You can make sure this is | ||
| 909 | always the case by setting `mh-reply-show-message-flag' to t (which is the | ||
| 910 | default) and optionally `mh-delete-yanked-msg-window-flag' to t as well such | ||
| 911 | that the show window is never displayed. When the `autoattrib' option is | ||
| 912 | used, the -noformat switch is passed to the repl program to override a | ||
| 913 | -filter or -format switch. | ||
| 914 | |||
| 915 | If nil, yank only the portion of the message following the point. | ||
| 916 | 908 | ||
| 917 | If the show buffer has a region, this variable is ignored unless its value is | 909 | To include the entire message, including the entire header, use \"Body and |
| 918 | one of `attribution' or `autoattrib' in which case the attribution is added | 910 | Header\". Use \"Body\" to yank just the body without the header. To yank only |
| 919 | to the yanked region." | 911 | the portion of the message following the point, set this option to \"Below |
| 912 | Point\". | ||
| 913 | |||
| 914 | Choose \"Invoke supercite\" to pass the entire message and header through | ||
| 915 | supercite. | ||
| 916 | |||
| 917 | If the \"Body With Attribution\" setting is used, then the message minus the | ||
| 918 | header is yanked and a simple attribution line is added at the top using the | ||
| 919 | value of the `mh-extract-from-attribution-verb' option. This is the default. | ||
| 920 | |||
| 921 | If the \"Invoke supercite\" or \"Body With Attribution\" settings are used, | ||
| 922 | the \"-noformat\" argument is passed to the \"repl\" program to override a | ||
| 923 | \"-filter\" or \"-format\" argument. These settings also have | ||
| 924 | \"Automatically\" variants that perform the action automatically when you | ||
| 925 | reply so that you don't need to use \\[mh-yank-cur-msg] at all. Note that this | ||
| 926 | automatic action is only performed if the show buffer matches the message | ||
| 927 | being replied to. People who use the automatic variants tend to turn on the | ||
| 928 | `mh-delete-yanked-msg-window-flag' option as well so that the show window is | ||
| 929 | never displayed. | ||
| 930 | |||
| 931 | If the show buffer has a region, the `mh-yank-behavior' option is ignored | ||
| 932 | unless its value is one of Attribution variants in which case the attribution | ||
| 933 | is added to the yanked region." | ||
| 920 | :type '(choice (const :tag "Body and Header" t) | 934 | :type '(choice (const :tag "Body and Header" t) |
| 921 | (const :tag "Body" body) | 935 | (const :tag "Body" body) |
| 922 | (const :tag "Below Point" nil) | 936 | (const :tag "Below Point" nil) |
| @@ -1983,26 +1997,17 @@ This button runs `mh-previous-undeleted-msg'") | |||
| 1983 | 1997 | ||
| 1984 | (defcustom mail-citation-hook nil | 1998 | (defcustom mail-citation-hook nil |
| 1985 | "*Hook for modifying a citation just inserted in the mail buffer. | 1999 | "*Hook for modifying a citation just inserted in the mail buffer. |
| 1986 | Each hook function can find the citation between point and mark. | 2000 | You can gain full control over the appearance of the included text by setting |
| 1987 | And each hook function should leave point and mark around the citation | 2001 | this hook to a function that modifies it. This hook is ignored if the option |
| 1988 | text as modified. | 2002 | `mh-yank-behavior' is set to one of the supercite flavors. Otherwise, this |
| 1989 | 2003 | option controls how much of the message is passed to the hook. The function | |
| 1990 | If this hook is entirely empty (nil), the text of the message is inserted | 2004 | can find the citation between point and mark and it should leave point and |
| 1991 | with `mh-ins-buf-prefix' prefixed to each line. | 2005 | mark around the modified citation text for the next hook function. The |
| 1992 | 2006 | standard prefix `mh-ins-buf-prefix' is not added if this hook is set. | |
| 1993 | See also the variable `mh-yank-from-start-of-msg', which controls how | 2007 | |
| 1994 | much of the message passed to the hook. | 2008 | For example, if you use the hook function trivial-cite |
| 1995 | 2009 | \(http://shasta.cs.uiuc.edu/~lrclause/tc.html) (which is NOT part of Emacs), | |
| 1996 | This hook was historically provided to set up supercite. You may now leave | 2010 | set `mh-yank-behavior' to \"Body and Header\"." |
| 1997 | this nil and set up supercite by setting the variable | ||
| 1998 | `mh-yank-from-start-of-msg' to 'supercite or, for more automatic insertion, | ||
| 1999 | to 'autosupercite. | ||
| 2000 | |||
| 2001 | The hook 'trivial-cite is NOT part of Emacs. It is provided from tc.el, | ||
| 2002 | available here: | ||
| 2003 | http://shasta.cs.uiuc.edu/~lrclause/tc.html | ||
| 2004 | If you use it, customize `mh-yank-from-start-of-msg' to | ||
| 2005 | \"Entire message with headers\"." | ||
| 2006 | :type 'hook | 2011 | :type 'hook |
| 2007 | :options '(trivial-cite) | 2012 | :options '(trivial-cite) |
| 2008 | :group 'mh-hooks | 2013 | :group 'mh-hooks |
| @@ -2022,8 +2027,11 @@ See also `mh-quit-hook'." | |||
| 2022 | :group 'mh-show) | 2027 | :group 'mh-show) |
| 2023 | 2028 | ||
| 2024 | (defcustom mh-before-send-letter-hook nil | 2029 | (defcustom mh-before-send-letter-hook nil |
| 2025 | "Invoked at the beginning of the \\<mh-letter-mode-map>\\[mh-send-letter] command." | 2030 | "Invoked at the beginning of the \\<mh-letter-mode-map>\\[mh-send-letter] command. |
| 2031 | For example, if you want to check your spelling in your message before | ||
| 2032 | sending, add the `ispell-message' function." | ||
| 2026 | :type 'hook | 2033 | :type 'hook |
| 2034 | :options '(ispell-message) | ||
| 2027 | :group 'mh-hooks | 2035 | :group 'mh-hooks |
| 2028 | :group 'mh-letter) | 2036 | :group 'mh-letter) |
| 2029 | 2037 | ||
| @@ -2033,8 +2041,8 @@ See also `mh-quit-hook'." | |||
| 2033 | :group 'mh-hooks | 2041 | :group 'mh-hooks |
| 2034 | :group 'mh-show) | 2042 | :group 'mh-show) |
| 2035 | 2043 | ||
| 2036 | (defcustom mh-edit-mhn-hook nil | 2044 | (defcustom mh-mh-to-mime-hook nil |
| 2037 | "Invoked on the formatted letter by \\<mh-letter-mode-map>\\[mh-edit-mhn]." | 2045 | "Invoked on the formatted letter by \\<mh-letter-mode-map>\\[mh-mh-to-mime]." |
| 2038 | :type 'hook | 2046 | :type 'hook |
| 2039 | :group 'mh-hooks | 2047 | :group 'mh-hooks |
| 2040 | :group 'mh-letter) | 2048 | :group 'mh-letter) |
diff --git a/lisp/mh-e/mh-gnus.el b/lisp/mh-e/mh-gnus.el index 54f5c730385..9d12a54bcd1 100644 --- a/lisp/mh-e/mh-gnus.el +++ b/lisp/mh-e/mh-gnus.el | |||
| @@ -56,26 +56,26 @@ BODY." | |||
| 56 | `(defmacro ,function ,arg-list ,@body)))) | 56 | `(defmacro ,function ,arg-list ,@body)))) |
| 57 | (put 'mh-defmacro-compat 'lisp-indent-function 'defun) | 57 | (put 'mh-defmacro-compat 'lisp-indent-function 'defun) |
| 58 | 58 | ||
| 59 | ;; Copy of original function from gnus-util.el | 59 | ;; Copy of original function from gnus-util.el. |
| 60 | (mh-defun-compat gnus-local-map-property (map) | 60 | (mh-defun-compat gnus-local-map-property (map) |
| 61 | "Return a list suitable for a text property list specifying keymap MAP." | 61 | "Return a list suitable for a text property list specifying keymap MAP." |
| 62 | (cond (mh-xemacs-flag (list 'keymap map)) | 62 | (cond (mh-xemacs-flag (list 'keymap map)) |
| 63 | ((>= emacs-major-version 21) (list 'keymap map)) | 63 | ((>= emacs-major-version 21) (list 'keymap map)) |
| 64 | (t (list 'local-map map)))) | 64 | (t (list 'local-map map)))) |
| 65 | 65 | ||
| 66 | ;; Copy of original function from mm-decode.el | 66 | ;; Copy of original function from mm-decode.el. |
| 67 | (mh-defun-compat mm-merge-handles (handles1 handles2) | 67 | (mh-defun-compat mm-merge-handles (handles1 handles2) |
| 68 | (append (if (listp (car handles1)) handles1 (list handles1)) | 68 | (append (if (listp (car handles1)) handles1 (list handles1)) |
| 69 | (if (listp (car handles2)) handles2 (list handles2)))) | 69 | (if (listp (car handles2)) handles2 (list handles2)))) |
| 70 | 70 | ||
| 71 | ;; Copy of function from mm-decode.el | 71 | ;; Copy of function from mm-decode.el. |
| 72 | (mh-defun-compat mm-set-handle-multipart-parameter (handle parameter value) | 72 | (mh-defun-compat mm-set-handle-multipart-parameter (handle parameter value) |
| 73 | ;; HANDLE could be a CTL. | 73 | ;; HANDLE could be a CTL. |
| 74 | (if handle | 74 | (if handle |
| 75 | (put-text-property 0 (length (car handle)) parameter value | 75 | (put-text-property 0 (length (car handle)) parameter value |
| 76 | (car handle)))) | 76 | (car handle)))) |
| 77 | 77 | ||
| 78 | ;; Copy of function from mm-view.el | 78 | ;; Copy of function from mm-view.el. |
| 79 | (mh-defun-compat mm-inline-text-vcard (handle) | 79 | (mh-defun-compat mm-inline-text-vcard (handle) |
| 80 | (let (buffer-read-only) | 80 | (let (buffer-read-only) |
| 81 | (mm-insert-inline | 81 | (mm-insert-inline |
| @@ -89,15 +89,15 @@ BODY." | |||
| 89 | 'vcard-standard-filter)))))))) | 89 | 'vcard-standard-filter)))))))) |
| 90 | 90 | ||
| 91 | ;; Function from mm-decode.el used in PGP messages. Just define it with older | 91 | ;; Function from mm-decode.el used in PGP messages. Just define it with older |
| 92 | ;; gnus to avoid compiler warning. | 92 | ;; Gnus to avoid compiler warning. |
| 93 | (mh-defun-compat mm-possibly-verify-or-decrypt (parts ctl) | 93 | (mh-defun-compat mm-possibly-verify-or-decrypt (parts ctl) |
| 94 | nil) | 94 | nil) |
| 95 | 95 | ||
| 96 | ;; Copy of original macro is in mm-decode.el | 96 | ;; Copy of original macro is in mm-decode.el. |
| 97 | (mh-defmacro-compat mm-handle-multipart-ctl-parameter (handle parameter) | 97 | (mh-defmacro-compat mm-handle-multipart-ctl-parameter (handle parameter) |
| 98 | `(get-text-property 0 ,parameter (car ,handle))) | 98 | `(get-text-property 0 ,parameter (car ,handle))) |
| 99 | 99 | ||
| 100 | ;; Copy of original function in mm-decode.el | 100 | ;; Copy of original function in mm-decode.el. |
| 101 | (mh-defun-compat mm-readable-p (handle) | 101 | (mh-defun-compat mm-readable-p (handle) |
| 102 | "Say whether the content of HANDLE is readable." | 102 | "Say whether the content of HANDLE is readable." |
| 103 | (and (< (with-current-buffer (mm-handle-buffer handle) | 103 | (and (< (with-current-buffer (mm-handle-buffer handle) |
| @@ -107,7 +107,7 @@ BODY." | |||
| 107 | (and (eq (mm-body-7-or-8) '7bit) | 107 | (and (eq (mm-body-7-or-8) '7bit) |
| 108 | (not (mm-long-lines-p 76)))))) | 108 | (not (mm-long-lines-p 76)))))) |
| 109 | 109 | ||
| 110 | ;; Copy of original function in mm-bodies.el | 110 | ;; Copy of original function in mm-bodies.el. |
| 111 | (mh-defun-compat mm-long-lines-p (length) | 111 | (mh-defun-compat mm-long-lines-p (length) |
| 112 | "Say whether any of the lines in the buffer is longer than LENGTH." | 112 | "Say whether any of the lines in the buffer is longer than LENGTH." |
| 113 | (save-excursion | 113 | (save-excursion |
| @@ -126,10 +126,25 @@ BODY." | |||
| 126 | nil) | 126 | nil) |
| 127 | 127 | ||
| 128 | (mh-defun-compat mm-destroy-parts (list) | 128 | (mh-defun-compat mm-destroy-parts (list) |
| 129 | "Older emacs don't have this function." | 129 | "Older versions of Emacs don't have this function." |
| 130 | nil) | 130 | nil) |
| 131 | 131 | ||
| 132 | ;;; This is mm-save-part from gnus 5.10 since that function in emacs21.2 is | 132 | ;; Copy of original function in mml.el. |
| 133 | (mh-defun-compat mml-minibuffer-read-disposition (type &optional default) | ||
| 134 | (unless default (setq default | ||
| 135 | (if (and (string-match "\\`text/" type) | ||
| 136 | (not (string-match "\\`text/rtf\\'" type))) | ||
| 137 | "inline" | ||
| 138 | "attachment"))) | ||
| 139 | (let ((disposition (completing-read | ||
| 140 | (format "Disposition (default %s): " default) | ||
| 141 | '(("attachment") ("inline") ("")) | ||
| 142 | nil t nil nil default))) | ||
| 143 | (if (not (equal disposition "")) | ||
| 144 | disposition | ||
| 145 | default))) | ||
| 146 | |||
| 147 | ;;; This is mm-save-part from Gnus 5.10 since that function in emacs21.2 is | ||
| 133 | ;;; buggy (the args to read-file-name are incorrect). When all supported | 148 | ;;; buggy (the args to read-file-name are incorrect). When all supported |
| 134 | ;;; versions of Emacs come with at least Gnus 5.10, we can delete this | 149 | ;;; versions of Emacs come with at least Gnus 5.10, we can delete this |
| 135 | ;;; function and rename calls to mh-mm-save-part to mm-save-part. | 150 | ;;; function and rename calls to mh-mm-save-part to mm-save-part. |
| @@ -152,7 +167,7 @@ BODY." | |||
| 152 | (mm-save-part-to-file handle file)))) | 167 | (mm-save-part-to-file handle file)))) |
| 153 | 168 | ||
| 154 | (defun mh-mm-text-html-renderer () | 169 | (defun mh-mm-text-html-renderer () |
| 155 | "Find the renderer gnus is using to display text/html MIME parts." | 170 | "Find the renderer Gnus is using to display text/html MIME parts." |
| 156 | (or (and (boundp 'mm-inline-text-html-renderer) mm-inline-text-html-renderer) | 171 | (or (and (boundp 'mm-inline-text-html-renderer) mm-inline-text-html-renderer) |
| 157 | (and (boundp 'mm-text-html-renderer) mm-text-html-renderer))) | 172 | (and (boundp 'mm-text-html-renderer) mm-text-html-renderer))) |
| 158 | 173 | ||
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el index fb7bace7ead..9f23cb71084 100644 --- a/lisp/mh-e/mh-mime.el +++ b/lisp/mh-e/mh-mime.el | |||
| @@ -28,8 +28,9 @@ | |||
| 28 | ;;; Commentary: | 28 | ;;; Commentary: |
| 29 | 29 | ||
| 30 | ;; Internal support for MH-E package. | 30 | ;; Internal support for MH-E package. |
| 31 | ;; Support for generating an mhn composition file. | 31 | ;; Support for generating MH-style directives for mhn or mhbuild as well as |
| 32 | ;; MIME is supported only by MH 6.8 or later. | 32 | ;; MML (MIME Meta Language) tags. MH-style directives are supported by MH 6.8 |
| 33 | ;; or later. | ||
| 33 | 34 | ||
| 34 | ;;; Change Log: | 35 | ;;; Change Log: |
| 35 | 36 | ||
| @@ -41,45 +42,46 @@ | |||
| 41 | (require 'gnus-util) | 42 | (require 'gnus-util) |
| 42 | (require 'mh-gnus) | 43 | (require 'mh-gnus) |
| 43 | 44 | ||
| 44 | (autoload 'gnus-article-goto-header "gnus-art") | ||
| 45 | (autoload 'article-emphasize "gnus-art") | 45 | (autoload 'article-emphasize "gnus-art") |
| 46 | (autoload 'gnus-get-buffer-create "gnus") | 46 | (autoload 'gnus-article-goto-header "gnus-art") |
| 47 | (autoload 'gnus-eval-format "gnus-spec") | 47 | (autoload 'gnus-eval-format "gnus-spec") |
| 48 | (autoload 'widget-convert-button "wid-edit") | 48 | (autoload 'gnus-get-buffer-create "gnus") |
| 49 | (autoload 'message-options-set-recipient "message") | 49 | (autoload 'message-options-set-recipient "message") |
| 50 | (autoload 'mml-unsecure-message "mml-sec") | 50 | (autoload 'mml-attach-file "mml") |
| 51 | (autoload 'mml-minibuffer-read-file "mml") | ||
| 52 | (autoload 'mml-minibuffer-read-description "mml") | ||
| 53 | (autoload 'mml-insert-empty-tag "mml") | 51 | (autoload 'mml-insert-empty-tag "mml") |
| 52 | (autoload 'mml-minibuffer-read-description "mml") | ||
| 53 | (autoload 'mml-minibuffer-read-disposition "mml") | ||
| 54 | (autoload 'mml-minibuffer-read-file "mml") | ||
| 54 | (autoload 'mml-to-mime "mml") | 55 | (autoload 'mml-to-mime "mml") |
| 55 | (autoload 'mml-attach-file "mml") | 56 | (autoload 'mml-unsecure-message "mml-sec") |
| 56 | (autoload 'rfc2047-decode-region "rfc2047") | 57 | (autoload 'rfc2047-decode-region "rfc2047") |
| 58 | (autoload 'widget-convert-button "wid-edit") | ||
| 57 | 59 | ||
| 58 | ;;;###mh-autoload | 60 | ;;;###mh-autoload |
| 59 | (defun mh-compose-insertion (&optional inline) | 61 | (defun mh-compose-insertion (&optional inline) |
| 60 | "Add a directive to insert a MIME part from a file, using mhn or gnus. | 62 | "Add tag to include a file such as an image or sound. |
| 61 | If the variable `mh-compose-insertion' is set to 'mhn, then that will be used. | 63 | You are prompted for the filename containing the object, the media type if it |
| 62 | If it is set to 'gnus, then that will be used instead. | 64 | cannot be determined automatically, and a content description. If you're using |
| 65 | MH-style directives, you will also be prompted for additional attributes. | ||
| 66 | |||
| 67 | The option `mh-compose-insertion' controls what type of tags are inserted. | ||
| 63 | Optional argument INLINE means make it an inline attachment." | 68 | Optional argument INLINE means make it an inline attachment." |
| 64 | (interactive "P") | 69 | (interactive "P") |
| 65 | (if (equal mh-compose-insertion 'gnus) | 70 | (if (equal mh-compose-insertion 'mml) |
| 66 | (if inline | 71 | (if inline |
| 67 | (mh-mml-attach-file "inline") | 72 | (mh-mml-attach-file "inline") |
| 68 | (mh-mml-attach-file)) | 73 | (mh-mml-attach-file)) |
| 69 | (call-interactively 'mh-mhn-compose-insertion))) | 74 | (call-interactively 'mh-mh-attach-file))) |
| 70 | 75 | ||
| 71 | ;;;###mh-autoload | 76 | ;;;###mh-autoload |
| 72 | (defun mh-compose-forward (&optional description folder messages) | 77 | (defun mh-compose-forward (&optional description folder messages) |
| 73 | "Add a MIME directive to forward a message, using mhn or gnus. | 78 | "Add tag to forward a message. |
| 74 | If the variable `mh-compose-insertion' is set to 'mhn, then that will be used. | 79 | You are prompted for a content DESCRIPTION, the name of the FOLDER in which |
| 75 | If it is set to 'gnus, then that will be used instead. | 80 | the messages to forward are located, and the MESSAGES' numbers. |
| 76 | Optional argument DESCRIPTION is a description of the attachment. | 81 | |
| 77 | Optional argument FOLDER is the folder from which the forwarded message should | 82 | The option `mh-compose-insertion' controls what type of tags are inserted." |
| 78 | come. | ||
| 79 | Optional argument MESSAGES is the range of messages to forward. | ||
| 80 | If any of the optional arguments are absent, they are prompted for." | ||
| 81 | (interactive (let* | 83 | (interactive (let* |
| 82 | ((description (read-string "Forw Content-description: ")) | 84 | ((description (mml-minibuffer-read-description)) |
| 83 | (folder (mh-prompt-for-folder "Message from" | 85 | (folder (mh-prompt-for-folder "Message from" |
| 84 | mh-sent-from-folder nil)) | 86 | mh-sent-from-folder nil)) |
| 85 | (messages (let ((default-message | 87 | (messages (let ((default-message |
| @@ -105,24 +107,24 @@ If any of the optional arguments are absent, they are prompted for." | |||
| 105 | (if (null range) | 107 | (if (null range) |
| 106 | (error "No messages in specified range")) | 108 | (error "No messages in specified range")) |
| 107 | (dolist (message range) | 109 | (dolist (message range) |
| 108 | (if (equal mh-compose-insertion 'gnus) | 110 | (if (equal mh-compose-insertion 'mml) |
| 109 | (mh-mml-forward-message description folder (format "%s" message)) | 111 | (mh-mml-forward-message description folder (format "%s" message)) |
| 110 | (mh-mhn-compose-forw description folder message))))) | 112 | (mh-mh-forward-message description folder (format "%s" message)))))) |
| 111 | 113 | ||
| 112 | ;; To do: | 114 | ;; To do: |
| 113 | ;; paragraph code should not fill # lines if MIME enabled. | 115 | ;; paragraph code should not fill # lines if MIME enabled. |
| 114 | ;; implement mh-auto-edit-mhn (if non-nil, \\[mh-send-letter] | 116 | ;; implement mh-auto-mh-to-mime (if non-nil, \\[mh-send-letter] |
| 115 | ;; invokes mh-edit-mhn automatically before sending.) | 117 | ;; invokes mh-mh-to-mime automatically before sending.) |
| 116 | ;; actually, instead of mh-auto-edit-mhn, | 118 | ;; actually, instead of mh-auto-mh-to-mime, |
| 117 | ;; should read automhnproc from profile | 119 | ;; should read automhnproc from profile |
| 118 | ;; MIME option to mh-forward | 120 | ;; MIME option to mh-forward |
| 119 | ;; command to move to content-description insertion point | 121 | ;; command to move to content-description insertion point |
| 120 | 122 | ||
| 121 | (defvar mh-mhn-args nil | 123 | (defvar mh-mh-to-mime-args nil |
| 122 | "Extra arguments to have \\[mh-edit-mhn] pass to the \"mhn\" command. | 124 | "Extra arguments for \\[mh-mh-to-mime] to pass to the \"mhbuild\" command. |
| 123 | The arguments are passed to mhn if \\[mh-edit-mhn] is given a | 125 | The arguments are passed to \"mhbuild\" if \\[mh-mh-to-mime] is given a prefix |
| 124 | prefix argument. Normally default arguments to mhn are specified in the | 126 | argument. Normally default arguments to \"mhbuild\" are specified in the MH |
| 125 | MH profile.") | 127 | profile.") |
| 126 | 128 | ||
| 127 | (defvar mh-media-type-regexp | 129 | (defvar mh-media-type-regexp |
| 128 | (concat (regexp-opt '("text" "image" "audio" "video" "application" | 130 | (concat (regexp-opt '("text" "image" "audio" "video" "application" |
| @@ -196,7 +198,6 @@ Returns nil if file command not on system." | |||
| 196 | (mh-file-mime-type-substitute (match-string 0) filename))) | 198 | (mh-file-mime-type-substitute (match-string 0) filename))) |
| 197 | (kill-buffer tmp-buffer))))))) | 199 | (kill-buffer tmp-buffer))))))) |
| 198 | 200 | ||
| 199 | ;;; This is needed for Emacs20 which doesn't have mailcap-mime-types. | ||
| 200 | (defvar mh-mime-content-types | 201 | (defvar mh-mime-content-types |
| 201 | '(("application/mac-binhex40") ("application/msword") | 202 | '(("application/mac-binhex40") ("application/msword") |
| 202 | ("application/octet-stream") ("application/pdf") ("application/pgp-keys") | 203 | ("application/octet-stream") ("application/pdf") ("application/pgp-keys") |
| @@ -218,8 +219,34 @@ Returns nil if file command not on system." | |||
| 218 | ("text/richtext") ("text/x-vcard") ("text/xml") | 219 | ("text/richtext") ("text/x-vcard") ("text/xml") |
| 219 | 220 | ||
| 220 | ("video/mpeg") ("video/quicktime")) | 221 | ("video/mpeg") ("video/quicktime")) |
| 221 | "Valid MIME content types. | 222 | "Valid MIME content types for Emacs 20. |
| 222 | See documentation for \\[mh-edit-mhn].") | 223 | Obsolete; use `mailcap-mime-types'. |
| 224 | |||
| 225 | See also \\[mh-mh-to-mime].") | ||
| 226 | |||
| 227 | ;;; Delete mh-minibuffer-read-type and mh-mime-content-types and use | ||
| 228 | ;;; mml-minibuffer-read-type when Emacs20 is no longer supported unless we | ||
| 229 | ;;; think (mh-file-mime-type) is better than (mm-default-file-encoding). | ||
| 230 | |||
| 231 | (defun mh-minibuffer-read-type (filename &optional default) | ||
| 232 | "Return the content type associated with the given FILENAME. | ||
| 233 | If the \"file\" command exists and recognizes the given file, then its value | ||
| 234 | is returned\; otherwise, the user is prompted for a type (see | ||
| 235 | `mailcap-mime-types' and for Emacs 20, `mh-mime-content-types'). | ||
| 236 | Optional argument DEFAULT is returned if a type isn't entered." | ||
| 237 | (mailcap-parse-mimetypes) | ||
| 238 | (let* ((default (or default | ||
| 239 | (mm-default-file-encoding filename) | ||
| 240 | "application/octet-stream")) | ||
| 241 | (type (or (mh-file-mime-type filename) | ||
| 242 | (completing-read | ||
| 243 | (format "Content type (default %s): " default) | ||
| 244 | (if (fboundp 'mailcap-mime-types) | ||
| 245 | (mapcar 'list (mailcap-mime-types)) | ||
| 246 | mh-mime-content-types))))) | ||
| 247 | (if (not (equal type "")) | ||
| 248 | type | ||
| 249 | default))) | ||
| 223 | 250 | ||
| 224 | ;; RFC 2045 - Multipurpose Internet Mail Extensions (MIME) Part One: | 251 | ;; RFC 2045 - Multipurpose Internet Mail Extensions (MIME) Part One: |
| 225 | ;; Format of Internet Message Bodies. | 252 | ;; Format of Internet Message Bodies. |
| @@ -248,35 +275,27 @@ See documentation for \\[mh-edit-mhn].") | |||
| 248 | "Valid MIME access-type values.") | 275 | "Valid MIME access-type values.") |
| 249 | 276 | ||
| 250 | ;;;###mh-autoload | 277 | ;;;###mh-autoload |
| 251 | (defun mh-mhn-compose-insertion (filename type description attributes) | 278 | (defun mh-mh-attach-file (filename type description attributes) |
| 252 | "Add a directive to insert a MIME message part from a file. | 279 | "Add a tag to insert a MIME message part from a file. |
| 253 | This is the typical way to insert non-text parts in a message. | 280 | You are prompted for the FILENAME containing the object, the media TYPE if it |
| 254 | 281 | cannot be determined automatically, and a content DESCRIPTION. In addition, | |
| 255 | Arguments are FILENAME, which tells where to find the file, TYPE, the MIME | 282 | you are also prompted for additional ATTRIBUTES. |
| 256 | content type, DESCRIPTION, a line of text for the Content-Description field. | 283 | |
| 257 | ATTRIBUTES is a comma separated list of name=value pairs that is appended to | 284 | See also \\[mh-mh-to-mime]." |
| 258 | the Content-Type field of the attachment. | 285 | (interactive (let ((filename (mml-minibuffer-read-file "Attach file: "))) |
| 259 | |||
| 260 | See also \\[mh-edit-mhn]." | ||
| 261 | (interactive (let ((filename (read-file-name "Insert contents of: "))) | ||
| 262 | (list | 286 | (list |
| 263 | filename | 287 | filename |
| 264 | (or (mh-file-mime-type filename) | 288 | (mh-minibuffer-read-type filename) |
| 265 | (completing-read "Content-Type: " | 289 | (mml-minibuffer-read-description) |
| 266 | (if (fboundp 'mailcap-mime-types) | 290 | (read-string "Attributes: " |
| 267 | (mapcar 'list (mailcap-mime-types)) | ||
| 268 | mh-mime-content-types))) | ||
| 269 | (read-string "Content-Description: ") | ||
| 270 | (read-string "Content-Attributes: " | ||
| 271 | (concat "name=\"" | 291 | (concat "name=\"" |
| 272 | (file-name-nondirectory filename) | 292 | (file-name-nondirectory filename) |
| 273 | "\""))))) | 293 | "\""))))) |
| 274 | (mh-mhn-compose-type filename type description attributes )) | 294 | (mh-mh-compose-type filename type description attributes)) |
| 275 | 295 | ||
| 276 | (defun mh-mhn-compose-type (filename type | 296 | (defun mh-mh-compose-type (filename type |
| 277 | &optional description attributes comment) | 297 | &optional description attributes comment) |
| 278 | "Insert a mhn directive to insert a file. | 298 | "Insert an MH-style directive to insert a file. |
| 279 | |||
| 280 | The file specified by FILENAME is encoded as TYPE. An optional DESCRIPTION is | 299 | The file specified by FILENAME is encoded as TYPE. An optional DESCRIPTION is |
| 281 | used as the Content-Description field, optional set of ATTRIBUTES and an | 300 | used as the Content-Description field, optional set of ATTRIBUTES and an |
| 282 | optional COMMENT can also be included." | 301 | optional COMMENT can also be included." |
| @@ -292,75 +311,62 @@ optional COMMENT can also be included." | |||
| 292 | (insert "] " (expand-file-name filename)) | 311 | (insert "] " (expand-file-name filename)) |
| 293 | (insert "\n")) | 312 | (insert "\n")) |
| 294 | 313 | ||
| 295 | |||
| 296 | ;;;###mh-autoload | 314 | ;;;###mh-autoload |
| 297 | (defun mh-mhn-compose-anon-ftp (host filename type description) | 315 | (defun mh-mh-compose-anon-ftp (host filename type description) |
| 298 | "Add a directive for a MIME anonymous ftp external body part. | 316 | "Add tag to include anonymous ftp reference to a file. |
| 299 | This directive tells MH to include a reference to a message/external-body part | 317 | You can even have your message initiate an \"ftp\" transfer when the |
| 300 | retrievable by anonymous FTP. | 318 | recipient reads the message. You are prompted for the remote |
| 319 | HOST and FILENAME, the media TYPE, and the content DESCRIPTION. | ||
| 301 | 320 | ||
| 302 | Arguments are HOST and FILENAME, which tell where to find the file, TYPE, the | 321 | See also \\[mh-mh-to-mime]." |
| 303 | MIME content type, and DESCRIPTION, a line of text for the Content-description | ||
| 304 | header. | ||
| 305 | |||
| 306 | See also \\[mh-edit-mhn]." | ||
| 307 | (interactive (list | 322 | (interactive (list |
| 308 | (read-string "Remote host: ") | 323 | (read-string "Remote host: ") |
| 309 | (read-string "Remote filename: ") | 324 | (read-string "Remote filename: ") |
| 310 | (completing-read "External Content-Type: " | 325 | (mh-minibuffer-read-type "DUMMY-FILENAME") |
| 311 | (if (fboundp 'mailcap-mime-types) | 326 | (mml-minibuffer-read-description))) |
| 312 | (mapcar 'list (mailcap-mime-types)) | 327 | (mh-mh-compose-external-type "anon-ftp" host filename |
| 313 | mh-mime-content-types)) | 328 | type description)) |
| 314 | (read-string "External Content-Description: "))) | ||
| 315 | (mh-mhn-compose-external-type "anon-ftp" host filename | ||
| 316 | type description)) | ||
| 317 | 329 | ||
| 318 | ;;;###mh-autoload | 330 | ;;;###mh-autoload |
| 319 | (defun mh-mhn-compose-external-compressed-tar (host filename description) | 331 | (defun mh-mh-compose-external-compressed-tar (host filename description) |
| 320 | "Add a directive to include a MIME reference to a compressed tar file. | 332 | "Add tag to include anonymous ftp reference to a compressed tar file. |
| 321 | The file should be available via anonymous ftp. This directive tells MH to | 333 | In addition to retrieving the file via anonymous \"ftp\" as per the |
| 322 | include a reference to a message/external-body part. | 334 | \\[mh-mh-compose-anon-ftp] command, the file will also be uncompressed and |
| 323 | 335 | untarred. You are prompted for the remote HOST and FILENAME and the content | |
| 324 | Arguments are HOST and FILENAME, which tell where to find the file, and | 336 | DESCRIPTION. |
| 325 | DESCRIPTION, a line of text for the Content-description header. | 337 | |
| 326 | 338 | See also \\[mh-mh-to-mime]." | |
| 327 | See also \\[mh-edit-mhn]." | ||
| 328 | (interactive (list | 339 | (interactive (list |
| 329 | (read-string "Remote host: ") | 340 | (read-string "Remote host: ") |
| 330 | (read-string "Remote filename: ") | 341 | (read-string "Remote filename: ") |
| 331 | (read-string "Tar file Content-description: "))) | 342 | (mml-minibuffer-read-description))) |
| 332 | (mh-mhn-compose-external-type "anon-ftp" host filename | 343 | (mh-mh-compose-external-type "anon-ftp" host filename |
| 333 | "application/octet-stream" | 344 | "application/octet-stream" |
| 334 | description | 345 | description |
| 335 | "type=tar; conversions=x-compress" | 346 | "type=tar; conversions=x-compress" |
| 336 | "mode=image")) | 347 | "mode=image")) |
| 337 | 348 | ||
| 338 | ;;;###mh-autoload | 349 | ;;;###mh-autoload |
| 339 | (defun mh-mhn-compose-external-type (access-type host filename type | 350 | (defun mh-mh-compose-external-type (access-type host filename type |
| 340 | &optional description | 351 | &optional description |
| 341 | attributes extra-params | 352 | attributes parameters |
| 342 | comment) | 353 | comment) |
| 343 | "Add a directive to include a MIME reference to a remote file. | 354 | "Add tag to refer to a remote file. |
| 344 | The file should be available via anonymous ftp. This directive tells MH to | 355 | This command is a general utility for referencing external files. In fact, all |
| 345 | include a reference to a message/external-body part. | 356 | of the other commands that insert directives to access external files call |
| 346 | 357 | this command. You are prompted for the ACCESS-TYPE, remote HOST and FILENAME, | |
| 347 | Arguments are ACCESS-TYPE, HOST and FILENAME, which tell where to find the | 358 | and content TYPE. If you provide a prefix argument, you are also prompted for |
| 348 | file and TYPE which is the MIME Content-Type. Optional arguments include | 359 | a content DESCRIPTION, ATTRIBUTES, PARAMETERS, and a COMMENT. |
| 349 | DESCRIPTION, a line of text for the Content-description header, ATTRIBUTES, | 360 | |
| 350 | EXTRA-PARAMS, and COMMENT. | 361 | See also \\[mh-mh-to-mime]." |
| 351 | |||
| 352 | See also \\[mh-edit-mhn]." | ||
| 353 | (interactive (list | 362 | (interactive (list |
| 354 | (completing-read "Access Type: " mh-access-types) | 363 | (completing-read "Access type: " mh-access-types) |
| 355 | (read-string "Remote host: ") | 364 | (read-string "Remote host: ") |
| 356 | (read-string "Remote url-path: ") | 365 | (read-string "Remote filename: ") |
| 357 | (completing-read "Content-Type: " | 366 | (mh-minibuffer-read-type "DUMMY-FILENAME") |
| 358 | (if (fboundp 'mailcap-mime-types) | 367 | (if current-prefix-arg (mml-minibuffer-read-description)) |
| 359 | (mapcar 'list (mailcap-mime-types)) | ||
| 360 | mh-mime-content-types)) | ||
| 361 | (if current-prefix-arg (read-string "Content-description: ")) | ||
| 362 | (if current-prefix-arg (read-string "Attributes: ")) | 368 | (if current-prefix-arg (read-string "Attributes: ")) |
| 363 | (if current-prefix-arg (read-string "Extra Parameters: ")) | 369 | (if current-prefix-arg (read-string "Parameters: ")) |
| 364 | (if current-prefix-arg (read-string "Comment: ")))) | 370 | (if current-prefix-arg (read-string "Comment: ")))) |
| 365 | (beginning-of-line) | 371 | (beginning-of-line) |
| 366 | (insert "#@" type) | 372 | (insert "#@" type) |
| @@ -378,25 +384,24 @@ See also \\[mh-edit-mhn]." | |||
| 378 | (let ((directory (file-name-directory filename))) | 384 | (let ((directory (file-name-directory filename))) |
| 379 | (and directory | 385 | (and directory |
| 380 | (insert "; directory=\"" directory "\""))) | 386 | (insert "; directory=\"" directory "\""))) |
| 381 | (and extra-params | 387 | (and parameters |
| 382 | (insert "; " extra-params)) | 388 | (insert "; " parameters)) |
| 383 | (insert "\n")) | 389 | (insert "\n")) |
| 384 | 390 | ||
| 385 | ;;;###mh-autoload | 391 | ;;;###mh-autoload |
| 386 | (defun mh-mhn-compose-forw (&optional description folder messages) | 392 | (defun mh-mh-forward-message (&optional description folder messages) |
| 387 | "Add a forw directive to this message, to forward a message with MIME. | 393 | "Add tag to forward a message. |
| 388 | This directive tells MH to include the named messages in this one. | 394 | You are prompted for a content DESCRIPTION, the name of the FOLDER in which |
| 395 | the messages to forward are located, and the MESSAGES' numbers. | ||
| 389 | 396 | ||
| 390 | Arguments are DESCRIPTION, a line of text for the Content-description header, | 397 | See also \\[mh-mh-to-mime]." |
| 391 | and FOLDER and MESSAGES, which name the message(s) to be forwarded. | ||
| 392 | |||
| 393 | See also \\[mh-edit-mhn]." | ||
| 394 | (interactive (list | 398 | (interactive (list |
| 395 | (read-string "Forw Content-description: ") | 399 | (mml-minibuffer-read-description) |
| 396 | (mh-prompt-for-folder "Message from" mh-sent-from-folder nil) | 400 | (mh-prompt-for-folder "Message from" mh-sent-from-folder nil) |
| 397 | (read-string (concat "Messages" | 401 | (read-string (concat "Messages" |
| 398 | (if (numberp mh-sent-from-msg) | 402 | (if (numberp mh-sent-from-msg) |
| 399 | (format " (default %d): " mh-sent-from-msg) | 403 | (format " (default %d): " |
| 404 | mh-sent-from-msg) | ||
| 400 | ": "))))) | 405 | ": "))))) |
| 401 | (beginning-of-line) | 406 | (beginning-of-line) |
| 402 | (insert "#forw [") | 407 | (insert "#forw [") |
| @@ -417,62 +422,59 @@ See also \\[mh-edit-mhn]." | |||
| 417 | (insert "\n")) | 422 | (insert "\n")) |
| 418 | 423 | ||
| 419 | ;;;###mh-autoload | 424 | ;;;###mh-autoload |
| 420 | (defun mh-edit-mhn (&optional extra-args) | 425 | (defun mh-mh-to-mime (&optional extra-args) |
| 421 | "Format the current draft for MIME, expanding any mhn directives. | 426 | "Compose MIME message from MH-style directives. |
| 422 | 427 | Typically, you send a message with attachments just like any other message. | |
| 423 | Process the current draft with the mhn program, which, using directives | 428 | However, you may take a sneak preview of the MIME encoding if you wish by |
| 424 | already inserted in the draft, fills in all the MIME components and header | 429 | running this command. |
| 425 | fields. | 430 | |
| 426 | 431 | If you wish to pass additional arguments to \"mhbuild\" (\"mhn\") to affect | |
| 427 | This step is performed automatically when sending the message, but this | 432 | how it builds your message, use the `mh-mh-to-mime-args' option. For example, |
| 428 | function may be called manually before sending the draft as well. | 433 | you can build a consistency check into the message by setting |
| 429 | 434 | `mh-mh-to-mime-args' to \"-check\". The recipient of your message can then run | |
| 430 | The `\\[mh-revert-mhn-edit]' command undoes this command. The arguments in the | 435 | \"mhbuild -check\" on the message--\"mhbuild\" (\"mhn\") will complain if the |
| 431 | list `mh-mhn-args' are passed to mhn if this function is passed an optional | 436 | message has been corrupted on the way. This command only consults this option |
| 432 | prefix argument EXTRA-ARGS. | 437 | when given a prefix argument. |
| 433 | 438 | ||
| 434 | For assistance with creating mhn directives to insert various types of | 439 | The value of `mh-mh-to-mime-hook' is a list of functions to be called after |
| 435 | components in a message, see \\[mh-mhn-compose-insertion] (generic insertion | 440 | the message has been formatted. |
| 436 | from a file), \\[mh-mhn-compose-anon-ftp] (external reference to file via | 441 | |
| 437 | anonymous ftp), \\[mh-mhn-compose-external-compressed-tar] \ \(reference to | 442 | The effects of this command can be undone by running \\[mh-mh-to-mime-undo]." |
| 438 | compressed tar file via anonymous ftp), and \\[mh-mhn-compose-forw] (forward | ||
| 439 | message). | ||
| 440 | |||
| 441 | The value of `mh-edit-mhn-hook' is a list of functions to be called, with no | ||
| 442 | arguments, after performing the conversion. | ||
| 443 | |||
| 444 | The mhn program is part of MH version 6.8 or later." | ||
| 445 | (interactive "*P") | 443 | (interactive "*P") |
| 446 | (mh-mhn-quote-unescaped-sharp) | 444 | (mh-mh-quote-unescaped-sharp) |
| 447 | (save-buffer) | 445 | (save-buffer) |
| 448 | (message "mhn editing...") | 446 | (message "Running %s..." (if (mh-variant-p 'nmh) "mhbuild" "mhn")) |
| 449 | (cond | 447 | (cond |
| 450 | ((mh-variant-p 'nmh) | 448 | ((mh-variant-p 'nmh) |
| 451 | (mh-exec-cmd-error nil | 449 | (mh-exec-cmd-error nil |
| 452 | "mhbuild" (if extra-args mh-mhn-args) buffer-file-name)) | 450 | "mhbuild" |
| 451 | (if extra-args mh-mh-to-mime-args) | ||
| 452 | buffer-file-name)) | ||
| 453 | (t | 453 | (t |
| 454 | (mh-exec-cmd-error (format "mhdraft=%s" buffer-file-name) | 454 | (mh-exec-cmd-error (format "mhdraft=%s" buffer-file-name) |
| 455 | "mhn" (if extra-args mh-mhn-args) buffer-file-name))) | 455 | "mhn" |
| 456 | (if extra-args mh-mh-to-mime-args) | ||
| 457 | buffer-file-name))) | ||
| 456 | (revert-buffer t t) | 458 | (revert-buffer t t) |
| 457 | (message "mhn editing...done") | 459 | (message "Running %s...done" (if (mh-variant-p 'nmh) "mhbuild" "mhn")) |
| 458 | (run-hooks 'mh-edit-mhn-hook)) | 460 | (run-hooks 'mh-mh-to-mime-hook)) |
| 459 | 461 | ||
| 460 | (defun mh-mhn-quote-unescaped-sharp () | 462 | (defun mh-mh-quote-unescaped-sharp () |
| 461 | "Quote `#' characters that haven't been quoted for `mhbuild'. | 463 | "Quote `#' characters that haven't been quoted for \"mhbuild\". |
| 462 | If the `#' character is present in the first column, but it isn't part of a | 464 | If the `#' character is present in the first column, but it isn't part of a |
| 463 | MHN directive then `mhbuild' gives an error. This function will quote all such | 465 | MH-style directive then \"mhbuild\" gives an error. This function will quote |
| 464 | characters." | 466 | all such characters." |
| 465 | (save-excursion | 467 | (save-excursion |
| 466 | (goto-char (point-min)) | 468 | (goto-char (point-min)) |
| 467 | (while (re-search-forward "^#" nil t) | 469 | (while (re-search-forward "^#" nil t) |
| 468 | (beginning-of-line) | 470 | (beginning-of-line) |
| 469 | (unless (mh-mhn-directive-present-p (point) (line-end-position)) | 471 | (unless (mh-mh-directive-present-p (point) (line-end-position)) |
| 470 | (insert "#")) | 472 | (insert "#")) |
| 471 | (goto-char (line-end-position))))) | 473 | (goto-char (line-end-position))))) |
| 472 | 474 | ||
| 473 | ;;;###mh-autoload | 475 | ;;;###mh-autoload |
| 474 | (defun mh-revert-mhn-edit (noconfirm) | 476 | (defun mh-mh-to-mime-undo (noconfirm) |
| 475 | "Undo the effect of \\[mh-edit-mhn] by reverting to the backup file. | 477 | "Undo effects of \\[mh-mh-to-mime]. |
| 476 | Optional non-nil argument NOCONFIRM means don't ask for confirmation." | 478 | Optional non-nil argument NOCONFIRM means don't ask for confirmation." |
| 477 | (interactive "*P") | 479 | (interactive "*P") |
| 478 | (if (null buffer-file-name) | 480 | (if (null buffer-file-name) |
| @@ -499,25 +501,25 @@ Optional non-nil argument NOCONFIRM means don't ask for confirmation." | |||
| 499 | (after-find-file nil))) | 501 | (after-find-file nil))) |
| 500 | 502 | ||
| 501 | ;;;###mh-autoload | 503 | ;;;###mh-autoload |
| 502 | (defun mh-mhn-directive-present-p (&optional begin end) | 504 | (defun mh-mh-directive-present-p (&optional begin end) |
| 503 | "Check if the text between BEGIN and END might be a MHN directive. | 505 | "Check if the text between BEGIN and END might be a MH-style directive. |
| 504 | The optional argument BEGIN defaults to the beginning of the buffer, while END | 506 | The optional argument BEGIN defaults to the beginning of the buffer, while END |
| 505 | defaults to the the end of the buffer." | 507 | defaults to the the end of the buffer." |
| 506 | (unless begin (setq begin (point-min))) | 508 | (unless begin (setq begin (point-min))) |
| 507 | (unless end (setq end (point-max))) | 509 | (unless end (setq end (point-max))) |
| 508 | (save-excursion | 510 | (save-excursion |
| 509 | (block 'search-for-mhn-directive | 511 | (block 'search-for-mh-directive |
| 510 | (goto-char begin) | 512 | (goto-char begin) |
| 511 | (while (re-search-forward "^#" end t) | 513 | (while (re-search-forward "^#" end t) |
| 512 | (let ((s (buffer-substring-no-properties (point) (line-end-position)))) | 514 | (let ((s (buffer-substring-no-properties (point) (line-end-position)))) |
| 513 | (cond ((equal s "")) | 515 | (cond ((equal s "")) |
| 514 | ((string-match "^forw[ \t\n]+" s) | 516 | ((string-match "^forw[ \t\n]+" s) |
| 515 | (return-from 'search-for-mhn-directive t)) | 517 | (return-from 'search-for-mh-directive t)) |
| 516 | (t (let ((first-token (car (split-string s "[ \t;@]")))) | 518 | (t (let ((first-token (car (split-string s "[ \t;@]")))) |
| 517 | (when (and first-token | 519 | (when (and first-token |
| 518 | (string-match mh-media-type-regexp | 520 | (string-match mh-media-type-regexp |
| 519 | first-token)) | 521 | first-token)) |
| 520 | (return-from 'search-for-mhn-directive t))))))) | 522 | (return-from 'search-for-mh-directive t))))))) |
| 521 | nil))) | 523 | nil))) |
| 522 | 524 | ||
| 523 | 525 | ||
| @@ -526,12 +528,15 @@ defaults to the the end of the buffer." | |||
| 526 | 528 | ||
| 527 | ;;;###mh-autoload | 529 | ;;;###mh-autoload |
| 528 | (defun mh-mml-to-mime () | 530 | (defun mh-mml-to-mime () |
| 529 | "Compose MIME message from mml directives. | 531 | "Compose MIME message from MML tags. |
| 530 | This step is performed automatically when sending the message, but this | 532 | Typically, you send a message with attachments just like any other message. |
| 531 | function may be called manually before sending the draft as well." | 533 | However, you may take a sneak preview of the MIME encoding if you wish by |
| 534 | running this command. | ||
| 535 | |||
| 536 | This action can be undone by running \\[undo]." | ||
| 532 | (interactive) | 537 | (interactive) |
| 533 | (require 'message) | 538 | (require 'message) |
| 534 | (when mh-gnus-pgp-support-flag ;; This is only needed for PGP | 539 | (when mh-pgp-support-flag ;; This is only needed for PGP |
| 535 | (message-options-set-recipient)) | 540 | (message-options-set-recipient)) |
| 536 | (let ((saved-text (buffer-string)) | 541 | (let ((saved-text (buffer-string)) |
| 537 | (buffer (current-buffer)) | 542 | (buffer (current-buffer)) |
| @@ -573,53 +578,45 @@ number." | |||
| 573 | (if current-prefix-arg | 578 | (if current-prefix-arg |
| 574 | (let ((def (or (car mh-mml-cryptographic-method-history) | 579 | (let ((def (or (car mh-mml-cryptographic-method-history) |
| 575 | mh-mml-method-default))) | 580 | mh-mml-method-default))) |
| 576 | (completing-read (format "Method: [%s] " def) | 581 | (completing-read (format "Method (default %s): " def) |
| 577 | '(("pgp") ("pgpmime") ("smime")) | 582 | '(("pgp") ("pgpmime") ("smime")) |
| 578 | nil t nil 'mh-mml-cryptographic-method-history def)) | 583 | nil t nil 'mh-mml-cryptographic-method-history def)) |
| 579 | mh-mml-method-default)) | 584 | mh-mml-method-default)) |
| 580 | 585 | ||
| 581 | ;;;###mh-autoload | 586 | ;;;###mh-autoload |
| 582 | (defun mh-mml-attach-file (&optional disposition) | 587 | (defun mh-mml-attach-file (&optional disposition) |
| 583 | "Attach a file to the outgoing MIME message. | 588 | "Add a tag to insert a MIME message part from a file. |
| 584 | The file is not inserted or encoded until you send the message with | 589 | You are prompted for the filename containing the object, the media type if it |
| 585 | `\\[mh-send-letter]'. | 590 | cannot be determined automatically, a content description and the disposition |
| 586 | Message disposition is \"inline\" or \"attachment\" and is prompted for if | 591 | of the attachment. |
| 587 | DISPOSITION is nil. | ||
| 588 | 592 | ||
| 589 | This is basically `mml-attach-file' from gnus, modified such that a prefix | 593 | This is basically `mml-attach-file' from Gnus, modified such that a prefix |
| 590 | argument yields an `inline' disposition and Content-Type is determined | 594 | argument yields an `inline' disposition and Content-Type is determined |
| 591 | automatically." | 595 | automatically." |
| 592 | (let* ((file (mml-minibuffer-read-file "Attach file: ")) | 596 | (let* ((file (mml-minibuffer-read-file "Attach file: ")) |
| 593 | (type (or (mh-file-mime-type file) | 597 | (type (mh-minibuffer-read-type file)) |
| 594 | (completing-read "Content-Type: " | ||
| 595 | (if (fboundp 'mailcap-mime-types) | ||
| 596 | (mapcar 'list (mailcap-mime-types)) | ||
| 597 | mh-mime-content-types)))) | ||
| 598 | (description (mml-minibuffer-read-description)) | 598 | (description (mml-minibuffer-read-description)) |
| 599 | (dispos (or disposition | 599 | (dispos (or disposition |
| 600 | (completing-read "Disposition: [attachment] " | 600 | (mml-minibuffer-read-disposition type)))) |
| 601 | '(("attachment")("inline")) | ||
| 602 | nil t nil nil | ||
| 603 | "attachment")))) | ||
| 604 | (mml-insert-empty-tag 'part 'type type 'filename file | 601 | (mml-insert-empty-tag 'part 'type type 'filename file |
| 605 | 'disposition dispos 'description description))) | 602 | 'disposition dispos 'description description))) |
| 606 | 603 | ||
| 607 | (defvar mh-identity-pgg-default-user-id) | 604 | (defvar mh-identity-pgg-default-user-id) |
| 608 | 605 | ||
| 609 | (defun mh-secure-message (method mode &optional identity) | 606 | (defun mh-secure-message (method mode &optional identity) |
| 610 | "Add directive to Encrypt/Sign an entire message. | 607 | "Add tag to encrypt or sign message. |
| 611 | METHOD should be one of: \"pgpmime\", \"pgp\", \"smime\". | 608 | METHOD should be one of: \"pgpmime\", \"pgp\", \"smime\". |
| 612 | MODE should be one of: \"sign\", \"encrypt\", \"signencrypt\", \"none\". | 609 | MODE should be one of: \"sign\", \"encrypt\", \"signencrypt\", \"none\". |
| 613 | IDENTITY is optionally the default-user-id to use." | 610 | IDENTITY is optionally the default-user-id to use." |
| 614 | (if (not mh-gnus-pgp-support-flag) | 611 | (if (not mh-pgp-support-flag) |
| 615 | (error "Sorry. Your version of gnus does not support PGP/GPG") | 612 | (error "Your version of Gnus does not support PGP/GPG") |
| 616 | ;; Check the arguments | 613 | ;; Check the arguments |
| 617 | (let ((valid-methods (list "pgpmime" "pgp" "smime")) | 614 | (let ((valid-methods (list "pgpmime" "pgp" "smime")) |
| 618 | (valid-modes (list "sign" "encrypt" "signencrypt" "none"))) | 615 | (valid-modes (list "sign" "encrypt" "signencrypt" "none"))) |
| 619 | (if (not (member method valid-methods)) | 616 | (if (not (member method valid-methods)) |
| 620 | (error "Sorry. METHOD \"%s\" is invalid" method)) | 617 | (error "Method \"%s\" is invalid" method)) |
| 621 | (if (not (member mode valid-modes)) | 618 | (if (not (member mode valid-modes)) |
| 622 | (error "Sorry. MODE \"%s\" is invalid" mode)) | 619 | (error "Mode \"%s\" is invalid" mode)) |
| 623 | (mml-unsecure-message) | 620 | (mml-unsecure-message) |
| 624 | (if (not (string= mode "none")) | 621 | (if (not (string= mode "none")) |
| 625 | (save-excursion | 622 | (save-excursion |
| @@ -632,34 +629,46 @@ IDENTITY is optionally the default-user-id to use." | |||
| 632 | 629 | ||
| 633 | ;;;###mh-autoload | 630 | ;;;###mh-autoload |
| 634 | (defun mh-mml-unsecure-message (&optional ignore) | 631 | (defun mh-mml-unsecure-message (&optional ignore) |
| 635 | "Remove any secure message directives. | 632 | "Remove any secure message tags. |
| 636 | The IGNORE argument is not used." | 633 | The argument IGNORE is not used." |
| 637 | (interactive "P") | 634 | (interactive "P") |
| 638 | (if (not mh-gnus-pgp-support-flag) | 635 | (if (not mh-pgp-support-flag) |
| 639 | (error "Sorry. Your version of gnus does not support PGP/GPG") | 636 | (error "Your version of Gnus does not support PGP/GPG") |
| 640 | (mml-unsecure-message))) | 637 | (mml-unsecure-message))) |
| 641 | 638 | ||
| 642 | ;;;###mh-autoload | 639 | ;;;###mh-autoload |
| 643 | (defun mh-mml-secure-message-sign (method) | 640 | (defun mh-mml-secure-message-sign (method) |
| 644 | "Add security directive to sign the entire message using METHOD." | 641 | "Add tag to sign the message. |
| 642 | A proper multipart message is created for you when you send the message. Use | ||
| 643 | the \\[mh-mml-unsecure-message] command to remove this tag. Use a prefix | ||
| 644 | argument METHOD to be prompted for one of the possible security methods | ||
| 645 | (see `mh-mml-method-default')." | ||
| 645 | (interactive (list (mh-mml-query-cryptographic-method))) | 646 | (interactive (list (mh-mml-query-cryptographic-method))) |
| 646 | (mh-secure-message method "sign" mh-identity-pgg-default-user-id)) | 647 | (mh-secure-message method "sign" mh-identity-pgg-default-user-id)) |
| 647 | 648 | ||
| 648 | ;;;###mh-autoload | 649 | ;;;###mh-autoload |
| 649 | (defun mh-mml-secure-message-encrypt (method) | 650 | (defun mh-mml-secure-message-encrypt (method) |
| 650 | "Add security directive to encrypt the entire message using METHOD." | 651 | "Add tag to encrypt the message. |
| 652 | A proper multipart message is created for you when you send the message. Use | ||
| 653 | the \\[mh-mml-unsecure-message] command to remove this tag. Use a prefix | ||
| 654 | argument METHOD to be prompted for one of the possible security methods | ||
| 655 | (see `mh-mml-method-default')." | ||
| 651 | (interactive (list (mh-mml-query-cryptographic-method))) | 656 | (interactive (list (mh-mml-query-cryptographic-method))) |
| 652 | (mh-secure-message method "encrypt" mh-identity-pgg-default-user-id)) | 657 | (mh-secure-message method "encrypt" mh-identity-pgg-default-user-id)) |
| 653 | 658 | ||
| 654 | ;;;###mh-autoload | 659 | ;;;###mh-autoload |
| 655 | (defun mh-mml-secure-message-signencrypt (method) | 660 | (defun mh-mml-secure-message-signencrypt (method) |
| 656 | "Add security directive to encrypt and sign the entire message using METHOD." | 661 | "Add tag to encrypt and sign the message. |
| 662 | A proper multipart message is created for you when you send the message. Use | ||
| 663 | the \\[mh-mml-unsecure-message] command to remove this tag. Use a prefix | ||
| 664 | argument METHOD to be prompted for one of the possible security methods | ||
| 665 | (see `mh-mml-method-default')." | ||
| 657 | (interactive (list (mh-mml-query-cryptographic-method))) | 666 | (interactive (list (mh-mml-query-cryptographic-method))) |
| 658 | (mh-secure-message method "signencrypt" mh-identity-pgg-default-user-id)) | 667 | (mh-secure-message method "signencrypt" mh-identity-pgg-default-user-id)) |
| 659 | 668 | ||
| 660 | ;;;###mh-autoload | 669 | ;;;###mh-autoload |
| 661 | (defun mh-mml-directive-present-p () | 670 | (defun mh-mml-tag-present-p () |
| 662 | "Check if the current buffer has text which may be an MML directive." | 671 | "Check if the current buffer has text which may be a MML tag." |
| 663 | (save-excursion | 672 | (save-excursion |
| 664 | (goto-char (point-min)) | 673 | (goto-char (point-min)) |
| 665 | (re-search-forward | 674 | (re-search-forward |
| @@ -682,7 +691,7 @@ The IGNORE argument is not used." | |||
| 682 | 691 | ||
| 683 | ;;;###mh-autoload | 692 | ;;;###mh-autoload |
| 684 | (defun mh-destroy-postponed-handles () | 693 | (defun mh-destroy-postponed-handles () |
| 685 | "Free MIME data for externally displayed mime parts." | 694 | "Free MIME data for externally displayed MIME parts." |
| 686 | (let ((mime-data (mh-buffer-data))) | 695 | (let ((mime-data (mh-buffer-data))) |
| 687 | (when mime-data | 696 | (when mime-data |
| 688 | (mm-destroy-parts (mh-mime-handles mime-data))) | 697 | (mm-destroy-parts (mh-mime-handles mime-data))) |
| @@ -736,13 +745,13 @@ This is used to decide if smileys and graphical emphasis will be displayed." | |||
| 736 | 745 | ||
| 737 | ;;;###mh-autoload | 746 | ;;;###mh-autoload |
| 738 | (defun mh-display-smileys () | 747 | (defun mh-display-smileys () |
| 739 | "Function to display smileys." | 748 | "Display smileys." |
| 740 | (when (and mh-graphical-smileys-flag (mh-small-show-buffer-p)) | 749 | (when (and mh-graphical-smileys-flag (mh-small-show-buffer-p)) |
| 741 | (mh-funcall-if-exists smiley-region (point-min) (point-max)))) | 750 | (mh-funcall-if-exists smiley-region (point-min) (point-max)))) |
| 742 | 751 | ||
| 743 | ;;;###mh-autoload | 752 | ;;;###mh-autoload |
| 744 | (defun mh-display-emphasis () | 753 | (defun mh-display-emphasis () |
| 745 | "Function to display graphical emphasis." | 754 | "Display graphical emphasis." |
| 746 | (when (and mh-graphical-emphasis-flag (mh-small-show-buffer-p)) | 755 | (when (and mh-graphical-emphasis-flag (mh-small-show-buffer-p)) |
| 747 | (flet ((article-goto-body ())) ; shadow this function to do nothing | 756 | (flet ((article-goto-body ())) ; shadow this function to do nothing |
| 748 | (save-excursion | 757 | (save-excursion |
| @@ -799,8 +808,7 @@ Set from last use.") | |||
| 799 | "Store the MIME parts of the current message. | 808 | "Store the MIME parts of the current message. |
| 800 | If ARG, prompt for directory, else use that specified by the variable | 809 | If ARG, prompt for directory, else use that specified by the variable |
| 801 | `mh-mime-save-parts-default-directory'. These directories may be superseded by | 810 | `mh-mime-save-parts-default-directory'. These directories may be superseded by |
| 802 | mh_profile directives, since this function calls on mhstore or mhn to do the | 811 | MH profile components, since this function calls on mhstore to do the work." |
| 803 | actual storing." | ||
| 804 | (interactive "P") | 812 | (interactive "P") |
| 805 | (let ((msg (if (eq major-mode 'mh-show-mode) | 813 | (let ((msg (if (eq major-mode 'mh-show-mode) |
| 806 | (mh-show-buffer-message-number) | 814 | (mh-show-buffer-message-number) |
| @@ -940,7 +948,7 @@ displayed." | |||
| 940 | (mh-mime-display-single handle)) | 948 | (mh-mime-display-single handle)) |
| 941 | ((equal (car handle) "multipart/alternative") | 949 | ((equal (car handle) "multipart/alternative") |
| 942 | (mh-mime-display-alternative (cdr handle))) | 950 | (mh-mime-display-alternative (cdr handle))) |
| 943 | ((and mh-gnus-pgp-support-flag | 951 | ((and mh-pgp-support-flag |
| 944 | (or (equal (car handle) "multipart/signed") | 952 | (or (equal (car handle) "multipart/signed") |
| 945 | (equal (car handle) "multipart/encrypted"))) | 953 | (equal (car handle) "multipart/encrypted"))) |
| 946 | (mh-mime-display-security handle)) | 954 | (mh-mime-display-security handle)) |
| @@ -1047,7 +1055,7 @@ This is only useful if a Content-Disposition header is not present." | |||
| 1047 | (mm-inlined-p handle))))))) | 1055 | (mm-inlined-p handle))))))) |
| 1048 | (save-restriction | 1056 | (save-restriction |
| 1049 | (narrow-to-region (point) (if (eobp) (point) (1+ (point)))) | 1057 | (narrow-to-region (point) (if (eobp) (point) (1+ (point)))) |
| 1050 | (cond ((and mh-gnus-pgp-support-flag | 1058 | (cond ((and mh-pgp-support-flag |
| 1051 | (equal type "application/pgp-signature")) | 1059 | (equal type "application/pgp-signature")) |
| 1052 | nil) ; skip signatures as they are already handled... | 1060 | nil) ; skip signatures as they are already handled... |
| 1053 | ((not displayp) | 1061 | ((not displayp) |
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el index 2dbd313b1d2..295d64ec8fd 100644 --- a/lisp/mh-e/mh-utils.el +++ b/lisp/mh-e/mh-utils.el | |||
| @@ -175,8 +175,8 @@ Use `mh-signature-separator-regexp' when searching for a separator.") | |||
| 175 | (defvar mh-globals-hash (make-hash-table) | 175 | (defvar mh-globals-hash (make-hash-table) |
| 176 | "Keeps track of MIME data on a per buffer basis.") | 176 | "Keeps track of MIME data on a per buffer basis.") |
| 177 | 177 | ||
| 178 | (defvar mh-gnus-pgp-support-flag (not (not (locate-library "mml2015"))) | 178 | (defvar mh-pgp-support-flag (not (not (locate-library "mml2015"))) |
| 179 | "Non-nil means installed Gnus has PGP support.") | 179 | "Non-nil means PGP support is available.") |
| 180 | 180 | ||
| 181 | (defvar mh-mm-inline-media-tests | 181 | (defvar mh-mm-inline-media-tests |
| 182 | `(("image/jpeg" | 182 | `(("image/jpeg" |
| @@ -410,10 +410,10 @@ Argument LIMIT limits search." | |||
| 410 | 410 | ||
| 411 | (defun mh-show-font-lock-fontify-region (beg end loudly) | 411 | (defun mh-show-font-lock-fontify-region (beg end loudly) |
| 412 | "Limit font-lock in `mh-show-mode' to the header. | 412 | "Limit font-lock in `mh-show-mode' to the header. |
| 413 | Used when `mh-highlight-citation-p' is set to gnus, leaving the body to be | 413 | Used when `mh-highlight-citation-p' is set to \"'gnus\", leaving the body to |
| 414 | dealt with by gnus highlighting. The region between BEG and END is | 414 | be dealt with by gnus highlighting. The region between BEG and END is given |
| 415 | given over to be fontified and LOUDLY controls if a user sees a | 415 | over to be fontified and LOUDLY controls if a user sees a message about the |
| 416 | message about the fontification operation." | 416 | fontification operation." |
| 417 | (let ((header-end (mh-mail-header-end))) | 417 | (let ((header-end (mh-mail-header-end))) |
| 418 | (cond | 418 | (cond |
| 419 | ((and (< beg header-end)(< end header-end)) | 419 | ((and (< beg header-end)(< end header-end)) |
| @@ -432,7 +432,7 @@ message about the fontification operation." | |||
| 432 | (require 'gnus-cite)))) | 432 | (require 'gnus-cite)))) |
| 433 | 433 | ||
| 434 | (defun mh-gnus-article-highlight-citation () | 434 | (defun mh-gnus-article-highlight-citation () |
| 435 | "Highlight cited text in current buffer using gnus." | 435 | "Highlight cited text in current buffer using Gnus." |
| 436 | (interactive) | 436 | (interactive) |
| 437 | ;; Requiring gnus-cite should have been sufficient. However for Emacs21.1, | 437 | ;; Requiring gnus-cite should have been sufficient. However for Emacs21.1, |
| 438 | ;; recursive-load-depth-limit is only 10, so an error occurs. Also it may be | 438 | ;; recursive-load-depth-limit is only 10, so an error occurs. Also it may be |