From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Problem with scroll-bar dragging and patch. Date: Mon, 21 Apr 2003 19:56:11 -0500 (CDT) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200304220056.h3M0uBn12117@eel.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1050973021 13301 80.91.224.249 (22 Apr 2003 00:57:01 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 22 Apr 2003 00:57:01 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Apr 22 02:56:59 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 197m5j-0003SO-00 for ; Tue, 22 Apr 2003 02:56:59 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 197mAk-0008Oi-00 for ; Tue, 22 Apr 2003 03:02:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 197m5H-0002ef-07 for emacs-devel@quimby.gnus.org; Mon, 21 Apr 2003 20:56:31 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 197m4z-0002ag-00 for emacs-devel@gnu.org; Mon, 21 Apr 2003 20:56:13 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 197m4x-0002aT-00 for emacs-devel@gnu.org; Mon, 21 Apr 2003 20:56:12 -0400 Original-Received: from manatee.dms.auburn.edu ([131.204.53.104]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 197m4x-0002Zu-00 for emacs-devel@gnu.org; Mon, 21 Apr 2003 20:56:11 -0400 Original-Received: from eel.dms.auburn.edu (eel.dms.auburn.edu [131.204.53.108]) by manatee.dms.auburn.edu (8.12.9/8.12.9) with ESMTP id h3M0uAoc026631 for ; Mon, 21 Apr 2003 19:56:10 -0500 (CDT) Original-Received: (from teirllm@localhost) by eel.dms.auburn.edu (8.11.6+Sun/8.11.6) id h3M0uBn12117; Mon, 21 Apr 2003 19:56:11 -0500 (CDT) X-Authentication-Warning: eel.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:13336 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:13336 This concerns the latest Emacs CVS configured with ./configure --without-toolkit-scroll-bars Actually, it might be interesting for people who are using various non-native scrollbars to see whether the problem occurs for them too. My patch applies to the native scrollbar. Do M-10000 a in a standard size Emacs frame. We can not scroll with Mouse-2 at all. Add a final newline. Now we can only scroll to two positions: the very top and an empty completely overscrolled screen. Note that this buffer is, of course, completely unnatural. However, such large newline-less output often gets produced by programs and one definitely can not always just M-q that output. I made changes in three functions. For two of them I do not even know whether they are actually still used anywhere, but the change in them is consistent with the similar change in scroll-bar-drag-1, the only one of the three that apparently matters. Because scroll-bar.el is pre-loaded, you may have to do C-M-x on scroll-bar-drag-1 to notice the difference. Change Log: 2003-04-21 Luc Teirlinck * scroll-bar.el (scroll-bar-set-window-start, scroll-bar-drag-position, scroll-bar-drag-1): Replace beginning-of-line with vertical-motion. Patch: ===File ~/scroll-bar-diff=================================== cd /usr/local/share/emacs/21.3.50/lisp/ diff -c /usr/local/share/emacs/21.3.50/lisp/scroll-bar.old.el /usr/local/share/emacs/21.3.50/lisp/scroll-bar.el *** /usr/local/share/emacs/21.3.50/lisp/scroll-bar.old.el Wed Apr 2 13:58:36 2003 --- /usr/local/share/emacs/21.3.50/lisp/scroll-bar.el Mon Apr 21 18:36:36 2003 *************** *** 170,176 **** (goto-char (+ (point-min) (scroll-bar-scale portion-whole (- (point-max) (point-min))))) ! (beginning-of-line) (set-window-start window (point)))))) (defun scroll-bar-drag-position (portion-whole) --- 170,176 ---- (goto-char (+ (point-min) (scroll-bar-scale portion-whole (- (point-max) (point-min))))) ! (vertical-motion 0) (set-window-start window (point)))))) (defun scroll-bar-drag-position (portion-whole) *************** *** 179,185 **** (goto-char (+ (point-min) (scroll-bar-scale portion-whole (- (point-max) (point-min))))) ! (beginning-of-line) (point))) (defun scroll-bar-maybe-set-window-start (event) --- 179,185 ---- (goto-char (+ (point-min) (scroll-bar-scale portion-whole (- (point-max) (point-min))))) ! (vertical-motion 0) (point))) (defun scroll-bar-maybe-set-window-start (event) *************** *** 218,224 **** (goto-char (+ (point-min) (scroll-bar-scale portion-whole (- (point-max) (point-min))))) ! (beginning-of-line) (set-window-start window (point))))) (defun scroll-bar-drag (event) --- 218,224 ---- (goto-char (+ (point-min) (scroll-bar-scale portion-whole (- (point-max) (point-min))))) ! (vertical-motion 0) (set-window-start window (point))))) (defun scroll-bar-drag (event) Diff finished at Mon Apr 21 18:47:32 ============================================================