From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#13560: 24.2.92; tabulated-list header buttons are broken Date: Tue, 29 Jan 2013 20:27:13 -0500 Message-ID: <01sj5je9zi.fsf@fencepost.gnu.org> References: <878v7fvls0.fsf@bernoul.li> <4vtxq35od5.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1359509254 25929 80.91.229.3 (30 Jan 2013 01:27:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Jan 2013 01:27:34 +0000 (UTC) Cc: Jonas Bernoulli , Chong Yidong To: 13560@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 30 02:27:52 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U0MSs-0005qU-Uh for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Jan 2013 02:27:51 +0100 Original-Received: from localhost ([::1]:45444 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0MSa-0002Ho-UC for geb-bug-gnu-emacs@m.gmane.org; Tue, 29 Jan 2013 20:27:32 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:39007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0MSY-0002Hi-03 for bug-gnu-emacs@gnu.org; Tue, 29 Jan 2013 20:27:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U0MSW-0007ny-Nd for bug-gnu-emacs@gnu.org; Tue, 29 Jan 2013 20:27:29 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49451) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U0MSW-0007nu-Jf for bug-gnu-emacs@gnu.org; Tue, 29 Jan 2013 20:27:28 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U0MT4-0003Mk-3b for bug-gnu-emacs@gnu.org; Tue, 29 Jan 2013 20:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Jan 2013 01:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13560 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed help Original-Received: via spool by 13560-submit@debbugs.gnu.org id=B13560.135950927312921 (code B ref 13560); Wed, 30 Jan 2013 01:28:02 +0000 Original-Received: (at 13560) by debbugs.gnu.org; 30 Jan 2013 01:27:53 +0000 Original-Received: from localhost ([127.0.0.1]:54915 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U0MSu-0003MM-Px for submit@debbugs.gnu.org; Tue, 29 Jan 2013 20:27:53 -0500 Original-Received: from fencepost.gnu.org ([208.118.235.10]:51220) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U0MSs-0003ME-7u for 13560@debbugs.gnu.org; Tue, 29 Jan 2013 20:27:51 -0500 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1U0MSH-0005kk-Iz; Tue, 29 Jan 2013 20:27:13 -0500 X-Spook: UMTS UNSCOM advisors beanpole Bosnia David John Oates X-Ran: $m_lp|$%ZL(3S;(bopFhQR(&GE]t5^.GrOvP~|YiTPfEV8DcvPJ7%P7_J|V,Fp##fhT[38 X-Hue: magenta X-Attribution: GM In-Reply-To: (Glenn Morris's message of "Sun, 27 Jan 2013 20:36:45 -0500") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:70456 Archived-At: Ok, I think the issue here is mouse-drag-line pushing the same event onto unread-command-events twice in some cases. The recent history is a bit convoluted: 2012-07-08 changes to fix bug#374, and simplify mouse-drag-line loop. This caused bug#12006, fixed 2012-07-26. These changes reverted some of the loop simplifications, for reasons I don't understand. These changes in turn caused bug#12971 (no mouse-1 events in header), fixed 2012-11-24. It seems the fix actually gave us two sets of mouse-1 events in headers though (this bug). And then we have 2012-10-26 changes for bug#12731, introduced at some point along the way. What seems to work for me is going back to the 2012-07-26 changes, and reverting some of reversion. Basically, just check for switch-frame and select-window events and ignore them. Then I found I needed one more tweak to preserve the bug#12731 fix. The following change seems to not break any of bug 374, 12006, 12971, 12731, and to fix this bug; but I won't be surprised to hear that it breaks something else... *** lisp/mouse.el 2013-01-01 09:11:05 +0000 --- lisp/mouse.el 2013-01-29 22:22:44 +0000 *************** *** 425,431 **** (frame-parameters frame))) 'right))) (draggable t) ! finished event position growth dragged) (cond ((eq line 'header) ;; Check whether header-line can be dragged at all. --- 425,431 ---- (frame-parameters frame))) 'right))) (draggable t) ! event position growth dragged) (cond ((eq line 'header) ;; Check whether header-line can be dragged at all. *************** *** 456,494 **** ;; Start tracking. (track-mouse ! ;; Loop reading events and sampling the position of the mouse. ! (while (not finished) ! (setq event (read-event)) (setq position (mouse-position)) ;; Do nothing if ;; - there is a switch-frame event. ;; - the mouse isn't in the frame that we started in ;; - the mouse isn't in any Emacs frame - ;; Drag if - ;; - there is a mouse-movement event - ;; - there is a scroll-bar-movement event (Why? -- cyd) - ;; (same as mouse movement for our purposes) - ;; Quit if - ;; - there is a keyboard event or some other unknown event. (cond - ((not (consp event)) - (setq finished t)) ((memq (car event) '(switch-frame select-window)) nil) ! ((not (memq (car event) '(mouse-movement scroll-bar-movement))) ! (when (consp event) ! ;; Do not unread a drag-mouse-1 event to avoid selecting ! ;; some other window. For vertical line dragging do not ! ;; unread mouse-1 events either (but only if we dragged at ! ;; least once to allow mouse-1 clicks get through). ! (unless (and dragged ! (if (eq line 'vertical) ! (memq (car event) '(drag-mouse-1 mouse-1)) ! (eq (car event) 'drag-mouse-1))) ! (push event unread-command-events))) ! (setq finished t)) ! ((not (and (eq (car position) frame) ! (cadr position))) nil) ((eq line 'vertical) ;; Drag vertical divider. --- 456,480 ---- ;; Start tracking. (track-mouse ! ;; Loop reading events and sampling the position of the mouse, ! ;; until there is a non-mouse-movement event. Also, ! ;; scroll-bar-movement events are the same as mouse movement for ! ;; our purposes. (Why? -- cyd) ! (while (progn ! (setq event (read-event)) ! (memq (car-safe event) ! '(mouse-movement scroll-bar-movement ! switch-frame select-window))) (setq position (mouse-position)) ;; Do nothing if ;; - there is a switch-frame event. ;; - the mouse isn't in the frame that we started in ;; - the mouse isn't in any Emacs frame (cond ((memq (car event) '(switch-frame select-window)) nil) ! ((not (and (eq (car position) frame) ! (cadr position))) nil) ((eq line 'vertical) ;; Drag vertical divider. *************** *** 512,523 **** growth (- growth))))))) ;; Process the terminating event. ! (when (and (mouse-event-p event) on-link (not dragged) ! (mouse--remap-link-click-p start-event event)) ! ;; If mouse-2 has never been done by the user, it doesn't have ! ;; the necessary property to be interpreted correctly. ! (put 'mouse-2 'event-kind 'mouse-click) ! (setcar event 'mouse-2) (push event unread-command-events)))) (defun mouse-drag-mode-line (start-event) --- 498,510 ---- growth (- growth))))))) ;; Process the terminating event. ! (unless dragged ! (when (and (mouse-event-p event) on-link ! (mouse--remap-link-click-p start-event event)) ! ;; If mouse-2 has never been done by the user, it doesn't have ! ;; the necessary property to be interpreted correctly. ! (put 'mouse-2 'event-kind 'mouse-click) ! (setcar event 'mouse-2)) (push event unread-command-events)))) (defun mouse-drag-mode-line (start-event)