From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: rampant region highlighting Date: Mon, 07 Apr 2008 00:30:17 -0400 Message-ID: <87lk3quw12.fsf@stupidchicken.com> References: <87od8mocte.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1207542633 8840 80.91.229.12 (7 Apr 2008 04:30:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Apr 2008 04:30:33 +0000 (UTC) Cc: emacs-devel@gnu.org To: Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 07 06:31:05 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Jij0a-00031Y-GZ for ged-emacs-devel@m.gmane.org; Mon, 07 Apr 2008 06:31:04 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jiizx-0004mK-Es for ged-emacs-devel@m.gmane.org; Mon, 07 Apr 2008 00:30:25 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jiizt-0004l8-RF for emacs-devel@gnu.org; Mon, 07 Apr 2008 00:30:21 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jiizt-0004ka-BO for emacs-devel@gnu.org; Mon, 07 Apr 2008 00:30:21 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jiizt-0004kW-7N for emacs-devel@gnu.org; Mon, 07 Apr 2008 00:30:21 -0400 Original-Received: from c-98-216-111-182.hsd1.ma.comcast.net ([98.216.111.182] helo=furry) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jiizp-0002lz-Qv; Mon, 07 Apr 2008 00:30:17 -0400 Original-Received: by furry (Postfix, from userid 1000) id 5D8BEC045; Mon, 7 Apr 2008 00:30:17 -0400 (EDT) In-Reply-To: <87od8mocte.fsf@stupidchicken.com> (Chong Yidong's message of "Sun, 06 Apr 2008 18:09:33 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:94546 Archived-At: Chong Yidong writes: > Glenn Morris writes: > >> Current CVS trunk: >> >> ./src/emacs -Q README --eval '(transient-mark-mode -1)' >> >> 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 guess mwheel-scroll should unconditionally deactivate the mark when > tmm is active. I'll take a look. I think the way to handle this is to make mouse wheel scrolling preserve any temporarily active region iff point isn't moved. Does this patch give good results for you? *** trunk/lisp/mwheel.el.~1.44.~ 2008-01-08 15:44:42.000000000 -0500 --- trunk/lisp/mwheel.el 2008-04-07 00:26:48.000000000 -0400 *************** *** 190,195 **** --- 190,201 ---- (prog1 (selected-window) (select-window (mwheel-event-window event))))) + (buffer (window-buffer curwin)) + ;; If there is a temporarily active region, we may want to + ;; deactivate it. Save the original value of point. + (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))) *************** *** 224,230 **** ;; Make sure we do indeed scroll to the end of the buffer. (end-of-buffer (while t (scroll-up))))) (t (error "Bad binding in mwheel-scroll")))) ! (if curwin (select-window curwin)))) (when (and mouse-wheel-click-event mouse-wheel-inhibit-click-time) (if mwheel-inhibit-click-event-timer (cancel-timer mwheel-inhibit-click-event-timer) --- 230,240 ---- ;; Make sure we do indeed scroll to the end of the buffer. (end-of-buffer (while t (scroll-up))))) (t (error "Bad binding in mwheel-scroll")))) ! (if curwin (select-window curwin))) ! (when opoint ! (with-current-buffer buffer ! (when (/= opoint (point)) ! (deactivate-mark))))) (when (and mouse-wheel-click-event mouse-wheel-inhibit-click-time) (if mwheel-inhibit-click-event-timer (cancel-timer mwheel-inhibit-click-event-timer)