* wl-summary.el (wl-summary-mimic-kill-buffer): New command.
authorhmurata <hmurata>
Sun, 7 Nov 2004 15:52:58 +0000 (15:52 +0000)
committerhmurata <hmurata>
Sun, 7 Nov 2004 15:52:58 +0000 (15:52 +0000)
(wl-summary-mode-map): Substitute `wl-summary-mimic-kill-buffer'
for `kill-buffer'.

wl/ChangeLog
wl/wl-summary.el

index bbe75d4..bf4ddeb 100644 (file)
@@ -1,5 +1,9 @@
 2004-11-07  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
+       * wl-summary.el (wl-summary-mimic-kill-buffer): New command.
+       (wl-summary-mode-map): Substitute `wl-summary-mimic-kill-buffer'
+       for `kill-buffer'.
+
        * wl-summary.el (wl-summary-switch-to-clone-buffer): Remove event
        handler of current buffer from elmo-folder.
 
index 3a5609c..56ab4b9 100644 (file)
@@ -398,6 +398,11 @@ See also variable `wl-use-petname'."
     ()
   (setq wl-summary-mode-map (make-keymap))
   (suppress-keymap wl-summary-mode-map)
+  (substitute-key-definition 'kill-buffer
+                            'wl-summary-mimic-kill-buffer
+                            wl-summary-mode-map
+                            global-map)
+  ;; basic commands
   (define-key wl-summary-mode-map " "    'wl-summary-read)
   (define-key wl-summary-mode-map "."    'wl-summary-redisplay)
   (define-key wl-summary-mode-map "<"    'wl-summary-display-top)
@@ -580,6 +585,15 @@ See also variable `wl-use-petname'."
    "Menu used in Summary mode."
    wl-summary-mode-menu-spec))
 
+(defun wl-summary-mimic-kill-buffer (buffer)
+  "Kill the current (Summary) buffer with query."
+  (interactive "bKill buffer: ")
+  (if (or (not buffer)
+         (string-equal buffer "")
+         (string-equal buffer (buffer-name)))
+      (wl-summary-exit 'force-exit)
+    (kill-buffer buffer)))
+
 (defsubst wl-summary-message-visible-p (number)
   "Return non-nil if the message with NUMBER is visible."
   (or (eq wl-summary-buffer-view 'sequence)