* wl-summary.el (wl-summary-goto-folder-subr): Fix logic: set
authoryoichi <yoichi>
Fri, 10 Jan 2003 16:57:43 +0000 (16:57 +0000)
committeryoichi <yoichi>
Fri, 10 Jan 2003 16:57:43 +0000 (16:57 +0000)
entity-id when folder is given.
* wl-folder.el (wl-folder-set-current-entity-id): Don't use
save-excursion, use save-selected-window instead.
Select folder buffer window if exists.
(To correct behavior with wl-folder-move-cur-folder.)

wl/ChangeLog
wl/wl-folder.el
wl/wl-summary.el

index 654d178..d4886fc 100644 (file)
@@ -1,3 +1,12 @@
+2003-01-11  Yoichi NAKAYAMA  <yoichi@eken.phys.nagoya-u.ac.jp>
+
+       * wl-summary.el (wl-summary-goto-folder-subr): Fix logic: set
+       entity-id when folder is given.
+       * wl-folder.el (wl-folder-set-current-entity-id): Don't use
+       save-excursion, use save-selected-window instead.
+       Select folder buffer window if exists.
+       (To correct behavior with wl-folder-move-cur-folder.)
+
 2003-01-10  Masahiro Murata  <muse@ba2.so-net.ne.jp>
 
        * wl-draft.el (wl-draft-reedit): Avoid error on Meadow [wl:11209].
index fbf43fb..a037104 100644 (file)
@@ -954,10 +954,13 @@ Optional argument ARG is repeart count."
         (goto-char wl-folder-buffer-cur-point))))
 
 (defun wl-folder-set-current-entity-id (entity-id)
-  (let ((buf (get-buffer wl-folder-buffer-name)))
+  (let* ((buf (get-buffer wl-folder-buffer-name))
+        (buf-win (get-buffer-window buf)))
     (if buf
-       (save-excursion
-         (set-buffer buf)
+       (save-selected-window
+         (if buf-win
+             (select-window buf-win)
+           (set-buffer buf))
          (setq wl-folder-buffer-cur-entity-id entity-id)
          (setq wl-folder-buffer-cur-path (wl-folder-get-path wl-folder-entity
                                                              entity-id))
index ba42408..54f1285 100644 (file)
@@ -2574,15 +2574,15 @@ If ARG, without confirm."
          (if (and interactive wl-summary-recenter)
              (recenter (/ (- (window-height) 2) 2))))))
     ;; set current entity-id
-    (if (and (not folder)
-            (setq entity
-                  (wl-folder-search-entity-by-name (elmo-folder-name-internal
-                                                    folder)
-                                                   wl-folder-entity
-                                                   'folder)))
-       ;; entity-id is unknown.
-       (wl-folder-set-current-entity-id
-        (wl-folder-get-entity-id entity)))
+    (when (and folder
+              (setq entity
+                    (wl-folder-search-entity-by-name
+                     (elmo-folder-name-internal folder)
+                     wl-folder-entity
+                     'folder)))
+      ;; entity-id is unknown.
+      (wl-folder-set-current-entity-id
+       (wl-folder-get-entity-id entity)))
     (when (and wl-summary-lazy-highlight
               wl-on-xemacs)
       (sit-for 0))