GNU bug report logs - #998
after split-window-horizontally scroll works only on first window

Previous Next

Package: emacs;

Reported by: Davide Viti <zinosat <at> tiscali.it>

Date: Thu, 18 Sep 2008 13:55:03 UTC

Severity: normal

Tags: patch, wontfix

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #15 received at 998 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Davide Viti <zinosat <at> tiscali.it>
Cc: 998 <at> debbugs.gnu.org
Subject: Re: bug#998: after split-window-horizontally scroll works only on
 first	window
Date: Fri, 19 Sep 2008 09:01:21 +0200
> <vertical-scroll-bar> <mouse-1> (translated from <mouse-1>) at that spot runs the command scroll-bar-toolkit-scroll
>   which is an interactive compiled Lisp function in `scroll-bar.el'.

OK.  Could you now please append the following modified version of
`scroll-bar-toolkit-scroll' to your .emacs, restart Emacs, split the
window horizontally, move the mouse into each of these windows, scroll
the mouse and tell me whether the windows mentioned in the messages you
should see (here I get for example .... #<window 3 on .emacs>) have the
same or different values.

Thanks, martin.

;; code starts here
(defun scroll-bar-toolkit-scroll (event)
  (interactive "e")
  (let* ((end-position (event-end event))
	 (window (nth 0 end-position))
	 (part (nth 4 end-position))
	 before-scroll)
    (message ".... %s" window)
    (cond ((eq part 'end-scroll))
	  (t
	   (with-current-buffer (window-buffer window)
	     (setq before-scroll point-before-scroll))
	   (save-selected-window
	     (select-window window)
	     (setq before-scroll (or before-scroll (point)))
	     (cond ((eq part 'above-handle)
		    (scroll-up '-))
		   ((eq part 'below-handle)
		    (scroll-up nil))
		   ((eq part 'ratio)
		    (let* ((portion-whole (nth 2 end-position))
			   (lines (scroll-bar-scale portion-whole
						    (1- (window-height)))))
		      (scroll-up (cond ((not (zerop lines)) lines)
				       ((< (car portion-whole) 0) -1)
				       (t 1)))))
		   ((eq part 'up)
		    (scroll-up -1))
		   ((eq part 'down)
		    (scroll-up 1))
		   ((eq part 'top)
		    (set-window-start window (point-min)))
		   ((eq part 'bottom)
		    (goto-char (point-max))
		    (recenter))
		   ((eq part 'handle)
		    (scroll-bar-drag-1 event))))
	   (sit-for 0)
	   (with-current-buffer (window-buffer window)
	     (setq point-before-scroll before-scroll))))))
;; code ends here




This bug report was last modified 13 years and 297 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.