diff options
| author | Richard M. Stallman | 2008-12-23 04:02:15 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2008-12-23 04:02:15 +0000 |
| commit | 733dc362f6a2184916360c19e71858dc7edda776 (patch) | |
| tree | deaffcd0599f12615b77beca90d3057618d96291 | |
| parent | 759f544f5a4c2f2e447eb2bb59a46cf8717ff5eb (diff) | |
| download | emacs-733dc362f6a2184916360c19e71858dc7edda776.tar.gz emacs-733dc362f6a2184916360c19e71858dc7edda776.zip | |
(pmail-edit-current-message): Change error message.
| -rw-r--r-- | lisp/mail/pmailedit.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/mail/pmailedit.el b/lisp/mail/pmailedit.el index c4585bc0f86..a91cfcf40ec 100644 --- a/lisp/mail/pmailedit.el +++ b/lisp/mail/pmailedit.el | |||
| @@ -61,6 +61,8 @@ to return to regular PMAIL: | |||
| 61 | * \\[pmail-cease-edit] makes them permanent. | 61 | * \\[pmail-cease-edit] makes them permanent. |
| 62 | This functions runs the normal hook `pmail-edit-mode-hook'. | 62 | This functions runs the normal hook `pmail-edit-mode-hook'. |
| 63 | \\{pmail-edit-map}" | 63 | \\{pmail-edit-map}" |
| 64 | ;; Changing the major mode unswaps the Pmail buffer | ||
| 65 | ;; via change-major-mode-hook. | ||
| 64 | (delay-mode-hooks (text-mode)) | 66 | (delay-mode-hooks (text-mode)) |
| 65 | (use-local-map pmail-edit-map) | 67 | (use-local-map pmail-edit-map) |
| 66 | (setq major-mode 'pmail-edit-mode) | 68 | (setq major-mode 'pmail-edit-mode) |
| @@ -82,9 +84,11 @@ This functions runs the normal hook `pmail-edit-mode-hook'. | |||
| 82 | "Edit the contents of this message." | 84 | "Edit the contents of this message." |
| 83 | (interactive) | 85 | (interactive) |
| 84 | (if (= pmail-total-messages 0) | 86 | (if (= pmail-total-messages 0) |
| 85 | (error "No messages in this file")) | 87 | (error "No messages in this buffer")) |
| 86 | (make-local-variable 'pmail-old-pruned) | 88 | (make-local-variable 'pmail-old-pruned) |
| 87 | (setq pmail-old-pruned (eq pmail-header-style 'normal)) | 89 | (setq pmail-old-pruned (eq pmail-header-style 'normal)) |
| 90 | ;; Changing the major mode unswaps the Pmail buffer | ||
| 91 | ;; via change-major-mode-hook. | ||
| 88 | (pmail-edit-mode) | 92 | (pmail-edit-mode) |
| 89 | (make-local-variable 'pmail-old-text) | 93 | (make-local-variable 'pmail-old-text) |
| 90 | (setq pmail-old-text (buffer-substring (point-min) (point-max))) | 94 | (setq pmail-old-text (buffer-substring (point-min) (point-max))) |
| @@ -114,16 +118,20 @@ This functions runs the normal hook `pmail-edit-mode-hook'. | |||
| 114 | (set-marker (aref pmail-message-vector (1+ pmail-current-message)) | 118 | (set-marker (aref pmail-message-vector (1+ pmail-current-message)) |
| 115 | (point))) | 119 | (point))) |
| 116 | (let ((old pmail-old-text)) | 120 | (let ((old pmail-old-text)) |
| 121 | ;; Go back to Pmail mode, but carefully. | ||
| 117 | (force-mode-line-update) | 122 | (force-mode-line-update) |
| 118 | (kill-all-local-variables) | 123 | (kill-all-local-variables) |
| 119 | (pmail-mode-1) | 124 | (pmail-mode-1) |
| 120 | (if (boundp 'tool-bar-map) | 125 | (if (boundp 'tool-bar-map) |
| 121 | (set (make-local-variable 'tool-bar-map) pmail-tool-bar-map)) | 126 | (set (make-local-variable 'tool-bar-map) pmail-tool-bar-map)) |
| 122 | (pmail-variables) | 127 | (pmail-variables) |
| 128 | ;; If text has really changed, mark message as edited. | ||
| 123 | (unless (and (= (length old) (- (point-max) (point-min))) | 129 | (unless (and (= (length old) (- (point-max) (point-min))) |
| 124 | (string= old (buffer-substring (point-min) (point-max)))) | 130 | (string= old (buffer-substring (point-min) (point-max)))) |
| 125 | (setq old nil) | 131 | (setq old nil) |
| 126 | (pmail-set-attribute pmail-edited-attr-index t) | 132 | (pmail-set-attribute pmail-edited-attr-index t) |
| 133 | ;;;??? BROKEN perhaps. | ||
| 134 | ;; I think that the Summary-Line header may not be kept there any more. | ||
| 127 | (if (boundp 'pmail-summary-vector) | 135 | (if (boundp 'pmail-summary-vector) |
| 128 | (progn | 136 | (progn |
| 129 | (aset pmail-summary-vector (1- pmail-current-message) nil) | 137 | (aset pmail-summary-vector (1- pmail-current-message) nil) |