unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [dubois@doublefine.com: mouse-drag.el and automatic-hscrolling interact poorly]
@ 2002-10-11  4:42 Richard Stallman
  2002-11-05 20:46 ` John Heidemann
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Stallman @ 2002-10-11  4:42 UTC (permalink / raw)
  Cc: emacs-devel, gerd

Could you please take a look at this problem?

------- Start of forwarded message -------
Envelope-to: rms@gnu.org
Delivery-date: Wed, 09 Oct 2002 19:55:27 -0400
From: Paul Du Bois <dubois@doublefine.com>
To: bug-gnu-emacs@gnu.org
Subject: mouse-drag.el and automatic-hscrolling interact poorly
X-OriginalArrivalTime: 09 Oct 2002 23:57:04.0956 (UTC) FILETIME=[918C67C0:01C26FEF]
Sender: bug-gnu-emacs-admin@gnu.org
Date: 9 Oct 2002 16:57:04 -0700

This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

In GNU Emacs 21.2.1 (i386-msvc-nt5.1.2600)
 of 2002-03-19 on buffy
configured using `configure --with-msvc (12.00)'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENU
  locale-coding-system: iso-latin-1
  default-enable-multibyte-characters: nil

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

;; eg

(require 'mouse-drag)
(define-key global-map [M-down-mouse-1] 'mouse-drag-drag)
(setq automatic-hscrolling t)
;; switch to an interesting buffer
(setq truncate-lines t)

;; 1. put point in the middle of a line
;; 2. do a leftward M-drag
;; 3. Notice that as the cursor approaches the left edge of the
;; screen, the hscroll resets to 0

A quick fix is to modify the (let (...) ) in mouse-drag-safe-scroll to
temporarily unset automatic-hscrolling.  I don't know whether that's a real
fix or just a workaround -- I don't understand this comment in scroll-right:

   If `automatic-hscrolling' is non-nil, the argument ARG modifies
   a lower bound for automatic scrolling, i.e. automatic scrolling
   will not scroll a window to a column less than the value returned
   by this function.

p



_______________________________________________
Bug-gnu-emacs mailing list
Bug-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs
------- End of forwarded message -------

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [dubois@doublefine.com: mouse-drag.el and automatic-hscrolling interact poorly]
@ 2002-10-26 20:15 Richard Stallman
  2002-10-27  5:11 ` John Heidemann
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Stallman @ 2002-10-26 20:15 UTC (permalink / raw)
  Cc: emacs-devel, gerd

[I sent this message a few weeks ago but did not get a response.]

Could you please take a look at this problem?

------- Start of forwarded message -------
Envelope-to: rms@gnu.org
Delivery-date: Wed, 09 Oct 2002 19:55:27 -0400
From: Paul Du Bois <dubois@doublefine.com>
To: bug-gnu-emacs@gnu.org
Subject: mouse-drag.el and automatic-hscrolling interact poorly
X-OriginalArrivalTime: 09 Oct 2002 23:57:04.0956 (UTC) FILETIME=[918C67C0:01C26FEF]
Sender: bug-gnu-emacs-admin@gnu.org
Date: 9 Oct 2002 16:57:04 -0700

This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

In GNU Emacs 21.2.1 (i386-msvc-nt5.1.2600)
 of 2002-03-19 on buffy
configured using `configure --with-msvc (12.00)'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENU
  locale-coding-system: iso-latin-1
  default-enable-multibyte-characters: nil

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

;; eg

(require 'mouse-drag)
(define-key global-map [M-down-mouse-1] 'mouse-drag-drag)
(setq automatic-hscrolling t)
;; switch to an interesting buffer
(setq truncate-lines t)

;; 1. put point in the middle of a line
;; 2. do a leftward M-drag
;; 3. Notice that as the cursor approaches the left edge of the
;; screen, the hscroll resets to 0

A quick fix is to modify the (let (...) ) in mouse-drag-safe-scroll to
temporarily unset automatic-hscrolling.  I don't know whether that's a real
fix or just a workaround -- I don't understand this comment in scroll-right:

   If `automatic-hscrolling' is non-nil, the argument ARG modifies
   a lower bound for automatic scrolling, i.e. automatic scrolling
   will not scroll a window to a column less than the value returned
   by this function.

p



_______________________________________________
Bug-gnu-emacs mailing list
Bug-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs
------- End of forwarded message -------

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dubois@doublefine.com: mouse-drag.el and automatic-hscrolling interact poorly]
  2002-10-26 20:15 Richard Stallman
@ 2002-10-27  5:11 ` John Heidemann
  0 siblings, 0 replies; 5+ messages in thread
From: John Heidemann @ 2002-10-27  5:11 UTC (permalink / raw)
  Cc: emacs-devel, gerd

On Sat, 26 Oct 2002 16:15:29 EDT, Richard Stallman wrote: 
>[I sent this message a few weeks ago but did not get a response.]
>
>Could you please take a look at this problem?

Thanks for the resend.  I think I'm able to reproduce the problem.
I'll add it to my queue to look at.

   -John Heidemann


>
>------- Start of forwarded message -------
>Envelope-to: rms@gnu.org
>Delivery-date: Wed, 09 Oct 2002 19:55:27 -0400
>From: Paul Du Bois <dubois@doublefine.com>
>To: bug-gnu-emacs@gnu.org
>Subject: mouse-drag.el and automatic-hscrolling interact poorly
>X-OriginalArrivalTime: 09 Oct 2002 23:57:04.0956 (UTC) FILETIME=[918C67C0:01C26FEF]
>Sender: bug-gnu-emacs-admin@gnu.org
>Date: 9 Oct 2002 16:57:04 -0700
>
>This bug report will be sent to the Free Software Foundation,
>not to your local site managers!
>Please write in English, because the Emacs maintainers do not have
>translators to read other languages for them.
>
>Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
>and to the gnu.emacs.bug news group.
>
>In GNU Emacs 21.2.1 (i386-msvc-nt5.1.2600)
> of 2002-03-19 on buffy
>configured using `configure --with-msvc (12.00)'
>Important settings:
>  value of $LC_ALL: nil
>  value of $LC_COLLATE: nil
>  value of $LC_CTYPE: nil
>  value of $LC_MESSAGES: nil
>  value of $LC_MONETARY: nil
>  value of $LC_NUMERIC: nil
>  value of $LC_TIME: nil
>  value of $LANG: ENU
>  locale-coding-system: iso-latin-1
>  default-enable-multibyte-characters: nil
>
>Please describe exactly what actions triggered the bug
>and the precise symptoms of the bug:
>
>;; eg
>
>(require 'mouse-drag)
>(define-key global-map [M-down-mouse-1] 'mouse-drag-drag)
>(setq automatic-hscrolling t)
>;; switch to an interesting buffer
>(setq truncate-lines t)
>
>;; 1. put point in the middle of a line
>;; 2. do a leftward M-drag
>;; 3. Notice that as the cursor approaches the left edge of the
>;; screen, the hscroll resets to 0
>
>A quick fix is to modify the (let (...) ) in mouse-drag-safe-scroll to
>temporarily unset automatic-hscrolling.  I don't know whether that's a real
>fix or just a workaround -- I don't understand this comment in scroll-right:
>
>   If `automatic-hscrolling' is non-nil, the argument ARG modifies
>   a lower bound for automatic scrolling, i.e. automatic scrolling
>   will not scroll a window to a column less than the value returned
>   by this function.
>
>p
>
>
>
>_______________________________________________
>Bug-gnu-emacs mailing list
>Bug-gnu-emacs@gnu.org
>http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs
>------- End of forwarded message -------

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dubois@doublefine.com: mouse-drag.el and automatic-hscrolling interact poorly]
  2002-10-11  4:42 [dubois@doublefine.com: mouse-drag.el and automatic-hscrolling interact poorly] Richard Stallman
@ 2002-11-05 20:46 ` John Heidemann
  2002-11-08 12:07   ` Richard Stallman
  0 siblings, 1 reply; 5+ messages in thread
From: John Heidemann @ 2002-11-05 20:46 UTC (permalink / raw)
  Cc: emacs-devel, gerd

On Fri, 11 Oct 2002 00:42:14 EDT, Richard Stallman wrote: 
>Could you please take a look at this problem?

I looked at this bug and was able to reproduce it.  Unfortunately, the
fix suggested by Mr. Du Bois didn't work for me.  (I've attached the
patch below if you want to try it.)  It's the obvious (and sensible)
fix from a mouse-drag point of view---turn off automatic-hscrolling
temporarily.

A guess at the problem is that automatic-hscrolling includes some kind
of hook that runs after mouse-drag-safe-scroll does its work.

Can you forward this bug to the people who re-wrote
automatic-hscrolling?  I can't find the implementation of
automatic-hscroll (it seems to be in C since it doesn't show up by
grepping the lisp).

   -John Heidemann

----------------------------------------------------------------------
This change below does NOT fix the problem, but is included for reference.
--- mouse-drag.el-      2002-11-05 12:14:57.000000000 -0800
+++ mouse-drag.el       2002-11-05 12:28:39.000000000 -0800
@@ -108,7 +108,11 @@
 (defun mouse-drag-safe-scroll (row-delta &optional col-delta)
   "Scroll down ROW-DELTA lines and right COL-DELTA, ignoring buffer edge errors.
 Keep the cursor on the screen as needed."
-  (let ((scroll-preserve-screen-position nil))
+  (let ((old-scroll-preserve-screen-position scroll-preserve-screen-position)
+       (old-automatic-hscrolling automatic-hscrolling))
+    ;; save user settings that interfer with mouse-drag
+    (setq scroll-preserve-screen-position nil
+         automatic-hscrolling nil)
     (if (and row-delta
             (/= 0 row-delta))
        (condition-case nil ;; catch and ignore movement errors
@@ -128,7 +132,10 @@
           ((< (current-column) (window-hscroll))
            (move-to-column (window-hscroll))) ; make on left column
           ((> (- (current-column) (window-hscroll) (window-width) -2) 0)
-           (move-to-column (+ (window-width) (window-hscroll) -3))))))))
+           (move-to-column (+ (window-width) (window-hscroll) -3))))))
+    ;; put things back for the user
+    (setq scroll-preserve-screen-position old-scroll-preserve-screen-position
+         automatic-hscrolling old-automatic-hscrolling)))
 
 (defun mouse-drag-repeatedly-safe-scroll (row-delta &optional col-delta)
   "Scroll ROW-DELTA rows and COL-DELTA cols until an event happens."
----------------------------------------------------------------------

>
>------- Start of forwarded message -------
>Envelope-to: rms@gnu.org
>Delivery-date: Wed, 09 Oct 2002 19:55:27 -0400
>From: Paul Du Bois <dubois@doublefine.com>
>To: bug-gnu-emacs@gnu.org
>Subject: mouse-drag.el and automatic-hscrolling interact poorly
>X-OriginalArrivalTime: 09 Oct 2002 23:57:04.0956 (UTC) FILETIME=[918C67C0:01C26FEF]
>Sender: bug-gnu-emacs-admin@gnu.org
>Date: 9 Oct 2002 16:57:04 -0700
>
>This bug report will be sent to the Free Software Foundation,
>not to your local site managers!
>Please write in English, because the Emacs maintainers do not have
>translators to read other languages for them.
>
>Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
>and to the gnu.emacs.bug news group.
>
>In GNU Emacs 21.2.1 (i386-msvc-nt5.1.2600)
> of 2002-03-19 on buffy
>configured using `configure --with-msvc (12.00)'
>Important settings:
>  value of $LC_ALL: nil
>  value of $LC_COLLATE: nil
>  value of $LC_CTYPE: nil
>  value of $LC_MESSAGES: nil
>  value of $LC_MONETARY: nil
>  value of $LC_NUMERIC: nil
>  value of $LC_TIME: nil
>  value of $LANG: ENU
>  locale-coding-system: iso-latin-1
>  default-enable-multibyte-characters: nil
>
>Please describe exactly what actions triggered the bug
>and the precise symptoms of the bug:
>
>;; eg
>
>(require 'mouse-drag)
>(define-key global-map [M-down-mouse-1] 'mouse-drag-drag)
>(setq automatic-hscrolling t)
>;; switch to an interesting buffer
>(setq truncate-lines t)
>
>;; 1. put point in the middle of a line
>;; 2. do a leftward M-drag
>;; 3. Notice that as the cursor approaches the left edge of the
>;; screen, the hscroll resets to 0
>
>A quick fix is to modify the (let (...) ) in mouse-drag-safe-scroll to
>temporarily unset automatic-hscrolling.  I don't know whether that's a real
>fix or just a workaround -- I don't understand this comment in scroll-right:
>
>   If `automatic-hscrolling' is non-nil, the argument ARG modifies
>   a lower bound for automatic scrolling, i.e. automatic scrolling
>   will not scroll a window to a column less than the value returned
>   by this function.
>
>p
>
>
>
>_______________________________________________
>Bug-gnu-emacs mailing list
>Bug-gnu-emacs@gnu.org
>http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs
>------- End of forwarded message -------

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [dubois@doublefine.com: mouse-drag.el and automatic-hscrolling interact poorly]
  2002-11-05 20:46 ` John Heidemann
@ 2002-11-08 12:07   ` Richard Stallman
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Stallman @ 2002-11-08 12:07 UTC (permalink / raw)
  Cc: emacs-devel, gerd

    Can you forward this bug to the people who re-wrote
    automatic-hscrolling?

Gerd did that, and he said he would not work on it any more.
I fear we are on our own.

Auto-hscrolling is done within redisplay.  But if point is in the
legitimate region of the screen, auto-hscrolling should not do
anything.

What is the situation in the buffer that causes auto-hscrolling
to think it ought to do something?

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-11-08 12:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-11  4:42 [dubois@doublefine.com: mouse-drag.el and automatic-hscrolling interact poorly] Richard Stallman
2002-11-05 20:46 ` John Heidemann
2002-11-08 12:07   ` Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2002-10-26 20:15 Richard Stallman
2002-10-27  5:11 ` John Heidemann

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).