*** /tmp/ediffrfOigd 2022-12-03 18:09:46.243866776 +0100 --- /home/micha/software/emacs/lisp/mouse-drag.el 2022-12-03 18:02:14.743207682 +0100 *************** *** 283,316 **** window-last-col (- (window-width) 2)) (track-mouse ;; Set 'track-mouse' to something neither nil nor t (Bug#51794). ! (setq track-mouse 'drag-dragging) ! (while (progn ! (setq event (read--potential-mouse-event) ! end (event-end event) ! row (cdr (posn-col-row end)) ! col (car (posn-col-row end))) ! (or (mouse-movement-p event) ! (eq (car-safe event) 'switch-frame))) ! ;; Scroll if see if we're on the edge. ! ;; FIXME: should handle mouse-in-other window. ! (cond ! ((not (eq start-window (posn-window end))) ! t) ; wait for return to original window ! ((<= row 0) (mouse-drag-repeatedly-safe-scroll -1 0)) ! ((>= row window-last-row) (mouse-drag-repeatedly-safe-scroll 1 0)) ! ((and col-scrolling-p (<= col 1)) (mouse-drag-repeatedly-safe-scroll 0 -1)) ! ((and col-scrolling-p (>= col window-last-col)) (mouse-drag-repeatedly-safe-scroll 0 1)) ! (t ! (setq scroll-delta (- row start-row) ! start-row row) ! (if col-scrolling-p ! (setq scroll-col-delta (- col start-col) ! start-col col)) ! (if (or (/= 0 scroll-delta) ! (/= 0 scroll-col-delta)) ! (progn ! (setq have-scrolled t) ! (mouse-drag-safe-scroll scroll-delta scroll-col-delta))))))) ;; If it was a click and not a drag, prepare to pass the event on. ;; Is there a more correct way to reconstruct the event? (if (and (not have-scrolled) --- 283,319 ---- window-last-col (- (window-width) 2)) (track-mouse ;; Set 'track-mouse' to something neither nil nor t (Bug#51794). ! (setq track-mouse 'drag-dragging) ! (while (progn ! (setq event (read--potential-mouse-event) ! end (event-end event) ! row (and (not (eq (car-safe event) 'switch-frame)) ! (cdr (posn-col-row end))) ! col (and (not (eq (car-safe event) 'switch-frame)) ! (car (posn-col-row end)))) ! (or (mouse-movement-p event) ! (eq (car-safe event) 'switch-frame))) ! ;; Scroll if see if we're on the edge. ! ;; FIXME: should handle mouse-in-other window. ! (cond ! ((eq (car-safe event) 'switch-frame)) ! ((not (eq start-window (posn-window end))) ! t) ; wait for return to original window ! ((<= row 0) (mouse-drag-repeatedly-safe-scroll -1 0)) ! ((>= row window-last-row) (mouse-drag-repeatedly-safe-scroll 1 0)) ! ((and col-scrolling-p (<= col 1)) (mouse-drag-repeatedly-safe-scroll 0 -1)) ! ((and col-scrolling-p (>= col window-last-col)) (mouse-drag-repeatedly-safe-scroll 0 1)) ! (t ! (setq scroll-delta (- row start-row) ! start-row row) ! (if col-scrolling-p ! (setq scroll-col-delta (- col start-col) ! start-col col)) ! (if (or (/= 0 scroll-delta) ! (/= 0 scroll-col-delta)) ! (progn ! (setq have-scrolled t) ! (mouse-drag-safe-scroll scroll-delta scroll-col-delta))))))) ;; If it was a click and not a drag, prepare to pass the event on. ;; Is there a more correct way to reconstruct the event? (if (and (not have-scrolled)