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

Re: [BUGFIX] w3m-session-delete [PATCH]



In [emacs-w3m:12850]
On Thu, 14 Dec 2017 16:49:44 +0900, Katsumi Yamaoka wrote:
> * w3m-session.el (w3m-session-save): Update selection buffer.
> (w3m-session-select-rename, w3m-session-select-delete):
> Make the selected session highlighted after renaming or deletion.
> (w3m-session-select): Allow specifying the session number.

> --- w3m-session.el~	2017-12-07 06:36:37.848393500 +0000
> +++ w3m-session.el	2017-12-14 07:48:09.584233100 +0000
[...]
--8<---------------cut here---------------start------------->8---
@@ -680,7 +680,8 @@
        (error nil))
      (switch-to-buffer showbuf)
      (setq w3m-session-select-wincfg wincfg)
-     (w3m-session-select-mode sessions))))
+     (w3m-session-select-mode sessions)
+     (when n (w3m-session-select-next n)))))
 
 (defun w3m-session-goto-session (session)
   "Goto URLs."
--8<---------------cut here---------------end--------------->8---

Sorry, the above part in the bottom of the patch will cause
an error if all sessions are deleted.  Replace it with this:

--8<---------------cut here---------------start------------->8---
@@ -680,7 +680,10 @@
        (error nil))
      (switch-to-buffer showbuf)
      (setq w3m-session-select-wincfg wincfg)
-     (w3m-session-select-mode sessions))))
+     (w3m-session-select-mode sessions)
+     (if sessions
+	 (when n (w3m-session-select-next n))
+       (delete-window)))))
 
 (defun w3m-session-goto-session (session)
   "Goto URLs."
--8<---------------cut here---------------end--------------->8---