[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: W3M frame-local buffers (w3m-fb.el).



>>>>> Matt Hodges writes:

 > > Oops, I found your reply just now in the Gmane newsgroup (mails
 > > sent to me tends to stagnate for these days :-<).  Anyway, I seem
 > > to have fixed the problem.

 > I don't think this fully fixes it.  What if someone does (setq
 > w3m-fb-mode t) and hasn't set w3m-pop-up-frames?

 > Maybe something like the attached is needed, perhaps even a warning
 > for users?

Sorry, that totally broke things -- not allowing to start a new W3M
session on a frame that didn't have one already.

I propose a different check to disable the feature after a careless
(setq w3m-fb-mode t):
--- w3m-util.el	19 Dec 2005 14:05:49 +0000	1.98
+++ w3m-util.el	23 Dec 2005 11:11:17 +0000	
@@ -390,7 +390,8 @@
 		      (nreverse rest)
 		    (sort rest #'w3m-buffer-name-lessp)))
     (when (and w3m-fb-mode
-	       (if w3m-pop-up-frames
+	       (if (or w3m-pop-up-frames
+                       (not (memq 'w3m-fb-add w3m-mode-hook)))
 		   ;; `w3m-fb-mode' might have been set by something
 		   ;; other than the `w3m-fb-mode' function.
 		   (setq w3m-fb-mode nil)
@@ -399,14 +400,10 @@
       ;; because `buffers' may have been sorted.
       (let ((fbs (w3m-fb-frame-parameter w3m-fb-list-buffers-frame
 					 'w3m-fb-buffer-list)))
-	;; Maybe someone did (setq w3m-fb-mode t) in which case the
-	;; W3M buffers have not been associated with frames, and the
-	;; relevant hooks have not been set up.
-	(when fbs
-	  (setq rest buffers)
-	  (while rest
-	    (unless (memq (setq buffer (pop rest)) fbs)
-	      (setq buffers (delq buffer buffers)))))))
+        (setq rest buffers)
+        (while rest
+          (unless (memq (setq buffer (pop rest)) fbs)
+            (setq buffers (delq buffer buffers))))))
     buffers))