GNU bug report logs - #4023
mwheel.el uses (point) instead of point-before-scroll

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: balducci@HIDDEN; dated Mon, 3 Aug 2009 16:10:08 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefan@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 4023@HIDDEN:


Received: (at 4023) by emacsbugs.donarmstrong.com; 9 Dec 2009 11:15:06 +0000
From balducci@HIDDEN Wed Dec  9 03:15:06 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=0.7 required=4.0 tests=AWL autolearn=ham
	version=3.2.5-bugs.debian.org_2005_01_02
Received: from dschgrazlin2.units.it (dschgrazlin2.univ.trieste.it [140.105.55.81])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB9BF2PL029179
	for <4023@HIDDEN>; Wed, 9 Dec 2009 03:15:05 -0800
Received: from localhost (loopback [127.0.0.1])
	by dschgrazlin2.units.it (8.14.3/8.14.3) with ESMTP id nB9BgOYI026586;
	Wed, 9 Dec 2009 12:42:24 +0100
Received: from dschgrazlin2.units.it ([127.0.0.1])
	by localhost (dschgrazlin2.units.it [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id sewY9ksqIP4x; Wed,  9 Dec 2009 12:42:24 +0100 (CET)
Received: from dschgrazlin2.units.it (loopback [127.0.0.1])
	by dschgrazlin2.units.it (8.14.3/8.14.3) with ESMTP id nB9BgKrY026574;
	Wed, 9 Dec 2009 12:42:20 +0100
To: rgm@HIDDEN, cyd@HIDDEN, 4023 <at> debbugs.gnu.org
Subject: Re: mwheel.el uses (point) instead of point-before-scroll
In-reply-to: Your message of "Sat, 05 Dec 2009 16:06:32 EST."
             <q9ocmdceqv.fsf@HIDDEN>
X-Mailer: MH-E 8.2; nmh 1.3; GNU Emacs 23.1.1
Date: Wed, 09 Dec 2009 12:42:20 +0100
Message-ID: <26573.1260358964@HIDDEN>
From: gabriele balducci <balducci@HIDDEN>


Hi there

> > I have no preference for either behavior, because I don't use the mouse
> > wheel much.  Either way, we should probably make the scrollbar and mouse
> > wheel behavior consistent, though.

I do not use the wheel very much too, but the occasions on which I use
it are just when I want to mark a wide region  by scrolling!

Actually, I did not realize that someone might want to:

=> mark a (small) region
=> scroll down with the wheel
=> paste the region contents previously selected

and, of course, this is just the opposite of what I normally do!

> 
> Emacs 22.3 seems to make both me and the OP happy.
> 
> When transient-mark-mode is off, it does not have the issue I
> complained about. When transient-mark-mode is on, it behaves the way
> the OP wants. (So by default 22.3 does NOT behave the way the OP asks
> for, AFAICS.)

Actually, I used to raise transient-mark-mode on at emacs startup

> 
> I complained when the behaviour I disliked (and I do find it really
> annoying) started happening even when t-m-m was off.
> 
> So is there a way to make us both happy, by getting the 22.3 behaviour
> back? I don't care at all what the defaults are, so long as I can get
> the behaviour I like somehow.

Me too.

I am not a lisp/emacs developer, so do not know whether this might be a
good/feasible option: what about a t/nil configurable variable such as
wheel-scroll-extends-region?

thanks and ciao
gabriele



Acknowledgement sent to gabriele balducci <balducci@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4023; Package emacs. Full text available.

Message received at 4023@HIDDEN:


Received: (at 4023) by emacsbugs.donarmstrong.com; 5 Dec 2009 21:06:35 +0000
From rgm@HIDDEN Sat Dec  5 13:06:35 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-5.6 required=4.0 tests=AWL,X_DEBBUGS_NO_ACK
	autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB5L6YEP032000
	for <4023@HIDDEN>; Sat, 5 Dec 2009 13:06:35 -0800
Received: from rgm by fencepost.gnu.org with local (Exim 4.67)
	(envelope-from <rgm@HIDDEN>)
	id 1NH1po-00006Y-W7; Sat, 05 Dec 2009 16:06:33 -0500
From: Glenn Morris <rgm@HIDDEN>
To: Chong Yidong <cyd@HIDDEN>
Cc: gabriele balducci <balducci@HIDDEN>,
        4023 <at> debbugs.gnu.org
Subject: Re: mwheel.el uses (point) instead of point-before-scroll
References: <87iqcm5e9f.fsf@HIDDEN>
X-Spook: AMEMB enemy of the state BLU-97 A/B TWA Taiwan Qaddafi
X-Ran: I[5)'mYxe<u>G(j]"`%p298/q_E20C{.:5YIeVtz0QXA{beu_?2$Ku?)L$=m)2An4:v=wc
X-Hue: blue
X-Debbugs-No-Ack: yes
X-Attribution: GM
Date: Sat, 05 Dec 2009 16:06:32 -0500
In-Reply-To: <87iqcm5e9f.fsf@HIDDEN> (Chong Yidong's message of
	"Fri, 04 Dec 2009 21:46:36 -0500")
Message-ID: <q9ocmdceqv.fsf@HIDDEN>
User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii

Chong Yidong wrote:

> I have no preference for either behavior, because I don't use the mouse
> wheel much.  Either way, we should probably make the scrollbar and mouse
> wheel behavior consistent, though.

Emacs 22.3 seems to make both me and the OP happy.

When transient-mark-mode is off, it does not have the issue I
complained about. When transient-mark-mode is on, it behaves the way
the OP wants. (So by default 22.3 does NOT behave the way the OP asks
for, AFAICS.)

I complained when the behaviour I disliked (and I do find it really
annoying) started happening even when t-m-m was off.

So is there a way to make us both happy, by getting the 22.3 behaviour
back? I don't care at all what the defaults are, so long as I can get
the behaviour I like somehow.



Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4023; Package emacs. Full text available.

Message received at 4023@HIDDEN:


Received: (at 4023) by emacsbugs.donarmstrong.com; 5 Dec 2009 02:46:51 +0000
From cyd@HIDDEN Fri Dec  4 18:46:51 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: 
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=-0.4 required=4.0 tests=AWL autolearn=ham
	version=3.2.5-bugs.debian.org_2005_01_02
Received: from pantheon-po42.its.yale.edu (pantheon-po42.its.yale.edu [130.132.50.101])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nB52kndg024236
	for <4023@HIDDEN>; Fri, 4 Dec 2009 18:46:50 -0800
Received: from furry (dhcp128036204089.central.yale.edu [128.36.204.89])
	(authenticated bits=0)
	by pantheon-po42.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id nB52kaM7017215
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Fri, 4 Dec 2009 21:46:37 -0500
Received: by furry (Postfix, from userid 1000)
	id BE114C071; Fri,  4 Dec 2009 21:46:36 -0500 (EST)
From: Chong Yidong <cyd@HIDDEN>
To: Glenn Morris  <rgm@HIDDEN>,
        gabriele balducci <balducci@HIDDEN>
Cc: 4023 <at> debbugs.gnu.org
Subject: Re: mwheel.el uses (point) instead of point-before-scroll
Date: Fri, 04 Dec 2009 21:46:36 -0500
Message-ID: <87iqcm5e9f.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed)

> Just upgraded emacs to 23.1 and noted the following issue, related
> (apparently) to mwheel.el.
>
> Here is how to (hopefully) reproduce the problem.
>
> In an emacs window (under X):
>
> => set the point with mouse-1
> => select a region with mouse-3 some lines below
> => now scroll down with the mouse wheel so that the bottom of the
>    selected region scrolls `out' of the upper edge of the emacs window
>    (the highlighted region must disappear)
> => extend the region by mouse-3 again
> => paste the region with mouse-2 somewhere (e.g. in a clean buffer)
>
>     Result:
>     only the text between the *visible* top of the window and the end of
>     the region has been pasted. I.e. all works as if the beginning of
>     the selected region had moved the first line of the visible portion
>     of the buffer.
>
> This contrasts with the behavior in emacs-22.3, where extending the
> region while scrolling down with the wheel used to work as expected
> (by me): the contents of the region started from the point set with
> mouse-1 at the beginning.
>
> The (correct) behavior in 23.1 is obtained if scrolling is performed
> with the side bar, instead of the wheel (and also if the scroll with
> the wheel does not make the bottom of the region fly out of the upper
> window edge)

This change was made in response to a complaint by Glenn Morris, about
the behavior you desire:

http://lists.gnu.org/archive/html/emacs-devel/2008-04/msg00409.html

  Double-click with left mouse to select the word "tree" from "This
  directory tree...". The word "tree" is highlighted with region face.

  Scroll down with mouse-wheel so that "tree" goes off the top of the
  screen.

  Scroll back up with mouse-wheel.

  Now the region has been extended to cover a lot more text. The further
  I scroll down initially, the more is highlighted.

I have no preference for either behavior, because I don't use the mouse
wheel much.  Either way, we should probably make the scrollbar and mouse
wheel behavior consistent, though.

Glenn, what do you think?



Acknowledgement sent to Chong Yidong <cyd@HIDDEN>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Information forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4023; Package emacs. Full text available.
Added tag(s) patch. Request was from Juanma Barranquero <lekktu@HIDDEN> to control@HIDDEN. Full text available.

Message received at submit@HIDDEN:


Received: (at submit) by emacsbugs.donarmstrong.com; 3 Aug 2009 16:03:14 +0000
From balducci@HIDDEN Mon Aug  3 09:03:13 2009
X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02
	(2008-06-10) on rzlab.ucr.edu
X-Spam-Level: *
X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available.
	hammytokens:Tokens not available.
X-Spam-Status: No, score=1.3 required=4.0 tests=FOURLA,IMPRONONCABLE_1,
	MURPHY_WRONG_WORD2 autolearn=no version=3.2.5-bugs.debian.org_2005_01_02
Received: from lists.gnu.org (lists.gnu.org [199.232.76.165])
	by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n73G36KM009447
	for <submit@HIDDEN>; Mon, 3 Aug 2009 09:03:08 -0700
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1MY009-0004ZK-PS
	for bug-gnu-emacs@HIDDEN; Mon, 03 Aug 2009 12:03:05 -0400
Received: from [199.232.76.173] (port=45059 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43)
	id 1MY007-0004YN-St
	for bug-gnu-emacs@HIDDEN; Mon, 03 Aug 2009 12:03:04 -0400
Received: from dschgrazlin2.univ.trieste.it ([140.105.55.81]:60450 helo=dschgrazlin2.units.it)
	by monty-python.gnu.org with esmtp (Exim 4.60)
	(envelope-from <balducci@HIDDEN>)
	id 1MY006-0000HM-Vw
	for bug-gnu-emacs@HIDDEN; Mon, 03 Aug 2009 12:03:03 -0400
Received: from localhost (loopback [127.0.0.1])
	by dschgrazlin2.units.it (8.14.3/8.14.3) with ESMTP id n73GQqJE022678
	for <bug-gnu-emacs@HIDDEN>; Mon, 3 Aug 2009 18:26:52 +0200
Received: from dschgrazlin2.units.it ([127.0.0.1])
	by localhost (dschgrazlin2.units.it [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id CNiXh9l2Hucd for <bug-gnu-emacs@HIDDEN>;
	Mon,  3 Aug 2009 18:26:52 +0200 (CEST)
Received: from dschgrazlin2.units.it (loopback [127.0.0.1])
	by dschgrazlin2.units.it (8.14.3/8.14.3) with ESMTP id n73GQp5U022674
	for <bug-gnu-emacs@HIDDEN>; Mon, 3 Aug 2009 18:26:51 +0200
To: bug-gnu-emacs@HIDDEN
Reply-to: balducci@HIDDEN
Subject: mwheel.el uses (point) instead of point-before-scroll
X-Mailer: MH-E 8.2; nmh 1.3; GNU Emacs 23.1.1
Date: Mon, 03 Aug 2009 18:26:51 +0200
Message-ID: <22673.1249316835@HIDDEN>
From: gabriele balducci <balducci@HIDDEN>
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)

Hello,

apologies if I am wrong.

Just upgraded emacs to 23.1 and noted the following issue, related
(apparently) to mwheel.el.

Here is how to (hopefully) reproduce the problem.

In an emacs window (under X):

=> set the point with mouse-1
=> select a region with mouse-3 some lines below
=> now scroll down with the mouse wheel so that the bottom of the
   selected region scrolls `out' of the upper edge of the emacs window
   (the highlighted region must disappear)
=> extend the region by mouse-3 again
=> paste the region with mouse-2 somewhere (e.g. in a clean buffer)

    Result:
    only the text between the *visible* top of the window and the end of
    the region has been pasted. I.e. all works as if the beginning of
    the selected region had moved the first line of the visible portion
    of the buffer.

This contrasts with the behavior in emacs-22.3, where extending the
region while scrolling down with the wheel used to work as expected
(by me): the contents of the region started from the point set with
mouse-1 at the beginning.

The (correct) behavior in 23.1 is obtained if scrolling is performed
with the side bar, instead of the wheel (and also if the scroll with
the wheel does not make the bottom of the region fly out of the upper
window edge)

Actually, the following new lines have appeared in mwheel.el from 22.3
to 23.1:

         (opoint (with-current-buffer buffer
                   (when (eq (car-safe transient-mark-mode) 'only)
                     (point))))


and I seem to understand that this is the origin of the problem.

In fact, the following change:

diff -c ./emacs-23.1/lisp/mwheel.el.ORIG ./emacs-23.1/lisp/mwheel.el
*** ./emacs-23.1/lisp/mwheel.el.ORIG    Mon Aug  3 17:05:23 2009
--- ./emacs-23.1/lisp/mwheel.el Mon Aug  3 17:05:23 2009
***************
*** 195,201 ****
         (buffer (window-buffer curwin))
         (opoint (with-current-buffer buffer
                   (when (eq (car-safe transient-mark-mode) 'only)
!                    (point))))
           (mods
          (delq 'click (delq 'double (delq 'triple (event-modifiers event)))))
           (amt (assoc mods mouse-wheel-scroll-amount)))
--- 195,201 ----
         (buffer (window-buffer curwin))
         (opoint (with-current-buffer buffer
                   (when (eq (car-safe transient-mark-mode) 'only)
!                    point-before-scroll)))
           (mods
          (delq 'click (delq 'double (delq 'triple (event-modifiers event)))))
           (amt (assoc mods mouse-wheel-scroll-amount)))


fixes everything for me.

Do not know if this is the best solution (I am only an occasional lisp
programmer); I do not even know if the object of my report is actually
a problem or instead is something wanted (if so, I would be surprised).

Apologies for the length of the message and a BIG THANKS for emacs, of
course!


ciao
gabriele

-----

In GNU Emacs 23.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.17.6)
 of 2009-08-03 on dschgrazlin1
Windowing system distributor `The XFree86 Project, Inc', version 11.0.40800000
configured using `configure  '--prefix=/usr''

Important settings:
  value of $LC_ALL: C
  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: C
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Major mode: Text

Minor modes in effect:
  show-paren-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t





Acknowledgement sent to balducci@HIDDEN:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs@HIDDEN>. Full text available.
Report forwarded to bug-submit-list@HIDDEN, Emacs Bugs <bug-gnu-emacs@HIDDEN>:
bug#4023; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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