+2004-11-12 Hiroya Murata <lapis-lazuli@pop06.odn.ne.jp>
+
+ * wl-summary.el (wl-summary-buffer-detach): New function.
+ (wl-summary-buffer-set-folder): Call it.
+ (wl-summary-mode): Add `wl-summary-buffer-detach' to
+ change-major-mode-hook and kill-buffer-hook.
+ (wl-summary-exit): Does not call `elmo-folder-remove-handler'.
+ (wl-summary-switch-to-clone-buffer): Ditto.
+ (wl-summary-goto-folder-subr): Ditto.
+
2004-11-11 TAKAHASHI Kaoru <kaoru@kaisei.org>
* wl-summary.el (wl-summary-mode): Set `show-trailing-whitespace'
(wl-summary-jump-to-msg number))
(wl-summary-update-persistent-mark number))))))
+(defun wl-summary-buffer-detach ()
+ (when (and (eq major-mode 'wl-summary-mode)
+ wl-summary-buffer-elmo-folder
+ wl-summary-buffer-event-handler)
+ (elmo-folder-remove-handler wl-summary-buffer-elmo-folder
+ wl-summary-buffer-event-handler)))
+
(defun wl-status-update ()
(interactive)
(wl-address-init))
wl-summary-buffer-persistent-mark-column persistent)))
(defun wl-summary-buffer-set-folder (folder)
+ (wl-summary-buffer-detach)
(if (stringp folder)
(setq folder (wl-folder-get-elmo-folder folder)))
(setq wl-summary-buffer-elmo-folder folder)
(make-local-hook hook)
(dolist (function wl-summary-buffer-window-scroll-functions)
(add-hook hook function nil t))))
+ (make-local-hook 'change-major-mode-hook)
+ (add-hook 'change-major-mode-hook #'wl-summary-buffer-detach nil t)
+ (add-hook 'kill-buffer-hook #'wl-summary-buffer-detach)
;; This hook may contain the function `wl-setup-summary' for reasons
;; of system internal to accord facilities for the Emacs variants.
(run-hooks 'wl-summary-mode-hook))
(progn
(wl-summary-save-view)
(if (or force-exit (not sticky))
- (progn
- (elmo-folder-close wl-summary-buffer-elmo-folder)
- (elmo-folder-remove-handler wl-summary-buffer-elmo-folder
- wl-summary-buffer-event-handler))
+ (elmo-folder-close wl-summary-buffer-elmo-folder)
(elmo-folder-commit wl-summary-buffer-elmo-folder)
(elmo-folder-check wl-summary-buffer-elmo-folder))
(if wl-use-scoring (wl-score-save)))
(symbol-value (car copy-variables))))
(setq copy-variables (cdr copy-variables)))
(switch-to-buffer buf)
- (with-current-buffer cur-buf
- (elmo-folder-remove-handler wl-summary-buffer-elmo-folder
- wl-summary-buffer-event-handler))
(kill-buffer cur-buf)
(wl-summary-count-unread)
(wl-summary-update-modeline)
(if other-window
(delete-other-windows))
(set-buffer buf)
- (when wl-summary-buffer-event-handler
- (elmo-folder-remove-handler wl-summary-buffer-elmo-folder
- wl-summary-buffer-event-handler))
(unless (eq major-mode 'wl-summary-mode)
(wl-summary-mode))
(wl-summary-buffer-set-folder folder)