aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2009-02-01 03:26:17 +0000
committerStefan Monnier2009-02-01 03:26:17 +0000
commitbefa8175626a8be1a5f1f75341c8d05a4ffc8786 (patch)
tree5b04de2f0baa9d08ea05fc9f653721624c02255c
parent72d06d81501d0e6ba56d6d3dde3a181047cc1ebe (diff)
downloademacs-befa8175626a8be1a5f1f75341c8d05a4ffc8786.tar.gz
emacs-befa8175626a8be1a5f1f75341c8d05a4ffc8786.zip
(rmail-edit-map): Move init into declaration.
(rmail-edit-mode, rmail-cease-edit): Use with-current-buffer.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/mail/rmailedit.el29
2 files changed, 19 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 959d1fb246b..bd6da5daa15 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12009-02-01 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * mail/rmailedit.el (rmail-edit-map): Move init into declaration.
4 (rmail-edit-mode, rmail-cease-edit): Use with-current-buffer.
5
12009-01-31 Stefan Monnier <monnier@iro.umontreal.ca> 62009-01-31 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * mouse.el (mouse-drag-mode-line-1): Obey mouse-1-click-follows-link. 8 * mouse.el (mouse-drag-mode-line-1): Obey mouse-1-click-follows-link.
diff --git a/lisp/mail/rmailedit.el b/lisp/mail/rmailedit.el
index 8aeacfb8396..86ffdc9d2f6 100644
--- a/lisp/mail/rmailedit.el
+++ b/lisp/mail/rmailedit.el
@@ -37,14 +37,14 @@
37 37
38(defvar rmail-old-text) 38(defvar rmail-old-text)
39 39
40(defvar rmail-edit-map nil) 40(defvar rmail-edit-map
41(if rmail-edit-map 41 (let ((map (make-sparse-keymap)))
42 nil 42 ;; Make a keymap that inherits text-mode-map.
43 ;; Make a keymap that inherits text-mode-map. 43 (set-keymap-parent map text-mode-map)
44 (setq rmail-edit-map (make-sparse-keymap)) 44 (define-key map "\C-c\C-c" 'rmail-cease-edit)
45 (set-keymap-parent rmail-edit-map text-mode-map) 45 (define-key map "\C-c\C-]" 'rmail-abort-edit)
46 (define-key rmail-edit-map "\C-c\C-c" 'rmail-cease-edit) 46 map))
47 (define-key rmail-edit-map "\C-c\C-]" 'rmail-abort-edit)) 47
48 48
49;; Rmail Edit mode is suitable only for specially formatted data. 49;; Rmail Edit mode is suitable only for specially formatted data.
50(put 'rmail-edit-mode 'mode-class 'special) 50(put 'rmail-edit-mode 'mode-class 'special)
@@ -62,11 +62,10 @@ to return to regular RMAIL:
62This functions runs the normal hook `rmail-edit-mode-hook'. 62This functions runs the normal hook `rmail-edit-mode-hook'.
63\\{rmail-edit-map}" 63\\{rmail-edit-map}"
64 (if (rmail-summary-exists) 64 (if (rmail-summary-exists)
65 (save-excursion 65 (with-current-buffer rmail-summary-buffer
66 (set-buffer rmail-summary-buffer)
67 (rmail-summary-disable))) 66 (rmail-summary-disable)))
68 (let (rmail-buffer-swapped) 67 (let ((rmail-buffer-swapped nil)) ; Prevent change-major-mode-hook
69 ;; Prevent change-major-mode-hook from unswapping the buffers. 68 ; from unswapping the buffers.
70 (delay-mode-hooks (text-mode)) 69 (delay-mode-hooks (text-mode))
71 (use-local-map rmail-edit-map) 70 (use-local-map rmail-edit-map)
72 (setq major-mode 'rmail-edit-mode) 71 (setq major-mode 'rmail-edit-mode)
@@ -105,8 +104,7 @@ This functions runs the normal hook `rmail-edit-mode-hook'.
105 "Finish editing message; switch back to Rmail proper." 104 "Finish editing message; switch back to Rmail proper."
106 (interactive) 105 (interactive)
107 (if (rmail-summary-exists) 106 (if (rmail-summary-exists)
108 (save-excursion 107 (with-current-buffer rmail-summary-buffer
109 (set-buffer rmail-summary-buffer)
110 (rmail-summary-enable))) 108 (rmail-summary-enable)))
111 (widen) 109 (widen)
112 ;; Disguise any "From " lines so they don't start a new message. 110 ;; Disguise any "From " lines so they don't start a new message.
@@ -129,7 +127,8 @@ This functions runs the normal hook `rmail-edit-mode-hook'.
129 headers-end) 127 headers-end)
130 ;; Go back to Rmail mode, but carefully. 128 ;; Go back to Rmail mode, but carefully.
131 (force-mode-line-update) 129 (force-mode-line-update)
132 (let (rmail-buffer-swapped) 130 (let ((rmail-buffer-swapped nil)) ; Prevent change-major-mode-hook
131 ; from unswapping the buffers.
133 (kill-all-local-variables) 132 (kill-all-local-variables)
134 (rmail-mode-1) 133 (rmail-mode-1)
135 (if (boundp 'tool-bar-map) 134 (if (boundp 'tool-bar-map)