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

Re: w3m-view-this-url-new-session



>>>>> In [emacs-w3m : No.05358] 山岡 wrote:

> 2002-11-12  Katsumi Yamaoka  <yamaoka@jpl.org>

> 	* w3.el (w3m-view-this-url-1): Copy `w3m-current-url' into a
> 	copied buffer.

これの意味は、さらに調べます。:)

> うーん、普通 new-session では違うページに行くので、元のページの
> 内容をコピーするのは無駄、でも #name がある場合は例外処理として
> 中身を空にしない方が合理的かもしれません。

これはたぶん以下のパッチで良いでしょう。

--- w3m.el~	2003-07-03 08:35:24 +0000
+++ w3m.el	2003-07-04 03:58:41 +0000
@@ -4512,18 +4512,12 @@
   (lexical-let (pos)
     (when new-session
       (setq pos (point-marker))
-      (let ((referer w3m-current-url))
+      (let ((referer w3m-current-url)
+	    (empty (not (and (string-match w3m-url-components-regexp url)
+			     (match-beginning 8)))))
 	(if w3m-view-this-url-new-session-in-background
-	    (set-buffer (w3m-copy-buffer nil nil nil 'empty))
-	  (switch-to-buffer (w3m-copy-buffer nil nil t 'empty)))
-	(setq w3m-current-url referer))
-      ;; When new URL has `name' portion, we have to goto the base url
-      ;; because generated buffer has no content at this moment.
-      (when (and (string-match w3m-url-components-regexp url)
-		 (match-beginning 8))
-	(save-window-excursion
-	  (w3m-goto-url (substring url 0 (match-beginning 8))
-			reload nil nil w3m-current-url))))
+	    (set-buffer (w3m-copy-buffer nil nil nil empty))
+	  (switch-to-buffer (w3m-copy-buffer nil nil t empty)))))
     (let (handler)
       (w3m-process-do
 	  (success