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

[BUGFIX] w3m-session-delete [PATCH]



A few days ago, I pushed a patch ~[emacs-w3m:12832] to stop the cursor
from jumping after deleting a session in the session-select buffer (M-s,
by default). That patch had a bug in the case of deleting the final item
on the list. Patch attached.


-- 
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.3637
diff -b -u -p -r1.3637 ChangeLog
--- ChangeLog	13 Dec 2017 04:01:49 -0000	1.3637
+++ ChangeLog	13 Dec 2017 12:14:16 -0000
@@ -1,3 +1,8 @@
+2017-12-13  Boruch Baum  <boruch_baum@xxxxxxx>
+
+	* w3m-session.el (w3m-session-select-delete): bugfix for
+	([emacs-w3m:12832]) when deleting final entry in list.
+
 2017-12-12  Boruch Baum  <boruch_baum@xxxxxxx>
 
 	* w3m.el (w3m-lynx-like-map): Remap "s" to `w3m-search', "S" to
Index: w3m-session.el
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/w3m-session.el,v
retrieving revision 1.40
diff -b -u -p -r1.40 w3m-session.el
--- w3m-session.el	7 Dec 2017 06:36:51 -0000	1.40
+++ w3m-session.el	13 Dec 2017 12:14:17 -0000
@@ -647,7 +647,7 @@ Sorry, an error found in \"%s\"; may we 
       (w3m-session-select-quit)
       (w3m-session-delete sessions num)
       (w3m-session-select)
-      (forward-line num))))
+      (forward-line (min num (- (line-number-at-pos (point-max)) 4))))))
 
 ;;;###autoload
 (defun w3m-session-select ()