+2001-12-07 Katsumi Yamaoka <yamaoka@jpl.org>
+
+ * lisp/message.el (message-mimic-kill-buffer): Bind
+ `message-kill-buffer-and-remove-file' to nil while calling the
+ function `message-kill-buffer'.
+
+ * texi/message-ja.texi, texi/message-ja.texi: Update.
+
+ * lisp/lpath.el: Fbind `replace-regexp-in-string' for XEmacs and
+ Mule; don't fbind coding-system-list for Mule.
+
+2001-12-03 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
+ (cf. news://news.gnus.org/gnus.gnus-bug #48523)
+
+ * lisp/message.el (message-kill-buffer-and-remove-file): New user
+ option.
+ (message-kill-buffer): Don't remove the backup file if
+ `message-kill-buffer-and-remove-file' is nil.
+
2001-12-07 TSUCHIYA Masatoshi <tsuchiya@namazu.org>
* lisp/gnus-namazu.el (gnus-namazu-case-sensitive-filesystem): New
(let ((functions-variables
(cond
((featurep 'xemacs)
- nil)
+ '((replace-regexp-in-string)))
((>= emacs-major-version 21)
'((function-max-args smiley-encode-buffer)))
((boundp 'MULE)
'((coding-system-get
- coding-system-list compose-mail file-name-extension
+ compose-mail file-name-extension
find-coding-systems-for-charsets find-coding-systems-region
- function-max-args get-charset-property shell-command-to-string
- smiley-encode-buffer)))
+ function-max-args get-charset-property replace-regexp-in-string
+ shell-command-to-string smiley-encode-buffer)))
(t
'((function-max-args smiley-encode-buffer))))))
(maybe-fbind (car functions-variables))
:type 'boolean)
(defcustom message-kill-buffer-query-function 'yes-or-no-p
- "*A function called to query the user whether to kill buffer anyway or not.
-If it is t, the buffer will be killed peremptorily."
+ "*Function used to prompt user whether to kill the message buffer. If
+it is t, the buffer will be killed unconditionally."
:type '(radio (function-item yes-or-no-p)
(function-item y-or-n-p)
(function-item nnheader-Y-or-n-p)
(function :tag "Other" t))
:group 'message-buffers)
+(defcustom message-kill-buffer-and-remove-file t
+ "*Non-nil means that the associated file will be removed before
+removing the message buffer. However, it is treated as nil when the
+command `message-mimic-kill-buffer' is used."
+ :group 'message-buffers
+ :type 'boolean)
+
(eval-when-compile
(defvar gnus-local-organization))
(defcustom message-user-organization
(org-frame message-original-frame))
(setq buffer-file-name nil)
(kill-buffer (current-buffer))
- (when (and (or (and auto-save-file-name
+ (when (and message-kill-buffer-and-remove-file
+ (or (and auto-save-file-name
(file-exists-p auto-save-file-name))
(and file-name
(file-exists-p file-name)))
(message ""))
(defun message-mimic-kill-buffer ()
- "Kill the current buffer with query."
+ "Kill the current buffer with query. This is an imitation for
+`kill-buffer', but it will delete a message frame."
(interactive)
- (unless (eq 'message-mode major-mode)
- (error "%s must be invoked from a message buffer." this-command))
- (let ((command this-command)
- (bufname (read-buffer (format "Kill buffer: (default %s) "
- (buffer-name)))))
- (if (or (not bufname)
- (string-equal bufname "")
- (string-equal bufname (buffer-name)))
- (message-kill-buffer)
- (message "%s must be invoked only for the current buffer." command))))
+ (let ((bufname (read-buffer (format "Kill buffer: (default %s) "
+ (buffer-name))))
+ message-kill-buffer-and-remove-file)
+ (when (or (not bufname)
+ (string-equal bufname "")
+ (string-equal bufname (buffer-name)))
+ (message-kill-buffer))))
(defun message-delete-frame (frame org-frame)
"Delete frame for editing message."
@item C-c C-k
@kindex C-c C-k
@findex message-kill-buffer
-\e$B%a%C%;!<%8%P%C%U%!$r@Z$C$F=*N;$7$^$9\e(B (@code{message-kill-buffer})\e$B!#\e(B
+@vindex message-kill-buffer-and-remove-file
+\e$B%a%C%;!<%8%P%C%U%!$r@Z$C$F=*N;$7$^$9\e(B (@code{message-kill-buffer})\e$B!#$=$N\e(B
+\e$B%U%l!<%`$,%a%C%;!<%8@lMQ$K:n$i$l$?$b$N$@$C$?>l9g$O!"%U%l!<%`$r:o=|$7$^$9!#\e(B
+@code{message-kill-buffer-and-remove-file} \e$B$,Hs\e(B-@code{nil} \e$B$G!"$+$D%P%C\e(B
+\e$B%/%"%C%W%U%!%$%k$,$G$-$F$$$?$i!"%f!<%6$K3NG'$7$F$+$i$=$l$b:o=|$7$^$9!#\e(B
+
+@item C-x k
+@kindex C-x k
+@findex message-mimic-kill-buffer
+@vindex message-kill-buffer-and-remove-file
+@code{kill-buffer} \e$B$N%$%_%F!<%7%g%s$G\e(B
+\e$B$9\e(B (@code{message-mimic-kill-buffer})\e$B!#\e(B
+@code{message-kill-buffer-and-remove-file} \e$B$r0l;~E*$K\e(B @code{nil} \e$B$KB+G{\e(B
+\e$B$7$F\e(B @code{message-kill-buffer} \e$B$r8F$S$^$9!#\e(B
@end table
@node Mail Aliases
@end lisp
@item message-kill-buffer-on-exit
-@findex message-kill-buffer-on-exit
+@vindex message-kill-buffer-on-exit
@code{nil} \e$B$G$J$1$l$P!"=*N;;~$K$9$0$K%P%C%U%!$r:o=|$7$^$9!#\e(B
+
+@item message-kill-buffer-query-function
+@vindex message-kill-buffer-query-function
+@findex message-kill-buffer
+@findex message-mimic-kill-buffer
+\e$B%3%^%s\e(B
+\e$B%I\e(B @code{message-kill-buffer} \e$B$d\e(B @code{message-mimic-kill-buffer} \e$B$G!"%P%C\e(B
+\e$B%U%!$r:o=|$9$k$+$I$&$+$r%f!<%6$K?R$M$k$H$-$K;H$&4X?t$N;XDj$G$9!#%G%#%U%)\e(B
+\e$B%k%H$O\e(B @code{yes-or-no-p} \e$B$G$9$,!"\e(B
+@code{y-or-n-p} \e$B$d\e(B @code{nnheader-Y-or-n-p} \e$B$J$I$r;H$&$3$H$b$G$-$^$9!#\e(B
+@code{t} \e$B$K$9$k$HL5>r7o$K%P%C%U%!$r:o=|$7$^$9!#\e(B
+
+@item message-kill-buffer-and-remove-file
+@vindex message-kill-buffer-and-remove-file
+@findex message-kill-buffer
+@findex message-mimic-kill-buffer
+\e$BHs\e(B-@code{nil} \e$B$@$C$?$i!"%P%C%U%!$r:o=|$7$?8e$G$b$7%P%C%/%"%C%W%U%!%$%k$,\e(B
+\e$B$"$C$?$i!"%f!<%6$K3NG'$7$F$+$i$=$l$b:o=|$7$^$9!#\e(B@code{nil} \e$B$G$O%U%!%$%k\e(B
+\e$B$r:o=|$7$^$;$s!#%G%#%U%)%k%H$O\e(B @code{t} \e$B$G$9!#$?$@$7!"%3%^%s\e(B
+\e$B%I\e(B @code{message-mimic-kill-buffer} \e$B$O$3$l$,\e(B @code{nil} \e$B$G$"$k$b$N$H$7$F\e(B
+\e$BF0:n$7$^$9!#\e(B
@end table
@node Message Actions
@item C-c C-k
@kindex C-c C-k
@findex message-kill-buffer
-Kill the message buffer and exit (@code{message-kill-buffer}).
+Kill the message buffer and exit (@code{message-kill-buffer}). It will
+delete the message frame if it has been created exclusively for the
+message buffer. If the option
+@code{message-kill-buffer-and-remove-file} is non-@code{nil} and the
+backup file has been created for the message buffer, it will also remove
+the file after prompting to the user.
+
+@item C-x k
+@kindex C-x k
+@findex message-mimic-kill-buffer
+@vindex message-kill-buffer-and-remove-file
+This is an imitation for @code{kill-buffer}
+(@code{message-mimic-kill-buffer}). It dynamically binds the variable
+@code{message-kill-buffer-and-remove-file} to @code{nil} and calls the
+function @code{message-kill-buffer}.
@end table
@end lisp
@item message-kill-buffer-on-exit
-@findex message-kill-buffer-on-exit
+@vindex message-kill-buffer-on-exit
If non-@code{nil}, kill the buffer immediately on exit.
+@item message-kill-buffer-query-function
+@vindex message-kill-buffer-query-function
+@findex message-kill-buffer
+@findex message-mimic-kill-buffer
+Function used to prompt user whether to kill the message buffer when the
+command @code{message-kill-buffer} or @code{message-mimic-kill-buffer}
+is used. It defaults to @code{yes-or-no-p}. You may alter the value to
+@code{y-or-n-p}, @code{nnheader-Y-or-n-p}, etc. If it is @code{t}, the
+buffer will be killed without query.
+
+@item message-kill-buffer-and-remove-file
+@vindex message-kill-buffer-and-remove-file
+@findex message-kill-buffer
+@findex message-mimic-kill-buffer
+If it is non-@code{nil}, remove the backup file if it exists with a
+query to the user, after the message buffer is killed. Otherwise the
+file won't be removed. It defaults to @code{t}. However, it is treated
+as @code{nil} when the command `message-mimic-kill-buffer' is used.
+
@end table