[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
w3m-next-buffer and w3m-fb-mode.
- From: Matt Hodges <M.P.Hodges@xxxxxxxx>
- Date: Thu, 05 Apr 2007 10:03:41 +0100
- X-ml-name: emacs-w3m
- X-mail-count: 09341
Hi,
The recent change to w3m-next-buffer assumes that the list of W3M
buffer numbers is 1, 2, 3, ...
With (w3m-fb-mode 1), this isn't necessarily true. For example, in
one frame I have:
(mapcar #'w3m-buffer-number (w3m-list-buffers)) => (3 11 12)
and w3m-next-buffer doesn't work as intended.
The attached patch fixes this. Could someone check it in, if it looks
OK?
Thanks,
Matt
Index: w3m.el
===================================================================
RCS file: /storage/cvsroot/emacs-w3m/w3m.el,v
retrieving revision 1.1265
diff -u -r1.1265 w3m.el
--- w3m.el 4 Apr 2007 08:21:25 -0000 1.1265
+++ w3m.el 5 Apr 2007 08:53:00 -0000
@@ -6650,10 +6650,11 @@
(interactive "p")
(unless arg (setq arg 1))
(when (and (/= arg 0) (eq major-mode 'w3m-mode))
- (let ((buffers (w3m-list-buffers)))
+ (let* ((buffers (w3m-list-buffers))
+ (length (length buffers)))
(switch-to-buffer
- (nth (mod (+ arg (w3m-buffer-number (current-buffer)) -1)
- (length buffers))
+ (nth (mod (+ arg (- length (length (memq (current-buffer) buffers))))
+ length)
buffers)))
(run-hooks 'w3m-select-buffer-hook)
(w3m-select-buffer-update)))