annotate lisp/mail/rmailedit.el @ 88265:defd9948075b

(rmail-highlight-face): Doc. (rmail-font-lock-keywords): Add the stuff necessary to make rmail-highlight-headers obsolete. (rmail-toggle-header, rmail-show-message): Don't call rmail-highlight-headers anymore. (rmail-highlight-headers): Deleted.
author Alex Schroeder <alex@gnu.org>
date Sat, 21 Jan 2006 18:21:07 +0000
parents 259a58cdd236
children 7ed20fa4aa34
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38412
253f761ad37b Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents: 37601
diff changeset
1 ;;; rmailedit.el --- "RMAIL edit mode" Edit the current message
658
7cbd4fcd8b0f *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 368
diff changeset
2
88214
259a58cdd236 (rmail-cease-edit): Bugfix.
Alex Schroeder <alex@gnu.org>
parents: 88184
diff changeset
3 ;; Copyright (C) 1985, 1994, 2001, 2002, 2003, 2004, 2005,
259a58cdd236 (rmail-cease-edit): Bugfix.
Alex Schroeder <alex@gnu.org>
parents: 88184
diff changeset
4 ;; 2006 Free Software Foundation, Inc.
845
213978acbc1e entered into RCS
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 814
diff changeset
5
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 658
diff changeset
6 ;; Maintainer: FSF
814
38b2499cb3e9 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 807
diff changeset
7 ;; Keywords: mail
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 658
diff changeset
8
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
9 ;; This file is part of GNU Emacs.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
10
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 658
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
14 ;; any later version.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
15
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
19 ;; GNU General Public License for more details.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
20
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 11573
diff changeset
22 ;; along with GNU Emacs; see the file COPYING. If not, write to the
88155
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents: 88142
diff changeset
23 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents: 88142
diff changeset
24 ;; Boston, MA 02110-1301, USA.
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
25
38412
253f761ad37b Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents: 37601
diff changeset
26 ;;; Commentary:
253f761ad37b Some fixes to follow coding conventions in files maintained by FSF.
Pavel Janík <Pavel@Janik.cz>
parents: 37601
diff changeset
27
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 658
diff changeset
28 ;;; Code:
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
29
88126
eefd09a79efd Attempt to eliminate some byte compiler warnings.
Paul Reilly <pmr@pajato.com>
parents: 48341
diff changeset
30 (eval-when-compile
eefd09a79efd Attempt to eliminate some byte compiler warnings.
Paul Reilly <pmr@pajato.com>
parents: 48341
diff changeset
31 (require 'rmail)
eefd09a79efd Attempt to eliminate some byte compiler warnings.
Paul Reilly <pmr@pajato.com>
parents: 48341
diff changeset
32 (require 'rmaildesc)
eefd09a79efd Attempt to eliminate some byte compiler warnings.
Paul Reilly <pmr@pajato.com>
parents: 48341
diff changeset
33 (require 'rmailsum))
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
34
37588
9adbbd869684 (rmail-edit-mode): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 26485
diff changeset
35 (defcustom rmail-edit-mode-hook nil
9adbbd869684 (rmail-edit-mode): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 26485
diff changeset
36 "List of functions to call when editing an RMAIL message."
9adbbd869684 (rmail-edit-mode): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 26485
diff changeset
37 :type 'hook
37601
58918e5712d6 (rmail-edit-mode-hook): Add :version.
Gerd Moellmann <gerd@gnu.org>
parents: 37588
diff changeset
38 :version "21.1"
37588
9adbbd869684 (rmail-edit-mode): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 26485
diff changeset
39 :group 'rmail-edit)
9adbbd869684 (rmail-edit-mode): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 26485
diff changeset
40
21436
779c7dcd4c04 (rmail-cease-edit): Call kill-all-local-variables.
Karl Heuer <kwzh@gnu.org>
parents: 16347
diff changeset
41 (defvar rmail-old-text)
779c7dcd4c04 (rmail-cease-edit): Call kill-all-local-variables.
Karl Heuer <kwzh@gnu.org>
parents: 16347
diff changeset
42
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
43 (defvar rmail-edit-map nil)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
44 (if rmail-edit-map
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
45 nil
4179
dfc4e9e14d24 (rmail-edit-map): Inherit properly from text-mode-map;
Richard M. Stallman <rms@gnu.org>
parents: 845
diff changeset
46 ;; Make a keymap that inherits text-mode-map.
21436
779c7dcd4c04 (rmail-cease-edit): Call kill-all-local-variables.
Karl Heuer <kwzh@gnu.org>
parents: 16347
diff changeset
47 (setq rmail-edit-map (make-sparse-keymap))
779c7dcd4c04 (rmail-cease-edit): Call kill-all-local-variables.
Karl Heuer <kwzh@gnu.org>
parents: 16347
diff changeset
48 (set-keymap-parent rmail-edit-map text-mode-map)
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
49 (define-key rmail-edit-map "\C-c\C-c" 'rmail-cease-edit)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
50 (define-key rmail-edit-map "\C-c\C-]" 'rmail-abort-edit))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
51
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
52 ;; Rmail Edit mode is suitable only for specially formatted data.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
53 (put 'rmail-edit-mode 'mode-class 'special)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
54
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
55 (defun rmail-edit-mode ()
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
56 "Major mode for editing the contents of an RMAIL message.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
57 The editing commands are the same as in Text mode, together with two commands
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
58 to return to regular RMAIL:
37588
9adbbd869684 (rmail-edit-mode): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 26485
diff changeset
59 * \\[rmail-abort-edit] cancels the changes
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
60 you have made and returns to RMAIL
37588
9adbbd869684 (rmail-edit-mode): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 26485
diff changeset
61 * \\[rmail-cease-edit] makes them permanent.
9adbbd869684 (rmail-edit-mode): Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 26485
diff changeset
62 This functions runs the normal hook `rmail-edit-mode-hook'.
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
63 \\{rmail-edit-map}"
88155
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents: 88142
diff changeset
64 (delay-mode-hooks (text-mode))
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
65 (use-local-map rmail-edit-map)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
66 (setq major-mode 'rmail-edit-mode)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
67 (setq mode-name "RMAIL Edit")
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
68 (if (boundp 'mode-line-modified)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
69 (setq mode-line-modified (default-value 'mode-line-modified))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
70 (setq mode-line-format (default-value 'mode-line-format)))
6723
6ff74185a672 (rmail-edit-mode, rmail-cease-edit): Disable summary during edit.
Karl Heuer <kwzh@gnu.org>
parents: 5851
diff changeset
71 (if (rmail-summary-exists)
6726
d6bc6057d197 Fix previous change.
Karl Heuer <kwzh@gnu.org>
parents: 6723
diff changeset
72 (save-excursion
d6bc6057d197 Fix previous change.
Karl Heuer <kwzh@gnu.org>
parents: 6723
diff changeset
73 (set-buffer rmail-summary-buffer)
d6bc6057d197 Fix previous change.
Karl Heuer <kwzh@gnu.org>
parents: 6723
diff changeset
74 (rmail-summary-disable)))
88155
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents: 88142
diff changeset
75 (run-mode-hooks 'rmail-edit-mode-hook))
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
76
22264
225596bc6090 (rmail-old-pruned): New permanent local.
Richard M. Stallman <rms@gnu.org>
parents: 21877
diff changeset
77 (defvar rmail-old-pruned nil)
225596bc6090 (rmail-old-pruned): New permanent local.
Richard M. Stallman <rms@gnu.org>
parents: 21877
diff changeset
78 (put 'rmail-old-pruned 'permanent-local t)
225596bc6090 (rmail-old-pruned): New permanent local.
Richard M. Stallman <rms@gnu.org>
parents: 21877
diff changeset
79
22752
00d24401ca1e (rmail-edit-current-message, rmail-cease-edit):
Richard M. Stallman <rms@gnu.org>
parents: 22264
diff changeset
80 (defvar rmail-edit-saved-coding-system nil)
00d24401ca1e (rmail-edit-current-message, rmail-cease-edit):
Richard M. Stallman <rms@gnu.org>
parents: 22264
diff changeset
81 (put 'rmail-edit-saved-coding-system 'permanent-local t)
00d24401ca1e (rmail-edit-current-message, rmail-cease-edit):
Richard M. Stallman <rms@gnu.org>
parents: 22264
diff changeset
82
16347
d710d3502336 (rmail-edit-current-message): Add autoload.
Richard M. Stallman <rms@gnu.org>
parents: 14326
diff changeset
83 ;;;###autoload
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
84 (defun rmail-edit-current-message ()
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
85 "Edit the contents of this message."
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
86 (interactive)
88142
d0cc7165afcf (rmail-edit-current-message): Immediate error if file is empty.
Richard M. Stallman <rms@gnu.org>
parents: 88126
diff changeset
87 (if (= rmail-total-messages 0)
d0cc7165afcf (rmail-edit-current-message): Immediate error if file is empty.
Richard M. Stallman <rms@gnu.org>
parents: 88126
diff changeset
88 (error "No messages in this file"))
22264
225596bc6090 (rmail-old-pruned): New permanent local.
Richard M. Stallman <rms@gnu.org>
parents: 21877
diff changeset
89 (make-local-variable 'rmail-old-pruned)
225596bc6090 (rmail-old-pruned): New permanent local.
Richard M. Stallman <rms@gnu.org>
parents: 21877
diff changeset
90 (setq rmail-old-pruned (rmail-msg-is-pruned))
22752
00d24401ca1e (rmail-edit-current-message, rmail-cease-edit):
Richard M. Stallman <rms@gnu.org>
parents: 22264
diff changeset
91 (make-local-variable 'rmail-edit-saved-coding-system)
00d24401ca1e (rmail-edit-current-message, rmail-cease-edit):
Richard M. Stallman <rms@gnu.org>
parents: 22264
diff changeset
92 (setq rmail-edit-saved-coding-system save-buffer-coding-system)
22264
225596bc6090 (rmail-old-pruned): New permanent local.
Richard M. Stallman <rms@gnu.org>
parents: 21877
diff changeset
93 (rmail-toggle-header 0)
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
94 (rmail-edit-mode)
22752
00d24401ca1e (rmail-edit-current-message, rmail-cease-edit):
Richard M. Stallman <rms@gnu.org>
parents: 22264
diff changeset
95 ;; As the local value of save-buffer-coding-system is deleted by
00d24401ca1e (rmail-edit-current-message, rmail-cease-edit):
Richard M. Stallman <rms@gnu.org>
parents: 22264
diff changeset
96 ;; rmail-edit-mode, we restore the original value.
00d24401ca1e (rmail-edit-current-message, rmail-cease-edit):
Richard M. Stallman <rms@gnu.org>
parents: 22264
diff changeset
97 (make-local-variable 'save-buffer-coding-system)
00d24401ca1e (rmail-edit-current-message, rmail-cease-edit):
Richard M. Stallman <rms@gnu.org>
parents: 22264
diff changeset
98 (setq save-buffer-coding-system rmail-edit-saved-coding-system)
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
99 (make-local-variable 'rmail-old-text)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
100 (setq rmail-old-text (buffer-substring (point-min) (point-max)))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
101 (setq buffer-read-only nil)
11573
4ad650d4a65b (rmail-edit-current-message): Use force-mode-line-update.
Karl Heuer <kwzh@gnu.org>
parents: 8498
diff changeset
102 (force-mode-line-update)
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
103 (if (and (eq (key-binding "\C-c\C-c") 'rmail-cease-edit)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
104 (eq (key-binding "\C-c\C-]") 'rmail-abort-edit))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
105 (message "Editing: Type C-c C-c to return to Rmail, C-c C-] to abort")
14326
e5799768c51b (rmail-edit-current-message): Pass proper format string to message.
Karl Heuer <kwzh@gnu.org>
parents: 14169
diff changeset
106 (message "%s" (substitute-command-keys
22264
225596bc6090 (rmail-old-pruned): New permanent local.
Richard M. Stallman <rms@gnu.org>
parents: 21877
diff changeset
107 "Editing: Type \\[rmail-cease-edit] to return to Rmail, \\[rmail-abort-edit] to abort"))))
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
108
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
109 (defun rmail-cease-edit ()
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
110 "Finish editing message; switch back to Rmail proper."
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
111 (interactive)
6723
6ff74185a672 (rmail-edit-mode, rmail-cease-edit): Disable summary during edit.
Karl Heuer <kwzh@gnu.org>
parents: 5851
diff changeset
112 (if (rmail-summary-exists)
6726
d6bc6057d197 Fix previous change.
Karl Heuer <kwzh@gnu.org>
parents: 6723
diff changeset
113 (save-excursion
d6bc6057d197 Fix previous change.
Karl Heuer <kwzh@gnu.org>
parents: 6723
diff changeset
114 (set-buffer rmail-summary-buffer)
d6bc6057d197 Fix previous change.
Karl Heuer <kwzh@gnu.org>
parents: 6723
diff changeset
115 (rmail-summary-enable)))
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
116 ;; Make sure buffer ends with a newline.
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
117 (save-excursion
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
118 (goto-char (point-max))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
119 (if (/= (preceding-char) ?\n)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
120 (insert "\n"))
88214
259a58cdd236 (rmail-cease-edit): Bugfix.
Alex Schroeder <alex@gnu.org>
parents: 88184
diff changeset
121 ;; Adjust the marker that points to the end of this message, unless
88184
c727bbb95be3 (rmail-cease-edit): Do not adjust the marker of the
Alex Schroeder <alex@gnu.org>
parents: 88155
diff changeset
122 ;; we're at the last message.
c727bbb95be3 (rmail-cease-edit): Do not adjust the marker of the
Alex Schroeder <alex@gnu.org>
parents: 88155
diff changeset
123 (when (< rmail-current-message (length rmail-desc-vector))
88214
259a58cdd236 (rmail-cease-edit): Bugfix.
Alex Schroeder <alex@gnu.org>
parents: 88184
diff changeset
124 (rmail-desc-set-start (1+ rmail-current-message) (point))))
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
125 (let ((old rmail-old-text))
11573
4ad650d4a65b (rmail-edit-current-message): Use force-mode-line-update.
Karl Heuer <kwzh@gnu.org>
parents: 8498
diff changeset
126 (force-mode-line-update)
21436
779c7dcd4c04 (rmail-cease-edit): Call kill-all-local-variables.
Karl Heuer <kwzh@gnu.org>
parents: 16347
diff changeset
127 (kill-all-local-variables)
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
128 (rmail-mode-1)
21436
779c7dcd4c04 (rmail-cease-edit): Call kill-all-local-variables.
Karl Heuer <kwzh@gnu.org>
parents: 16347
diff changeset
129 (rmail-variables)
22752
00d24401ca1e (rmail-edit-current-message, rmail-cease-edit):
Richard M. Stallman <rms@gnu.org>
parents: 22264
diff changeset
130 ;; As the local value of save-buffer-coding-system is changed by
00d24401ca1e (rmail-edit-current-message, rmail-cease-edit):
Richard M. Stallman <rms@gnu.org>
parents: 22264
diff changeset
131 ;; rmail-variables, we restore the original value.
00d24401ca1e (rmail-edit-current-message, rmail-cease-edit):
Richard M. Stallman <rms@gnu.org>
parents: 22264
diff changeset
132 (setq save-buffer-coding-system rmail-edit-saved-coding-system)
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
133 (if (and (= (length old) (- (point-max) (point-min)))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
134 (string= old (buffer-substring (point-min) (point-max))))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
135 ()
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
136 (setq old nil)
88126
eefd09a79efd Attempt to eliminate some byte compiler warnings.
Paul Reilly <pmr@pajato.com>
parents: 48341
diff changeset
137 (rmail-set-attribute "edited" t))
21877
ed912554aac6 (rmail-cease-edit): Call rmail-show-message even if message text is unchanged.
Richard M. Stallman <rms@gnu.org>
parents: 21436
diff changeset
138 (save-excursion
22264
225596bc6090 (rmail-old-pruned): New permanent local.
Richard M. Stallman <rms@gnu.org>
parents: 21877
diff changeset
139 (rmail-show-message)
225596bc6090 (rmail-old-pruned): New permanent local.
Richard M. Stallman <rms@gnu.org>
parents: 21877
diff changeset
140 (rmail-toggle-header (if rmail-old-pruned 1 0))))
26485
d1f081e4844a (rmail-cease-edit): Run rmail-mode-hook.
Gerd Moellmann <gerd@gnu.org>
parents: 22752
diff changeset
141 (run-hooks 'rmail-mode-hook)
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
142 (setq buffer-read-only t))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
143
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
144 (defun rmail-abort-edit ()
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
145 "Abort edit of current message; restore original contents."
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
146 (interactive)
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
147 (delete-region (point-min) (point-max))
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
148 (insert rmail-old-text)
8498
ba1acb3cf835 (rmail-abort-edit): Call `rmail-highlight-headers'.
Richard M. Stallman <rms@gnu.org>
parents: 7562
diff changeset
149 (rmail-cease-edit)
ba1acb3cf835 (rmail-abort-edit): Call `rmail-highlight-headers'.
Richard M. Stallman <rms@gnu.org>
parents: 7562
diff changeset
150 (rmail-highlight-headers))
36
9697c13298e5 Initial revision
Joseph Arceneaux <jla@gnu.org>
parents:
diff changeset
151
88155
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents: 88142
diff changeset
152 (provide 'rmailedit)
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents: 88142
diff changeset
153
d7ddb3e565de sync with trunk
Henrik Enberg <henrik.enberg@telia.com>
parents: 88142
diff changeset
154 ;;; arch-tag: 93c22709-a14a-46c1-ab91-52c3f5a0ec12
658
7cbd4fcd8b0f *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 368
diff changeset
155 ;;; rmailedit.el ends here