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

[BUGFIX] Losing current url info (Kevin Ryde's bug report?) [PATCH]



Back on May 18, Kevin Ryde wrote:

> Boruch Baum <boruch_baum@xxxxxxx> writes:
> >
> > How could I reproduce your bug?  When I open a buffer to google.com and
> > press =
>
> Yes, just that.  Emacs 25.2 -Q, cvs emacs-w3m and say
> (w3m-browse-url "http://www.google.com.au/search?q=emacs-w3m";)
> point on a link, and in "=" expect current page url and also
> "Current Anchor:" with url of the link destination.  It does it for me
> on either a remote or local page.  If point on an image then expect
> "Image:" url too.

I think that finally I was able to reproduce either that bug or
something very similar. For me, happened only when I was on the final /
newest emacs-w3m buffer of all emacs-w3m buffers and delete that buffer
using C-c C-w (w3m-delete-buffer).

-- 
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0
Index: ChangeLog
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/ChangeLog,v
retrieving revision 1.3670
diff -b -u -p -r1.3670 ChangeLog
--- ChangeLog	18 May 2018 07:59:06 -0000	1.3670
+++ ChangeLog	24 May 2018 03:35:29 -0000
@@ -1,1 +1,6 @@
+2018-05-23  Boruch Baum  <boruch_baum@xxxxxxx>
+
+	* w3m.el (w3m-delete-buffer): Perform some operations from a temporary
+	buffer in order not to lose information such as `w3m-current-url'.
+
 2018-05-18  Katsumi Yamaoka  <yamaoka@xxxxxxx>

 	* w3m-proc.el (w3m-process-stop): Don't move point ([emacs-w3m:12976]).
Index: w3m.el
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/w3m.el,v
retrieving revision 1.1711
diff -b -u -p -r1.1711 w3m.el
--- w3m.el	17 May 2018 04:21:01 -0000	1.1711
+++ w3m.el	24 May 2018 03:35:49 -0000
@@ -8185,6 +8189,7 @@ launched this buffer."
 		   (w3m-next-buffer -1)
 		 (unless (one-window-p t)
 		   (delete-window))))))
+      (with-temp-buffer
       (w3m-session-deleted-save (list cur))
       (w3m-process-stop cur)
       (w3m-idle-images-show-unqueue cur)
@@ -8192,7 +8197,7 @@ launched this buffer."
 	(w3m-form-kill-buffer cur))
       (let ((frame-auto-delete nil)
 	    (ignore-window-parameters t))
-	(kill-buffer cur))
+              (kill-buffer cur)))
       ;; A workaround to restore the window positions correctly when
       ;; this command is called by a mouse event.
       (run-at-time 0.1 nil #'w3m-history-restore-position)