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

Re: w3m-popup-buffer



Naohiro Aota <naota@xxxxxxxxx> writes:

> minibuffer で入力などをしている時に、 `w3m-goto-url-with-timer' が呼び出
> されると、`w3m-goto-url' -> `w3m-popup-buffer' -> `switch-to-buffer'と呼
> び出しが続きます。
>
> 最近の Emacs では、 以下のように minibuffer 内で `switch-to-buffer' が使
> われると代わりに `pop-to-buffer' が使われてしまうようです。 このため
> この呼び出しの結果 window が分割されてしまいます。
>
> .-------------------------------------------------------------------------------
> | switch-to-buffer is an interactive built-in function in `buffer.c'.
> | 
> | <snip>
> | 
> | If the selected window is the minibuffer window or dedicated to
> | its buffer, use `pop-to-buffer' for displaying the buffer.
> | 
> | <snip>
> `-------------------------------------------------------------------------------
>
> おそらく、これ自体は `w3m-goto-url-with-timer' の中で
> window-configuration を保存しておいて戻してしまえば全く問題はないとは思い
> ますが、同様の問題が `w3m-popup-frame-p' が t の時の frame の popup にも
> あるような気がします。

とりあえずシンプルに no-popup という引数を w3m-goto-url に付け加えるだけ
でも解決しそうです。 (w3m-goto-url はちょっと引数が多いですが…) 追加して
しまってもかまいませんか? 

--
青田
Index: w3m.el
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/w3m.el,v
retrieving revision 1.1414
diff -u -r1.1414 w3m.el
--- w3m.el	27 Jan 2009 04:33:33 -0000	1.1414
+++ w3m.el	30 Jan 2009 15:37:50 -0000
@@ -8691,7 +8691,7 @@
 
 ;;;###autoload
 (defun w3m-goto-url (url &optional reload charset post-data referer handler
-			 element)
+			 element no-popup)
   "Visit World Wide Web pages.  This is the primitive function of `w3m'.
 If the second argument RELOAD is non-nil, reload a content of URL.
 Except that if it is 'redisplay, re-display the page without reloading.
@@ -8704,8 +8704,8 @@
 used as the body.
 If the fifth argument REFERER is specified, it is used for a Referer:
 field for this request.
-The remaining HANDLER and ELEMENT[1] are for the internal operations
-of emacs-w3m.
+The remaining HANDLER, ELEMENT[1], and NO-POPUP are for the
+internal operations of emacs-w3m.
 You can also use \"quicksearch\" url schemes such as \"gg:emacs\" which
 would search for the term \"emacs\" with the Google search engine.  See
 the `w3m-search' function and the variable `w3m-uri-replace-alist'.
@@ -8782,7 +8782,8 @@
    ((w3m-url-valid url)
     (w3m-buffer-setup)			; Setup buffer.
     (w3m-arrived-setup)			; Setup arrived database.
-    (w3m-popup-buffer (current-buffer))
+    (unless no-popup
+      (w3m-popup-buffer (current-buffer)))
     (w3m-cancel-refresh-timer (current-buffer))
     (when w3m-current-process
       (error "%s"
@@ -9025,7 +9026,8 @@
 	(with-current-buffer buffer
 	  (w3m-cancel-refresh-timer buffer)
 	  (w3m-goto-url url (and w3m-current-url
-				 (string= url w3m-current-url))))
+				 (string= url w3m-current-url))
+			nil nil nil nil nil t))
 	(set-window-buffer cwin cbuf)))
      (t
       (with-current-buffer buffer