diff options
| -rw-r--r-- | lisp/mail/sendmail.el | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index 1748430e4fe..7444a79aa0e 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el | |||
| @@ -430,7 +430,8 @@ If within the headers, this makes the new lines into continuation lines." | |||
| 430 | (define-key mail-mode-map "\C-c\C-w" 'mail-signature) | 430 | (define-key mail-mode-map "\C-c\C-w" 'mail-signature) |
| 431 | (define-key mail-mode-map "\C-c\C-v" 'mail-sent-via) | 431 | (define-key mail-mode-map "\C-c\C-v" 'mail-sent-via) |
| 432 | (define-key mail-mode-map "\C-c\C-c" 'mail-send-and-exit) | 432 | (define-key mail-mode-map "\C-c\C-c" 'mail-send-and-exit) |
| 433 | (define-key mail-mode-map "\C-c\C-s" 'mail-send)) | 433 | (define-key mail-mode-map "\C-c\C-s" 'mail-send) |
| 434 | (define-key mail-mode-map "\C-c\C-i" 'mail-attach-file)) | ||
| 434 | 435 | ||
| 435 | (define-key mail-mode-map [menu-bar mail] | 436 | (define-key mail-mode-map [menu-bar mail] |
| 436 | (cons "Mail" (make-sparse-keymap "Mail"))) | 437 | (cons "Mail" (make-sparse-keymap "Mail"))) |
| @@ -1094,6 +1095,26 @@ and don't delete any header fields." | |||
| 1094 | (run-hooks 'mail-yank-hooks) | 1095 | (run-hooks 'mail-yank-hooks) |
| 1095 | (mail-indent-citation)))))))) | 1096 | (mail-indent-citation)))))))) |
| 1096 | 1097 | ||
| 1098 | (defun mail-attach-file (&optional file) | ||
| 1099 | "Insert a file at the end of the buffer, with separator lines around it." | ||
| 1100 | (interactive "fAttach file: ") | ||
| 1101 | (save-excursion | ||
| 1102 | (goto-char (point-max)) | ||
| 1103 | (or (bolp) (newline)) | ||
| 1104 | (newline) | ||
| 1105 | (let ((start (point)) | ||
| 1106 | middle) | ||
| 1107 | (insert (format "===File %s===" file)) | ||
| 1108 | (insert-char ?= (max 0 (- 60 (current-column)))) | ||
| 1109 | (newline) | ||
| 1110 | (setq middle (point)) | ||
| 1111 | (insert "============================================================\n") | ||
| 1112 | (push-mark) | ||
| 1113 | (goto-char middle) | ||
| 1114 | (insert-file-contents file) | ||
| 1115 | (or (bolp) (newline)) | ||
| 1116 | (goto-char start)))) | ||
| 1117 | |||
| 1097 | ;; Put these last, to reduce chance of lossage from quitting in middle of loading the file. | 1118 | ;; Put these last, to reduce chance of lossage from quitting in middle of loading the file. |
| 1098 | 1119 | ||
| 1099 | ;;;###autoload | 1120 | ;;;###autoload |