From unknown Mon Jun 23 02:23:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26347: patch for mwheel.el Resent-From: Tak Kunihiro Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 Apr 2017 11:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 26347 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 26347@debbugs.gnu.org Cc: Kunihiro Tak X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.149121938420562 (code B ref -1); Mon, 03 Apr 2017 11:37:02 +0000 Received: (at submit) by debbugs.gnu.org; 3 Apr 2017 11:36:24 +0000 Received: from localhost ([127.0.0.1]:58159 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cv0HW-0005LZ-Av for submit@debbugs.gnu.org; Mon, 03 Apr 2017 07:36:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cv0HT-0005LH-Se for submit@debbugs.gnu.org; Mon, 03 Apr 2017 07:36:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cv0HM-0007gD-Ub for submit@debbugs.gnu.org; Mon, 03 Apr 2017 07:36:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37803) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cv0HM-0007g3-RR for submit@debbugs.gnu.org; Mon, 03 Apr 2017 07:36:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cv0HL-000741-2c for bug-gnu-emacs@gnu.org; Mon, 03 Apr 2017 07:36:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cv0HH-0007bH-Ln for bug-gnu-emacs@gnu.org; Mon, 03 Apr 2017 07:36:11 -0400 Received: from mxl069v64.mxlogic.net ([208.81.69.64]:65056 helo=s18p02o141.mxlogic.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cv0HH-0007Wn-1r for bug-gnu-emacs@gnu.org; Mon, 03 Apr 2017 07:36:07 -0400 Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s18p02o141.mxlogic.net(mxl_mta-8.5.0-1675) with ESMTP id 6a332e85.7f2f7bfff700.144267.00-544.316603.s18p02o141.mxlogic.net (envelope-from ); Mon, 03 Apr 2017 05:36:06 -0600 (MDT) X-MXL-Hash: 58e233a64a3c7e09-7496bb2b8d4689fd2e6dcda0ff8bac74d9244da8 Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s18p02o141.mxlogic.net(mxl_mta-8.5.0-1675) over TLS secured channel with ESMTP id 40e22e85.0.144053.00-387.316108.s18p02o141.mxlogic.net (envelope-from ); Mon, 03 Apr 2017 05:12:05 -0600 (MDT) X-MXL-Hash: 58e22e05276ff8f0-a2b7c0e659140980da3a60d63696420110b20bba Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 6a7b_88ce_e2ea21ac_eead_4d70_b356_b312ef68b87a; Mon, 03 Apr 2017 20:12:01 +0900 Received: from [192.168.1.50] (vesta.misasa.okayama-u.ac.jp [150.46.48.154]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id E1AD94C0A40; Mon, 3 Apr 2017 20:12:01 +0900 (JST) From: Tak Kunihiro Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Date: Mon, 3 Apr 2017 20:11:45 +0900 Message-Id: <338AA78D-144B-4857-AFE7-97E624DD85C4@misasa.okayama-u.ac.jp> Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) X-Mailer: Apple Mail (2.1878.6) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 4 Rules triggered EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_PASS=0, RV5988=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5988> : inlines <5770> : streams <1739753> : uri <2403022> X-AnalysisOut: [v=2.2 cv=Iev3YSia c=1 sm=1 tr=0 a=8LLPK8U+aGQ6qN8QlyMYtQ==] X-AnalysisOut: [:117 a=8LLPK8U+aGQ6qN8QlyMYtQ==:17 a=N659UExz7-8A:10 a=Azv] X-AnalysisOut: [cPWV-tVgA:10 a=ukymv0HeN-OhJwg9w00A:9 a=pILNOxqGKmIA:10] X-Spam: [F=0.5100000000; CM=0.500; MH=0.510(2017040306); S=0.200(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [42.127.236.175] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.4 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.4 (----) This patch tries to extend a global minor mode `mouse-wheel-mode' and makes Emacs scroll both vertically and horizontally by swiping `touchpad' or tilting `trackbar=92. To make the tilt scroll work, add a following line to init file. (setq mwheel-tilt-scroll-p t) How it is implemented is described below. To scroll horizontally, a function `mwheel-scroll' is extended. An event `wheel-right' or `wheel-left' calls `scroll-right' or `scroll-right', respectively. During not only horizontal scroll but also vertical scroll, `auto-hscroll-mode' should be disabled by following three aspects. (1) It should be off during horizontal scroll. If it is on, scope jumps randomly when point is at the edge. Also, since horizontal scroll does not move point, there will be inconsistency between point and scope, and the inconsistency will result in unexpected shift of the scope. (2) It should be off during vertical scroll. When a buffer is with short and long alternative lines, scope jumps from the end of long line to the end of short line. Sudden shift of the scope makes edition of a wide document hard. (3) During horizontal scroll, you may scroll a little in vertical direction without intention. The scrolling should be tolerance against such perturbation. This is somewhat similar to (2). After scroll, you want to set `auto-hscroll-mode' t back again otherwise too inconvenient for edition. Approach of this patch is to turn on another minor-mode `mwheel--scroll-mode' with `auto-hscroll-mode' nil at the beginning of `mwheel-scroll'. The minor mode is turned off upon any key inputs that move point. This is my first to time to send a patch. I follow `(emacs) Sending Patches=92. I hope this is helpful. --- = /Applications/MacPorts/Emacs-25.1.app/Contents/Resources/lisp/mwheel.el = 2017-04-03 16:28:52.000000000 +0900 +++ mwheel.el 2017-04-03 16:20:16.000000000 +0900 @@ -187,8 +187,8 @@ (defun mwheel-scroll (event) "Scroll up or down according to the EVENT. -This should be bound only to mouse buttons 4 and 5 on non-Windows -systems." +This should be bound only to mouse buttons 4, 5, 6, and 7 on +non-Windows systems." (interactive (list last-input-event)) (let* ((curwin (if mouse-wheel-follow-mouse (prog1 @@ -210,6 +210,9 @@ ;; When the double-mouse-N comes in, a mouse-N has been executed = already, ;; So by adding things up we get a squaring up (1, 3, 6, 10, 15, = ...). (setq amt (* amt (event-click-count event)))) + ;; Turn on minor-mode with auto-hscroll-mode nil for tilt scroll + (if mwheel-tilt-scroll-p + (with-current-buffer buffer (mwheel--scroll-mode 1))) (unwind-protect (let ((button (mwheel-event-button event))) (cond ((eq button mouse-wheel-down-event) @@ -231,6 +234,16 @@ (condition-case nil (funcall mwheel-scroll-up-function = amt) ;; Make sure we do indeed scroll to the end of the = buffer. (end-of-buffer (while t (funcall = mwheel-scroll-up-function))))) + ((eq button mouse-wheel-left-event) ; for tilt scroll + (when mwheel-tilt-scroll-p + (funcall (if mwheel-flip-direction + mwheel-scroll-right-function + mwheel-scroll-left-function) amt))) + ((eq button mouse-wheel-right-event) ; for tilt scroll + (when mwheel-tilt-scroll-p + (funcall (if mwheel-flip-direction + mwheel-scroll-left-function + mwheel-scroll-right-function) amt))) (t (error "Bad binding in mwheel-scroll")))) (if curwin (select-window curwin))) ;; If there is a temporarily active region, deactivate it if @@ -276,7 +289,7 @@ (global-unset-key key)))) ;; Setup bindings as needed. (when mouse-wheel-mode - (dolist (event (list mouse-wheel-down-event mouse-wheel-up-event)) + (dolist (event (list mouse-wheel-down-event mouse-wheel-up-event = mouse-wheel-right-event mouse-wheel-left-event)) (dolist (key (mapcar (lambda (amt) `[(,@(if (consp amt) (car = amt)) ,event)]) mouse-wheel-scroll-amount)) (global-set-key key 'mwheel-scroll) @@ -288,6 +301,92 @@ "Enable mouse wheel support." (mouse-wheel-mode (if uninstall -1 1))) + +;;; +;;; For tilt-scroll +;;; +(defcustom mwheel-tilt-scroll-p nil + "Enable tilt scroll and disable `auto-hscroll-mode' during scroll." + :group 'mouse + :type 'boolean) + +(defcustom mwheel-flip-direction nil + "Swap direction of 'wheel-right and 'wheel-left." + :group 'mouse + :type 'boolean) + +(defcustom mwheel-scroll-left-function 'scroll-left + "Function that does the job of scrolling left." + :group 'mouse + :type 'function) + +(defcustom mwheel-scroll-right-function 'scroll-right + "Function that does the job of scrolling right." + :group 'mouse + :type 'function) + +(defcustom mouse-wheel-left-event + (if (or (featurep 'w32-win) (featurep 'ns-win)) + 'wheel-left + (intern "mouse-6")) + "Event used for scrolling left." + :group 'mouse + :type 'symbol) + +(defcustom mouse-wheel-right-event + (if (or (featurep 'w32-win) (featurep 'ns-win)) + 'wheel-right + (intern "mouse-7")) + "Event used for scrolling right." + :group 'mouse + :type 'symbol) + +(defvar mouse--cursor-type cursor-type + "Cursor used by user. This variable is used internally to + restore original `cursor-type'.") + +(defun mwheel-disable--scroll-mode () + "Disable minor mode `mwheel--scroll-mode' to enable +`auto-hscroll-mode' back. Then invoke command that is bound to +the original key." + (interactive) + (mwheel--scroll-mode 0) ; turn off minor-mode + (call-interactively (key-binding (this-command-keys)))) + +(define-minor-mode mwheel--scroll-mode + "A minor-mode with `auto-hscroll-mode' off. This minor mode is +used internally." + :init-value nil + :keymap (let ((map (make-sparse-keymap))) + (define-key map [remap keyboard-quit] = 'mwheel-disable--scroll-mode) + (define-key map [remap mouse-drag-region] = 'mwheel-disable--scroll-mode) + (define-key map [remap right-char] = 'mwheel-disable--scroll-mode) + (define-key map [remap forward-char] = 'mwheel-disable--scroll-mode) + (define-key map [remap forward-word] = 'mwheel-disable--scroll-mode) + (define-key map [remap forward-sentence] = 'mwheel-disable--scroll-mode) + (define-key map [remap left-char] = 'mwheel-disable--scroll-mode) + (define-key map [remap backward-char] = 'mwheel-disable--scroll-mode) + (define-key map [remap backward-word] = 'mwheel-disable--scroll-mode) + (define-key map [remap backward-sentence] = 'mwheel-disable--scroll-mode) + (define-key map [remap move-beginning-of-line] = 'mwheel-disable--scroll-mode) + (define-key map [remap move-end-of-line] = 'mwheel-disable--scroll-mode) + (define-key map [remap next-line] = 'mwheel-disable--scroll-mode) + (define-key map [remap scroll-up-command] = 'mwheel-disable--scroll-mode) + (define-key map [remap previous-line] = 'mwheel-disable--scroll-mode) + (define-key map [remap scroll-down-command] = 'mwheel-disable--scroll-mode) + (define-key map [remap beginning-of-buffer] = 'mwheel-disable--scroll-mode) + (define-key map [remap end-of-buffer] = 'mwheel-disable--scroll-mode) + ;; listed as much as I can ... map all but = (where-is-internal 'mwheel-scroll) + map) + :group 'mouse + + (if mwheel--scroll-mode + (progn + (setq-local cursor-type 'hollow) + (setq-local auto-hscroll-mode nil)) + (setq-local cursor-type mouse--cursor-type) + (setq-local auto-hscroll-mode t))) + (provide 'mwheel) ;;; mwheel.el ends here From unknown Mon Jun 23 02:23:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26347: patch for mwheel.el Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 Apr 2017 15:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26347 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Tak Kunihiro Cc: 26347@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 26347-submit@debbugs.gnu.org id=B26347.14912316208343 (code B ref 26347); Mon, 03 Apr 2017 15:01:01 +0000 Received: (at 26347) by debbugs.gnu.org; 3 Apr 2017 15:00:20 +0000 Received: from localhost ([127.0.0.1]:59264 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cv3St-0002AV-Rh for submit@debbugs.gnu.org; Mon, 03 Apr 2017 11:00:20 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41908) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cv3Ss-0002AH-PC for 26347@debbugs.gnu.org; Mon, 03 Apr 2017 11:00:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cv3Sh-0008Cp-Ba for 26347@debbugs.gnu.org; Mon, 03 Apr 2017 11:00:13 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47501) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cv3Sh-0008Cj-8j; Mon, 03 Apr 2017 11:00:07 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3149 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cv3Sg-0003L0-Jt; Mon, 03 Apr 2017 11:00:07 -0400 Date: Mon, 03 Apr 2017 18:00:16 +0300 Message-Id: <83mvbxpmdb.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <338AA78D-144B-4857-AFE7-97E624DD85C4@misasa.okayama-u.ac.jp> (message from Tak Kunihiro on Mon, 3 Apr 2017 20:11:45 +0900) References: <338AA78D-144B-4857-AFE7-97E624DD85C4@misasa.okayama-u.ac.jp> MIME-version: 1.0 Content-type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Tak Kunihiro > Date: Mon, 3 Apr 2017 20:11:45 +0900 > Cc: Kunihiro Tak > > This patch tries to extend a global minor mode `mouse-wheel-mode' and > makes Emacs scroll both vertically and horizontally by swiping > `touchpad' or tilting `trackbar’. Thanks. This is a substantial contribution, so we will need legal papers from you to accept it. Would you like me to send you the form off-list so you could start your paperwork rolling? > During not only horizontal scroll but also vertical scroll, > `auto-hscroll-mode' should be disabled by following three aspects. > > (1) It should be off during horizontal scroll. If it is on, scope > jumps randomly when point is at the edge. Also, since > horizontal scroll does not move point, there will be > inconsistency between point and scope, and the inconsistency > will result in unexpected shift of the scope. > > (2) It should be off during vertical scroll. When a buffer is with > short and long alternative lines, scope jumps from the end of > long line to the end of short line. Sudden shift of the scope > makes edition of a wide document hard. We don't turn off auto-hscroll-mode when scrolling with the horizontal or vertical scroll bars, and we don't have the problems you describe in those cases. Why is this case different? From unknown Mon Jun 23 02:23:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26347: patch for mwheel.el Resent-From: Tak Kunihiro Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Apr 2017 00:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26347 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Kunihiro Tak , 26347@debbugs.gnu.org Received: via spool by 26347-submit@debbugs.gnu.org id=B26347.149126733530236 (code B ref 26347); Tue, 04 Apr 2017 00:56:02 +0000 Received: (at 26347) by debbugs.gnu.org; 4 Apr 2017 00:55:35 +0000 Received: from localhost ([127.0.0.1]:59648 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvCkx-0007rc-3E for submit@debbugs.gnu.org; Mon, 03 Apr 2017 20:55:35 -0400 Received: from mxl069v66.mxlogic.net ([208.81.69.66]:23084 helo=s18p02o143.mxlogic.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvCku-0007rP-V2 for 26347@debbugs.gnu.org; Mon, 03 Apr 2017 20:55:33 -0400 Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s18p02o143.mxlogic.net(mxl_mta-8.5.0-1675) over TLS secured channel with ESMTP id dfee2e85.0.151137.00-383.329640.s18p02o143.mxlogic.net (envelope-from ); Mon, 03 Apr 2017 18:55:30 -0600 (MDT) X-MXL-Hash: 58e2ef024f21cc6c-035434b2099879272d25f08adda72a9c002bde22 Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 1510_1791_b59f7752_c399_421d_876f_23d84eca3e8e; Tue, 04 Apr 2017 09:55:19 +0900 Received: from [192.168.1.50] (vesta.misasa.okayama-u.ac.jp [150.46.48.154]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id 7E44D4C0AF0; Tue, 4 Apr 2017 09:55:20 +0900 (JST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) From: Tak Kunihiro In-Reply-To: <83mvbxpmdb.fsf@gnu.org> Date: Tue, 4 Apr 2017 09:55:01 +0900 Content-Transfer-Encoding: quoted-printable Message-Id: <7CB47036-03AE-4C5B-9E14-3D84A6C4C757@misasa.okayama-u.ac.jp> References: <338AA78D-144B-4857-AFE7-97E624DD85C4@misasa.okayama-u.ac.jp> <83mvbxpmdb.fsf@gnu.org> X-Mailer: Apple Mail (2.1878.6) X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0.1 X-NAI-Spam-Rules: 5 Rules triggered GME_TWTRE=0.1, EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_PASS=0, RV5989=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5989> : inlines <5775> : streams <1739835> : uri <2403377> X-AnalysisOut: [v=2.2 cv=A48cB+eG c=1 sm=1 tr=0 a=8LLPK8U+aGQ6qN8QlyMYtQ==] X-AnalysisOut: [:117 a=8LLPK8U+aGQ6qN8QlyMYtQ==:17 a=N659UExz7-8A:10 a=Azv] X-AnalysisOut: [cPWV-tVgA:10 a=5RLcGgnWbBgB4uhVV-MA:9 a=pILNOxqGKmIA:10] X-Spam: [F=0.5000000000; CM=0.500; MH=0.500(2017040311); S=0.200(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [42.127.236.175] X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) >> During not only horizontal scroll but also vertical scroll, >> `auto-hscroll-mode' should be disabled by following three aspects. >>=20 >> (1) It should be off during horizontal scroll. If it is on, scope >> jumps randomly when point is at the edge. Also, since >> horizontal scroll does not move point, there will be >> inconsistency between point and scope, and the inconsistency >> will result in unexpected shift of the scope. >>=20 >> (2) It should be off during vertical scroll. When a buffer is with >> short and long alternative lines, scope jumps from the end of >> long line to the end of short line. Sudden shift of the scope >> makes edition of a wide document hard. >=20 > We don't turn off auto-hscroll-mode when scrolling with the horizontal > or vertical scroll bars, and we don't have the problems you describe > in those cases. Why is this case different? I see your point in regard to (1). Yes, if `mwheel-scroll=92 can scroll = right or left like horizontal-scroll-bar does, turing off auto-hscroll-mode is = not necessary for case (1). Give me time to understand code of = horizontal-scroll-bar. In regard to (2), let=92s say you have a very long line and your point = is at the end of line in a window. The next line is short and even the end of line is = not shown in the window. The third line is very long again. > date & session & stone & remark & date & session & stone & remark\\ > \hline > April 4, 2017 & a & b & c & April 4, 2017 & a & b & c\\ When you move vertical-scroll-bar down, eventually the long line = disappears above the top of window. The point moves to the end of the next short = line. As a consequence, you see scope shifted. The patch tries to keep the = scope to be the same. To do so, auto-hscroll-mode was set to off. From unknown Mon Jun 23 02:23:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26347: patch for mwheel.el Resent-From: Tak Kunihiro Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Apr 2017 02:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26347 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Kunihiro Tak , 26347@debbugs.gnu.org Received: via spool by 26347-submit@debbugs.gnu.org id=B26347.149127440515279 (code B ref 26347); Tue, 04 Apr 2017 02:54:02 +0000 Received: (at 26347) by debbugs.gnu.org; 4 Apr 2017 02:53:25 +0000 Received: from localhost ([127.0.0.1]:59702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvEaz-0003yM-Gq for submit@debbugs.gnu.org; Mon, 03 Apr 2017 22:53:25 -0400 Received: from mxl065v65.mxlogic.net ([208.81.65.65]:50062 helo=s14p02o142.mxlogic.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvEax-0003yD-Bi for 26347@debbugs.gnu.org; Mon, 03 Apr 2017 22:53:24 -0400 Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s14p02o142.mxlogic.net(mxl_mta-8.5.0-1675) over TLS secured channel with ESMTP id d9a03e85.0.246547.00-373.524135.s14p02o142.mxlogic.net (envelope-from ); Mon, 03 Apr 2017 20:53:19 -0600 (MDT) X-MXL-Hash: 58e30a9f447b1fd0-8214e0dd8fb0b9a18350d7f856a89265183a022a Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 151d_6531_22db319e_e39f_498e_8e14_f1a56eab3929; Tue, 04 Apr 2017 11:53:13 +0900 Received: from [192.168.1.50] (vesta.misasa.okayama-u.ac.jp [150.46.48.154]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id 86A434C0B2B; Tue, 4 Apr 2017 11:53:14 +0900 (JST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) From: Tak Kunihiro In-Reply-To: <7CB47036-03AE-4C5B-9E14-3D84A6C4C757@misasa.okayama-u.ac.jp> Date: Tue, 4 Apr 2017 11:52:55 +0900 Content-Transfer-Encoding: quoted-printable Message-Id: <592025CA-53C7-4443-97F6-114A79D7A43F@misasa.okayama-u.ac.jp> References: <338AA78D-144B-4857-AFE7-97E624DD85C4@misasa.okayama-u.ac.jp> <83mvbxpmdb.fsf@gnu.org> <7CB47036-03AE-4C5B-9E14-3D84A6C4C757@misasa.okayama-u.ac.jp> X-Mailer: Apple Mail (2.1878.6) X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0.1 X-NAI-Spam-Rules: 5 Rules triggered GME_TWTRE=0.1, EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_PASS=0, RV5989=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5989> : inlines <5775> : streams <1739847> : uri <2403427> X-AnalysisOut: [v=2.2 cv=U+7iNaju c=1 sm=1 tr=0 a=8LLPK8U+aGQ6qN8QlyMYtQ==] X-AnalysisOut: [:117 a=8LLPK8U+aGQ6qN8QlyMYtQ==:17 a=N659UExz7-8A:10 a=Azv] X-AnalysisOut: [cPWV-tVgA:10 a=941KWDkytGGZmRm6IggA:9 a=pILNOxqGKmIA:10] X-Spam: [F=0.5000000000; CM=0.500; MH=0.500(2017040312); S=0.209(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [42.127.236.175] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) >>> During not only horizontal scroll but also vertical scroll, >>> `auto-hscroll-mode' should be disabled by following three aspects. >>>=20 >>> (1) It should be off during horizontal scroll. If it is on, scope >>> jumps randomly when point is at the edge. Also, since >>> horizontal scroll does not move point, there will be >>> inconsistency between point and scope, and the inconsistency >>> will result in unexpected shift of the scope. >>>=20 >> We don't turn off auto-hscroll-mode when scrolling with the = horizontal >> or vertical scroll bars, and we don't have the problems you describe >> in those cases. Why is this case different? >=20 > I see your point in regard to (1). Yes, if `mwheel-scroll=92 can = scroll right > or left like horizontal-scroll-bar does, turing off auto-hscroll-mode = is not > necessary for case (1). Give me time to understand code of = horizontal-scroll-bar. I see (1) is true for Emacs 25.1 on Mac and Emacs 24.5 on Windows=20 but Emacs 25.1 on Windows. =20 From unknown Mon Jun 23 02:23:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26347: patch for mwheel.el Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Apr 2017 07:27:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26347 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Tak Kunihiro , Eli Zaretskii Cc: 26347@debbugs.gnu.org Received: via spool by 26347-submit@debbugs.gnu.org id=B26347.14912907868015 (code B ref 26347); Tue, 04 Apr 2017 07:27:04 +0000 Received: (at 26347) by debbugs.gnu.org; 4 Apr 2017 07:26:26 +0000 Received: from localhost ([127.0.0.1]:59749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvIrB-00025C-US for submit@debbugs.gnu.org; Tue, 04 Apr 2017 03:26:26 -0400 Received: from mout.gmx.net ([212.227.15.15]:57411) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvIrA-00024z-7o for 26347@debbugs.gnu.org; Tue, 04 Apr 2017 03:26:24 -0400 Received: from [192.168.1.100] ([213.162.68.81]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0M1msU-1c6DKe2AiA-00tnWY; Tue, 04 Apr 2017 09:26:06 +0200 Message-ID: <58E34A84.5010808@gmx.at> Date: Tue, 04 Apr 2017 09:25:56 +0200 From: martin rudalics MIME-Version: 1.0 References: <338AA78D-144B-4857-AFE7-97E624DD85C4@misasa.okayama-u.ac.jp> <83mvbxpmdb.fsf@gnu.org> <7CB47036-03AE-4C5B-9E14-3D84A6C4C757@misasa.okayama-u.ac.jp> <592025CA-53C7-4443-97F6-114A79D7A43F@misasa.okayama-u.ac.jp> In-Reply-To: <592025CA-53C7-4443-97F6-114A79D7A43F@misasa.okayama-u.ac.jp> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:myJPz52CEq/r1MU8GluX+sqVGvxcYLbIpj5LRyVFWs1ZRckJhXH YqC5pUK7vGL9B/k2oYuBJJP7KZelaVBNBHT7d/VaE2StBtsMeRgaCxdm6LoSkFUMkv0yV7p 9QwQQPpuND5ldSlvl/RRDo6Ye3ScguPfz5E0Aunq0DYN7eUzFentyjoc9HfH//fqn9Q84wK 9f5H/2G4doOXUsTARxrng== X-UI-Out-Filterresults: notjunk:1;V01:K0:mJvZzBnNAPo=:N0ZVEbIAdIe4xVXQmuD2sl mNWmNM7QHmpPzQ6NmopuO7U+QBuKIdcSde6EHKze1IUKdOCKk/JbClrbgetYdBUkQJed+yE5q 1BUX1rW/X/9DUBzSG8YLZFtp5n7f6sFDsVaabkWAv9IUV9/Dt1ImXj/an7Tvt+XcvSe4ayTmZ eFZ+FjNqoPD4u3yXhDwVtGLhJnDI3S0kUJbtm4FFu/sva2oxA0hQ1zgYeYJ3FUdq3RVcA4nNe 73m2qq8CX1kXRyLmwioGI5uCL1qmdVqA1dzYHlm1dimNLmjZE8cWgBl4xlcqw3ziOEhGze0W/ CSQUKJblFlQuNqOgFdHoRMVYB5bSIJU8mmLmeII2I8i5d0LFygeVAZxcurOgtoNZe+RtsLRPt yIn3PdtO6ocCcGYya53dVnwUc9kD4iLpCSCqPyDiv8Sw2YCLoxnaH1PDdOpVmBuvohziQodze Pusrcv0pmspsKAVS2Pjn34ZLrpJ6Xtz2S49D1FdZS5NVqq12FDEQQUOykAiRN59kphBzb7lhp 6kFAxjQB+ct/17lR8W0Qr0DmHcx1Zg25+aO2l8cYQFF4Gs9upJ1bcOTYRRbLGEkku+lOWAI+G jYeZ/Y0b1wZ9bu1qGEVgbFQngVraDbjV8SQR4TFkNyn4vTX+dKX/bVgrydurEBRYaf61uvloC UU+sdiN92/6ZtaIrQQOW/MUTYTinES4EgUUNTb0j0lYWvmmvGoKtbR4QOJBwb6wagPFmdoxnx anftfMMiC05VFvaz6kCFNsS6X8p3RXWPO4ybNIn5q1bFjcLLgzRf3MgI3tD8vLWEtPZhVlsXq stXa8sG X-Spam-Score: -3.5 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.5 (---) >> Give me time to understand code of horizontal-scroll-bar. ... and improve it, hopefully. > I see (1) is true for Emacs 25.1 on Mac and Emacs 24.5 on Windows > but Emacs 25.1 on Windows. Did you mean Emacs 24.5 on Windows but _not_ Emacs 25.1 on Windows? martin From unknown Mon Jun 23 02:23:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26347: patch for mwheel.el Resent-From: Tak Kunihiro Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Apr 2017 11:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26347 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: martin rudalics Cc: tkk@misasa.okayama-u.ac.jp, 26347@debbugs.gnu.org Received: via spool by 26347-submit@debbugs.gnu.org id=B26347.14913057285449 (code B ref 26347); Tue, 04 Apr 2017 11:36:01 +0000 Received: (at 26347) by debbugs.gnu.org; 4 Apr 2017 11:35:28 +0000 Received: from localhost ([127.0.0.1]:59830 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvMkC-0001Pp-01 for submit@debbugs.gnu.org; Tue, 04 Apr 2017 07:35:28 -0400 Received: from mxl065v65.mxlogic.net ([208.81.65.65]:43726 helo=s14p02o142.mxlogic.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvMk9-0001Pf-Ht for 26347@debbugs.gnu.org; Tue, 04 Apr 2017 07:35:26 -0400 Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s14p02o142.mxlogic.net(mxl_mta-8.5.0-1675) over TLS secured channel with ESMTP id 6f483e85.0.258589.00-369.553695.s14p02o142.mxlogic.net (envelope-from ); Tue, 04 Apr 2017 05:35:19 -0600 (MDT) X-MXL-Hash: 58e384f7304627f4-c035a8d0ff35bbeacd482669004672116fef707e Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 152e_622c_518c1c00_6885_4dfd_b090_f56519ae9356; Tue, 04 Apr 2017 20:35:15 +0900 Received: from localhost (p256188-ipngn200208tottori.tottori.ocn.ne.jp [180.36.253.188]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id A26384C0B68; Tue, 4 Apr 2017 20:35:16 +0900 (JST) Date: Tue, 04 Apr 2017 20:35:05 +0900 (JST) Message-Id: <20170404.203505.488305127.tkk@misasa.okayama-u.ac.jp> From: Tak Kunihiro In-Reply-To: <592025CA-53C7-4443-97F6-114A79D7A43F@misasa.okayama-u.ac.jp> References: <83mvbxpmdb.fsf@gnu.org> <7CB47036-03AE-4C5B-9E14-3D84A6C4C757@misasa.okayama-u.ac.jp> <592025CA-53C7-4443-97F6-114A79D7A43F@misasa.okayama-u.ac.jp> X-Mailer: Mew version 6.7 on Emacs 25.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-7 Content-Transfer-Encoding: base64 X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0.6 X-NAI-Spam-Rules: 5 Rules triggered TS_MSG_REP_20=0.6, EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_PASS=0, RV5990=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5990> : inlines <5777> : streams <1739899> : uri <2403641> X-AnalysisOut: [v=2.2 cv=U+7iNaju c=1 sm=1 tr=0 a=8LLPK8U+aGQ6qN8QlyMYtQ==] X-AnalysisOut: [:117 a=8LLPK8U+aGQ6qN8QlyMYtQ==:17 a=E_FQspuQcigA:10 a=Azv] X-AnalysisOut: [cPWV-tVgA:10 a=fRCvdCwC3CCBvNwor6oA:9 a=o3X3QV6JOaEA:10] X-Spam: [F=0.5200000000; CM=0.500; MH=0.520(2017040404); S=0.200(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [42.127.236.175] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Pj4+Pj4gRHVyaW5nIG5vdCBvbmx5IGhvcml6b250YWwgc2Nyb2xsIGJ1dCBhbHNvIHZlcnRpY2Fs IHNjcm9sbCwNCj4+Pj4+IGBhdXRvLWhzY3JvbGwtbW9kZScgc2hvdWxkIGJlIGRpc2FibGVkIGJ5 IGZvbGxvd2luZyB0aHJlZSBhc3BlY3RzLg0KPj4+Pj4gDQo+Pj4+PiAoMSkgSXQgc2hvdWxkIGJl IG9mZiBkdXJpbmcgaG9yaXpvbnRhbCBzY3JvbGwuICBJZiBpdCBpcyBvbiwgc2NvcGUNCj4+Pj4+ ICAganVtcHMgcmFuZG9tbHkgd2hlbiBwb2ludCBpcyBhdCB0aGUgZWRnZS4gIEFsc28sIHNpbmNl DQo+Pj4+PiAgIGhvcml6b250YWwgc2Nyb2xsIGRvZXMgbm90IG1vdmUgcG9pbnQsIHRoZXJlIHdp bGwgYmUNCj4+Pj4+ICAgaW5jb25zaXN0ZW5jeSBiZXR3ZWVuIHBvaW50IGFuZCBzY29wZSwgYW5k IHRoZSBpbmNvbnNpc3RlbmN5DQo+Pj4+PiAgIHdpbGwgcmVzdWx0IGluIHVuZXhwZWN0ZWQgc2hp ZnQgb2YgdGhlIHNjb3BlLg0KPj4+Pj4gDQo+Pj4+IFdlIGRvbid0IHR1cm4gb2ZmIGF1dG8taHNj cm9sbC1tb2RlIHdoZW4gc2Nyb2xsaW5nIHdpdGggdGhlIGhvcml6b250YWwNCj4+Pj4gb3IgdmVy dGljYWwgc2Nyb2xsIGJhcnMsIGFuZCB3ZSBkb24ndCBoYXZlIHRoZSBwcm9ibGVtcyB5b3UgZGVz Y3JpYmUNCj4+Pj4gaW4gdGhvc2UgY2FzZXMuICBXaHkgaXMgdGhpcyBjYXNlIGRpZmZlcmVudD8N Cj4+PiANCj4+PiBJIHNlZSB5b3VyIHBvaW50IGluIHJlZ2FyZCB0byAoMSkuICBZZXMsIGlmIGBt d2hlZWwtc2Nyb2xsoiBjYW4gc2Nyb2xsIHJpZ2h0DQo+Pj4gb3IgbGVmdCBsaWtlIGhvcml6b250 YWwtc2Nyb2xsLWJhciBkb2VzLCB0dXJpbmcgb2ZmIGF1dG8taHNjcm9sbC1tb2RlIGlzIG5vdA0K Pj4+IG5lY2Vzc2FyeSBmb3IgY2FzZSAoMSkuICBHaXZlIG1lIHRpbWUgdG8gdW5kZXJzdGFuZCBj b2RlIG9mIGhvcml6b250YWwtc2Nyb2xsLWJhci4NCj4+IA0KPj4gSSBzZWUgKDEpIGlzIHRydWUg Zm9yIEVtYWNzIDI1LjEgb24gTWFjIGFuZCBFbWFjcyAyNC41IG9uIFdpbmRvd3MNCj4+IGJ1dCBF bWFjcyAyNS4xIG9uIFdpbmRvd3MuDQo+DQo+IERpZCB5b3UgbWVhbiBFbWFjcyAyNC41IG9uIFdp bmRvd3MgYnV0IF9ub3RfIEVtYWNzIDI1LjEgb24gV2luZG93cz8NCg0KTGV0IG1lIHRha2UgaXQg YmFjayBhbmQgcmVwaHJhc2UuICBJIG1lYW50ICgxKSBpcyB0cnVlIGZvciBFbWFjcyAyNC41DQpv biBXaW5kb3dzIGJ1dCBub3QgZm9yIEVtYWNzIDI1LjEgb24gV2luZG93cy4gIEVtYWNzIDI1LjEg b24gV2luZG93cw0Kc2Nyb2xscyBob3Jpem9udGFsbHkgd2VsbCB3aXRoIGF1dG8taHNjcm9sbC1t b2RlIG9uLg0K From unknown Mon Jun 23 02:23:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26347: patch for mwheel.el Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Apr 2017 14:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26347 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Tak Kunihiro Cc: rudalics@gmx.at, 26347@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 26347-submit@debbugs.gnu.org id=B26347.149131646423221 (code B ref 26347); Tue, 04 Apr 2017 14:35:02 +0000 Received: (at 26347) by debbugs.gnu.org; 4 Apr 2017 14:34:24 +0000 Received: from localhost ([127.0.0.1]:60787 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvPXM-00062Q-8J for submit@debbugs.gnu.org; Tue, 04 Apr 2017 10:34:24 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58705) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvPXJ-00062B-SO for 26347@debbugs.gnu.org; Tue, 04 Apr 2017 10:34:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvPXA-000759-8U for 26347@debbugs.gnu.org; Tue, 04 Apr 2017 10:34:16 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvPXA-000755-4a; Tue, 04 Apr 2017 10:34:12 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4798 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cvPX9-0001PU-E1; Tue, 04 Apr 2017 10:34:11 -0400 Date: Tue, 04 Apr 2017 17:34:10 +0300 Message-Id: <83bmscp7h9.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <20170404.203505.488305127.tkk@misasa.okayama-u.ac.jp> (message from Tak Kunihiro on Tue, 04 Apr 2017 20:35:05 +0900 (JST)) References: <83mvbxpmdb.fsf@gnu.org> <7CB47036-03AE-4C5B-9E14-3D84A6C4C757@misasa.okayama-u.ac.jp> <592025CA-53C7-4443-97F6-114A79D7A43F@misasa.okayama-u.ac.jp> <20170404.203505.488305127.tkk@misasa.okayama-u.ac.jp> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Tue, 04 Apr 2017 20:35:05 +0900 (JST) > From: Tak Kunihiro > Cc: tkk@misasa.okayama-u.ac.jp, 26347@debbugs.gnu.org > > Let me take it back and rephrase. I meant (1) is true for Emacs 24.5 > on Windows but not for Emacs 25.1 on Windows. Emacs 25.1 on Windows > scrolls horizontally well with auto-hscroll-mode on. So I guess this means there is hope your patch could be amended not to disable auto-hscroll-mode? From unknown Mon Jun 23 02:23:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26347: patch for mwheel.el Resent-From: Tak Kunihiro Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Apr 2017 23:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26347 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: rudalics@gmx.at, Kunihiro Tak , 26347@debbugs.gnu.org Received: via spool by 26347-submit@debbugs.gnu.org id=B26347.149134796021365 (code B ref 26347); Tue, 04 Apr 2017 23:20:01 +0000 Received: (at 26347) by debbugs.gnu.org; 4 Apr 2017 23:19:20 +0000 Received: from localhost ([127.0.0.1]:32929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvXjM-0005YX-5E for submit@debbugs.gnu.org; Tue, 04 Apr 2017 19:19:20 -0400 Received: from mxl065v67.mxlogic.net ([208.81.65.67]:54704 helo=s14p02o144.mxlogic.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvXjK-0005YO-3v for 26347@debbugs.gnu.org; Tue, 04 Apr 2017 19:19:18 -0400 Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s14p02o144.mxlogic.net(mxl_mta-8.5.0-1675) over TLS secured channel with ESMTP id 0f924e85.0.282300.00-377.585724.s14p02o144.mxlogic.net (envelope-from ); Tue, 04 Apr 2017 17:19:14 -0600 (MDT) X-MXL-Hash: 58e429f234540b3b-6346ffe7b3dfa3fad6c4174445f69db332fc203f Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 1fd1_2db7_fc0a66eb_3cf0_4f96_97ba_58d1b7fdeb90; Wed, 05 Apr 2017 08:19:06 +0900 Received: from [192.168.1.50] (vesta.misasa.okayama-u.ac.jp [150.46.48.154]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id CB4314C0B57; Wed, 5 Apr 2017 08:19:06 +0900 (JST) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) From: Tak Kunihiro In-Reply-To: <83bmscp7h9.fsf@gnu.org> Date: Wed, 5 Apr 2017 08:18:42 +0900 Content-Transfer-Encoding: quoted-printable Message-Id: References: <83mvbxpmdb.fsf@gnu.org> <7CB47036-03AE-4C5B-9E14-3D84A6C4C757@misasa.okayama-u.ac.jp> <592025CA-53C7-4443-97F6-114A79D7A43F@misasa.okayama-u.ac.jp> <20170404.203505.488305127.tkk@misasa.okayama-u.ac.jp> <83bmscp7h9.fsf@gnu.org> X-Mailer: Apple Mail (2.1878.6) X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0.1 X-NAI-Spam-Rules: 5 Rules triggered GME_TWTRE=0.1, EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_PASS=0, RV5990=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5990> : inlines <5780> : streams <1739969> : uri <2403944> X-AnalysisOut: [v=2.2 cv=MPYQoIRl c=1 sm=1 tr=0 a=8LLPK8U+aGQ6qN8QlyMYtQ==] X-AnalysisOut: [:117 a=8LLPK8U+aGQ6qN8QlyMYtQ==:17 a=N659UExz7-8A:10 a=Azv] X-AnalysisOut: [cPWV-tVgA:10 a=QjcNRHyoBf4DiX6CctQA:9 a=pILNOxqGKmIA:10] X-Spam: [F=0.5200000000; CM=0.500; MH=0.520(2017040407); S=0.200(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [42.127.236.175] X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) >> Let me take it back and rephrase. I meant (1) is true for Emacs 24.5 >> on Windows but not for Emacs 25.1 on Windows. Emacs 25.1 on Windows >> scrolls horizontally well with auto-hscroll-mode on. >=20 > So I guess this means there is hope your patch could be amended not to > disable auto-hscroll-mode? >> Let me take it back and rephrase. I meant (1) is true for Emacs 24.5 >> on Windows but not for Emacs 25.1 on Windows. Emacs 25.1 on Windows >> scrolls horizontally well with auto-hscroll-mode on. > > So I guess this means there is hope your patch could be amended not to > disable auto-hscroll-mode? Now I leaned auto-hscroll-mode is irrelevant to horizontal scroll. However, I still insist that it should be off on horizontal and vertical scrolling. (A) It should be off during vertical scroll. Let=92s consider a buffer is with short and long alternative lines and when point is at the end of long line, at the top of current window. After `scroll-up 1', point jumps to the end of the next short line and you see scope shifts suddenly leftward. This behavior is sometimes unexpected one. (B) It should be off during horizontal scroll. During horizontal scroll, you may scroll a little in vertical direction without intention. The horizontal scroll should be tolerance against such perturbation. The source of concern is same as (A). The concern (A) is shared with vertical scroll-bar. With this respect, the concern should be solved by `scroll-up' not by `mwheel-scroll'. I think when point moves off the left edge of the window with cursor frozen at the left edge of the window, `scroll-up' should scroll up without horizontal shift. Conclusion: Yes. From unknown Mon Jun 23 02:23:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26347: patch for mwheel.el Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Apr 2017 02:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26347 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Tak Kunihiro Cc: rudalics@gmx.at, 26347@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 26347-submit@debbugs.gnu.org id=B26347.149135981014394 (code B ref 26347); Wed, 05 Apr 2017 02:37:02 +0000 Received: (at 26347) by debbugs.gnu.org; 5 Apr 2017 02:36:50 +0000 Received: from localhost ([127.0.0.1]:33040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvaoU-0003k6-Fa for submit@debbugs.gnu.org; Tue, 04 Apr 2017 22:36:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57081) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvaoT-0003jv-9f for 26347@debbugs.gnu.org; Tue, 04 Apr 2017 22:36:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvaoJ-0001UJ-Te for 26347@debbugs.gnu.org; Tue, 04 Apr 2017 22:36:44 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvaoJ-0001UE-Qb; Tue, 04 Apr 2017 22:36:39 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1684 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cvaoI-0003F2-SO; Tue, 04 Apr 2017 22:36:39 -0400 Date: Wed, 05 Apr 2017 05:36:39 +0300 Message-Id: <83shlnoa14.fsf@gnu.org> From: Eli Zaretskii In-reply-to: (message from Tak Kunihiro on Wed, 5 Apr 2017 08:18:42 +0900) References: <83mvbxpmdb.fsf@gnu.org> <7CB47036-03AE-4C5B-9E14-3D84A6C4C757@misasa.okayama-u.ac.jp> <592025CA-53C7-4443-97F6-114A79D7A43F@misasa.okayama-u.ac.jp> <20170404.203505.488305127.tkk@misasa.okayama-u.ac.jp> <83bmscp7h9.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Tak Kunihiro > Date: Wed, 5 Apr 2017 08:18:42 +0900 > Cc: Kunihiro Tak , > rudalics@gmx.at, > 26347@debbugs.gnu.org > > Now I leaned auto-hscroll-mode is irrelevant to horizontal scroll. > However, I still insist that it should be off on horizontal and > vertical scrolling. > > (A) It should be off during vertical scroll. Let’s consider a buffer > is with short and long alternative lines and when point is at the > end of long line, at the top of current window. After `scroll-up > 1', point jumps to the end of the next short line and you see scope > shifts suddenly leftward. This behavior is sometimes unexpected > one. > > (B) It should be off during horizontal scroll. During horizontal > scroll, you may scroll a little in vertical direction without > intention. The horizontal scroll should be tolerance against such > perturbation. The source of concern is same as (A). > > The concern (A) is shared with vertical scroll-bar. With this > respect, the concern should be solved by `scroll-up' not by > `mwheel-scroll'. > > I think when point moves off the left edge of the window with cursor > frozen at the left edge of the window, `scroll-up' should scroll up > without horizontal shift. > > Conclusion: Yes. The considerations you present are not special to the proposed horizontal scrolling using a mouse wheel, they are valid for any scrolling. IOW, this is how scrolling behaved in Emacs since about forever. And I think it's not a good idea to have some methods of scrolling behave differently from others. So I could agree to having a user option to temporarily disable auto-hscroll-mode during scrolling, but the default behavior should be what we have now, and the option should affect all methods of scrolling alike. Thanks. From unknown Mon Jun 23 02:23:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26347: patch for mwheel.el Resent-From: Tak Kunihiro Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Apr 2017 03:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26347 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: Kunihiro Tak , 26347@debbugs.gnu.org Received: via spool by 26347-submit@debbugs.gnu.org id=B26347.149136336320019 (code B ref 26347); Wed, 05 Apr 2017 03:37:02 +0000 Received: (at 26347) by debbugs.gnu.org; 5 Apr 2017 03:36:03 +0000 Received: from localhost ([127.0.0.1]:33083 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvbjm-0005Co-Q4 for submit@debbugs.gnu.org; Tue, 04 Apr 2017 23:36:02 -0400 Received: from mxl065v65.mxlogic.net ([208.81.65.65]:46990 helo=s14p02o142.mxlogic.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvbjk-0005CO-QL for 26347@debbugs.gnu.org; Tue, 04 Apr 2017 23:36:01 -0400 Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s14p02o142.mxlogic.net(mxl_mta-8.5.0-1675) over TLS secured channel with ESMTP id 81664e85.0.270000.00-392.577972.s14p02o142.mxlogic.net (envelope-from ); Tue, 04 Apr 2017 21:35:54 -0600 (MDT) X-MXL-Hash: 58e4661a0774cddd-1d266366bdd4e1c6da73504e57d25bb54e609afd Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 1fc8_7f83_c658c94c_31c6_4d0b_8986_0c7fa6ca2c3c; Wed, 05 Apr 2017 12:35:48 +0900 Received: from [192.168.1.50] (vesta.misasa.okayama-u.ac.jp [150.46.48.154]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id B51394C0B52; Wed, 5 Apr 2017 12:35:48 +0900 (JST) Content-Type: multipart/mixed; boundary="Apple-Mail=_4D77D36A-9F2E-4404-BC69-20E9209E6436" Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) From: Tak Kunihiro In-Reply-To: <83shlnoa14.fsf@gnu.org> Date: Wed, 5 Apr 2017 12:35:24 +0900 Message-Id: <54B770D7-510E-49AE-BBCC-DE55B9D91B85@misasa.okayama-u.ac.jp> References: <83mvbxpmdb.fsf@gnu.org> <7CB47036-03AE-4C5B-9E14-3D84A6C4C757@misasa.okayama-u.ac.jp> <592025CA-53C7-4443-97F6-114A79D7A43F@misasa.okayama-u.ac.jp> <20170404.203505.488305127.tkk@misasa.okayama-u.ac.jp> <83bmscp7h9.fsf@gnu.org> <83shlnoa14.fsf@gnu.org> X-Mailer: Apple Mail (2.1878.6) X-NAI-Spam-Flag: NO X-NAI-Spam-Level: X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0.1 X-NAI-Spam-Rules: 5 Rules triggered GME_TWTRE=0.1, EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_PASS=0, RV5990=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5990> : inlines <5780> : streams <1739994> : uri <2404048> X-AnalysisOut: [v=2.2 cv=U+7iNaju c=1 sm=1 tr=0 a=8LLPK8U+aGQ6qN8QlyMYtQ==] X-AnalysisOut: [:117 a=8LLPK8U+aGQ6qN8QlyMYtQ==:17 a=AzvcPWV-tVgA:10 a=eg3] X-AnalysisOut: [YyTvif37fV1XIJeMA:9 a=pILNOxqGKmIA:10 a=YykwNrLUJTV18pFtQO] X-AnalysisOut: [0A:9 a=CdiWusdWvyIA:10] X-Spam: [F=0.5000000000; CM=0.500; MH=0.500(2017040408); S=0.251(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [42.127.236.175] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --Apple-Mail=_4D77D36A-9F2E-4404-BC69-20E9209E6436 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=windows-1252 I agree. Although it is inferred in (emacs) Sending Patches, I tried to change two things at the same time. I attach a patch that does not modify auto-hscroll-mode. --Apple-Mail=_4D77D36A-9F2E-4404-BC69-20E9209E6436 Content-Disposition: attachment; filename=diff-mwheel-2.patch Content-Type: application/octet-stream; name="diff-mwheel-2.patch" Content-Transfer-Encoding: 7bit --- /Applications/MacPorts/Emacs-25.1.app/Contents/Resources/lisp/mwheel.el 2017-04-03 16:28:52.000000000 +0900 +++ mwheel.el 2017-04-05 09:53:35.000000000 +0900 @@ -187,8 +187,8 @@ (defun mwheel-scroll (event) "Scroll up or down according to the EVENT. -This should be bound only to mouse buttons 4 and 5 on non-Windows -systems." +This should be bound only to mouse buttons 4, 5, 6, and 7 on +non-Windows systems." (interactive (list last-input-event)) (let* ((curwin (if mouse-wheel-follow-mouse (prog1 @@ -231,6 +231,16 @@ (condition-case nil (funcall mwheel-scroll-up-function amt) ;; Make sure we do indeed scroll to the end of the buffer. (end-of-buffer (while t (funcall mwheel-scroll-up-function))))) + ((eq button mouse-wheel-left-event) ; for tilt scroll + (when mwheel-tilt-scroll-p + (funcall (if mwheel-flip-direction + mwheel-scroll-right-function + mwheel-scroll-left-function) amt))) + ((eq button mouse-wheel-right-event) ; for tilt scroll + (when mwheel-tilt-scroll-p + (funcall (if mwheel-flip-direction + mwheel-scroll-left-function + mwheel-scroll-right-function) amt))) (t (error "Bad binding in mwheel-scroll")))) (if curwin (select-window curwin))) ;; If there is a temporarily active region, deactivate it if @@ -276,7 +286,7 @@ (global-unset-key key)))) ;; Setup bindings as needed. (when mouse-wheel-mode - (dolist (event (list mouse-wheel-down-event mouse-wheel-up-event)) + (dolist (event (list mouse-wheel-down-event mouse-wheel-up-event mouse-wheel-right-event mouse-wheel-left-event)) (dolist (key (mapcar (lambda (amt) `[(,@(if (consp amt) (car amt)) ,event)]) mouse-wheel-scroll-amount)) (global-set-key key 'mwheel-scroll) @@ -288,6 +298,46 @@ "Enable mouse wheel support." (mouse-wheel-mode (if uninstall -1 1))) + +;;; +;;; For tilt-scroll +;;; +(defcustom mwheel-tilt-scroll-p nil + "Enable scroll using tilting mouse wheel." + :group 'mouse + :type 'boolean) + +(defcustom mwheel-flip-direction nil + "Swap direction of 'wheel-right and 'wheel-left." + :group 'mouse + :type 'boolean) + +(defcustom mwheel-scroll-left-function 'scroll-left + "Function that does the job of scrolling left." + :group 'mouse + :type 'function) + +(defcustom mwheel-scroll-right-function 'scroll-right + "Function that does the job of scrolling right." + :group 'mouse + :type 'function) + +(defcustom mouse-wheel-left-event + (if (or (featurep 'w32-win) (featurep 'ns-win)) + 'wheel-left + (intern "mouse-6")) + "Event used for scrolling left." + :group 'mouse + :type 'symbol) + +(defcustom mouse-wheel-right-event + (if (or (featurep 'w32-win) (featurep 'ns-win)) + 'wheel-right + (intern "mouse-7")) + "Event used for scrolling right." + :group 'mouse + :type 'symbol) + (provide 'mwheel) ;;; mwheel.el ends here --Apple-Mail=_4D77D36A-9F2E-4404-BC69-20E9209E6436-- From unknown Mon Jun 23 02:23:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26347: patch for mwheel.el Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Apr 2017 09:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26347 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Tak Kunihiro Cc: 26347@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 26347-submit@debbugs.gnu.org id=B26347.149190402927762 (code B ref 26347); Tue, 11 Apr 2017 09:48:01 +0000 Received: (at 26347) by debbugs.gnu.org; 11 Apr 2017 09:47:09 +0000 Received: from localhost ([127.0.0.1]:41990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxsOD-0007Dh-27 for submit@debbugs.gnu.org; Tue, 11 Apr 2017 05:47:09 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxsOB-0007DU-J5 for 26347@debbugs.gnu.org; Tue, 11 Apr 2017 05:47:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cxsO3-0002Bl-8a for 26347@debbugs.gnu.org; Tue, 11 Apr 2017 05:47:02 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:52815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxsO3-0002Bh-5Q; Tue, 11 Apr 2017 05:46:59 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4937 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cxsO2-0005pJ-B8; Tue, 11 Apr 2017 05:46:58 -0400 Date: Tue, 11 Apr 2017 12:47:13 +0300 Message-Id: <83zifnjmxq.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <54B770D7-510E-49AE-BBCC-DE55B9D91B85@misasa.okayama-u.ac.jp> (message from Tak Kunihiro on Wed, 5 Apr 2017 12:35:24 +0900) References: <83mvbxpmdb.fsf@gnu.org> <7CB47036-03AE-4C5B-9E14-3D84A6C4C757@misasa.okayama-u.ac.jp> <592025CA-53C7-4443-97F6-114A79D7A43F@misasa.okayama-u.ac.jp> <20170404.203505.488305127.tkk@misasa.okayama-u.ac.jp> <83bmscp7h9.fsf@gnu.org> <83shlnoa14.fsf@gnu.org> <54B770D7-510E-49AE-BBCC-DE55B9D91B85@misasa.okayama-u.ac.jp> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Tak Kunihiro > Date: Wed, 5 Apr 2017 12:35:24 +0900 > Cc: Kunihiro Tak , > 26347@debbugs.gnu.org > > I attach a patch that does not modify auto-hscroll-mode. Thanks. Please add: . ChangeLog-style commit log message (see CONTRIBUTE for some guidance) . a NEWS entry about the new feature and its user-visible aspects . optionally, addition to the user manual describing this With those additions, I will push this to the master branch. From unknown Mon Jun 23 02:23:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#26347: patch for mwheel.el Resent-From: Tak Kunihiro Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Apr 2017 23:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26347 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: eliz@gnu.org Cc: tkk@misasa.okayama-u.ac.jp, 26347@debbugs.gnu.org Received: via spool by 26347-submit@debbugs.gnu.org id=B26347.14919550135194 (code B ref 26347); Tue, 11 Apr 2017 23:57:02 +0000 Received: (at 26347) by debbugs.gnu.org; 11 Apr 2017 23:56:53 +0000 Received: from localhost ([127.0.0.1]:43452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cy5eX-0001Li-BY for submit@debbugs.gnu.org; Tue, 11 Apr 2017 19:56:53 -0400 Received: from mxl065v67.mxlogic.net ([208.81.65.67]:39766 helo=s14p02o144.mxlogic.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cy5eU-0001LZ-Um for 26347@debbugs.gnu.org; Tue, 11 Apr 2017 19:56:52 -0400 Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s14p02o144.mxlogic.net(mxl_mta-8.5.0-1675) over TLS secured channel with ESMTP id c3d6de85.0.434729.00-374.914896.s14p02o144.mxlogic.net (envelope-from ); Tue, 11 Apr 2017 17:56:45 -0600 (MDT) X-MXL-Hash: 58ed6d3d411d5a00-925df61b1432c8852cb69c93cbf2c82b5745d97e Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 4939_06f0_4ec696d9_d6e6_48f6_9e6d_bdadba9546f3; Wed, 12 Apr 2017 08:56:39 +0900 Received: from localhost (unknown [172.24.1.79]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id EFEAE4C0B16; Wed, 12 Apr 2017 08:56:39 +0900 (JST) Date: Wed, 12 Apr 2017 08:56:38 +0900 (JST) Message-Id: <20170412.085638.30144618.tkk@misasa.okayama-u.ac.jp> From: Tak Kunihiro In-Reply-To: <83zifnjmxq.fsf@gnu.org> References: <83shlnoa14.fsf@gnu.org> <54B770D7-510E-49AE-BBCC-DE55B9D91B85@misasa.okayama-u.ac.jp> <83zifnjmxq.fsf@gnu.org> X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 4 Rules triggered EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_PASS=0, RV5996=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5996> : inlines <5804> : streams <1740789> : uri <2408021> X-AnalysisOut: [v=2.2 cv=MPYQoIRl c=1 sm=1 tr=0 a=8LLPK8U+aGQ6qN8QlyMYtQ==] X-AnalysisOut: [:117 a=8LLPK8U+aGQ6qN8QlyMYtQ==:17 a=kj9zAlcOel0A:10 a=Azv] X-AnalysisOut: [cPWV-tVgA:10 a=lpm-l1lIlndHeon4IzIA:9 a=CjuIK1q_8ugA:10] X-Spam: [F=0.5000000000; CM=0.500; MH=0.500(2017041119); S=0.216(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [42.127.236.175] X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Please revise words and phrases as you wish. On info revision, I also put a recipe to scroll less. Please discard the part if that should be done by different process. # ChangeLog Support scrolling by tiling wheel Scroll right and left using wheel-right and wheel-left; This revision also makes use of touchpad and trackpad (Bug#26347). * doc/emacs/frames.texi (Mouse Commands): Document the change and recipe of scroll less * lisp/mwheel.el (mwheel-scroll): Respond to wheel-right and wheel-left * lisp/mwheel.el (mwheel-tilt-scroll-p): Enable tilt scrolling * lisp/mwheel.el (mwheel-flip-direction): Flip scrolling direction * lisp/mwheel.el (mwheel-scroll-left-function): Function to be called by wheel-left * lisp/mwheel.el (mwheel-scroll-right-function): Function to be called by wheel-right * lisp/mwheel.el (mouse-wheel-left-event): Event that calls wheel-left * lisp/mwheel.el (mouse-wheel-right-event): Event that calls wheel-right # NEWS ** Emacs can scroll horizontally using mouse, touchpad, and trackbar. You can start scrolling by customizing `mwheel-tilt-scroll-p'. When direction of scroll is opposite, customize `mwheel-flip-direction'. # Info --- doc/emacs/frames.texi 2017-04-12 08:09:52.565691400 +0900 +++ doc/emacs/frames-b.texi 2017-04-12 08:16:45.075204400 +0900 @@ -206,6 +206,22 @@ @code{mouse-wheel-progressive-speed} determines whether the scroll speed is linked to how fast you move the wheel. +Emacs also supports horizontal scrolling by tilting ``wheel''. The +variables @code{mwheel-tilt-scroll-p} turns the feature on. When +direction is opposite as you wish, turn the variable +@code{mwheel-flip-direction} on. + +Occasionally scrolling by a ``wheel'' is accelerated by system. In +such case, default configuration may scroll too fast. If so, for +example, you can add the following lines to your init file +(@pxref{Init File}) to scroll less. + +@example +(setq mouse-wheel-scroll-amount '(1 ((shift) . 5) ((control)))) +(setq mouse-wheel-progressive-speed nil) +@end example + @node Word and Line Mouse @section Mouse Commands for Words and Lines From unknown Mon Jun 23 02:23:18 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Tak Kunihiro Subject: bug#26347: closed (Re: bug#26347: patch for mwheel.el) Message-ID: References: <83d1chkatv.fsf@gnu.org> <338AA78D-144B-4857-AFE7-97E624DD85C4@misasa.okayama-u.ac.jp> X-Gnu-PR-Message: they-closed 26347 X-Gnu-PR-Package: emacs Reply-To: 26347@debbugs.gnu.org Date: Wed, 12 Apr 2017 13:36:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1492004162-31453-1" This is a multi-part message in MIME format... ------------=_1492004162-31453-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #26347: patch for mwheel.el which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 26347@debbugs.gnu.org. --=20 26347: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D26347 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1492004162-31453-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 26347-done) by debbugs.gnu.org; 12 Apr 2017 13:35:35 +0000 Received: from localhost ([127.0.0.1]:43953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cyIQo-0008Ac-Un for submit@debbugs.gnu.org; Wed, 12 Apr 2017 09:35:35 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cyIQn-0008AO-LX for 26347-done@debbugs.gnu.org; Wed, 12 Apr 2017 09:35:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cyIQc-0007Af-Hf for 26347-done@debbugs.gnu.org; Wed, 12 Apr 2017 09:35:28 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cyIQc-0007Ab-F2; Wed, 12 Apr 2017 09:35:22 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3923 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cyIQb-0005JH-LB; Wed, 12 Apr 2017 09:35:22 -0400 Date: Wed, 12 Apr 2017 16:35:40 +0300 Message-Id: <83d1chkatv.fsf@gnu.org> From: Eli Zaretskii To: Tak Kunihiro In-reply-to: <20170412.085638.30144618.tkk@misasa.okayama-u.ac.jp> (message from Tak Kunihiro on Wed, 12 Apr 2017 08:56:38 +0900 (JST)) Subject: Re: bug#26347: patch for mwheel.el References: <83shlnoa14.fsf@gnu.org> <54B770D7-510E-49AE-BBCC-DE55B9D91B85@misasa.okayama-u.ac.jp> <83zifnjmxq.fsf@gnu.org> <20170412.085638.30144618.tkk@misasa.okayama-u.ac.jp> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 26347-done Cc: 26347-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > Date: Wed, 12 Apr 2017 08:56:38 +0900 (JST) > Cc: 26347@debbugs.gnu.org, tkk@misasa.okayama-u.ac.jp > From: Tak Kunihiro > > Please revise words and phrases as you wish. Thanks, pushed, and I'm marking the bug done. See below for some comments for your future contributions. > On info revision, I also put a recipe to scroll less. Please > discard the part if that should be done by different process. Done. This is an unrelated change. > # ChangeLog > > Support scrolling by tiling wheel > > Scroll right and left using wheel-right and wheel-left; This revision > also makes use of touchpad and trackpad (Bug#26347). This should be a single line no longer than 70 characters. Additional lines can some after that, separated from the summary line by a blank line. > * doc/emacs/frames.texi (Mouse Commands): Document the change and recipe of scroll less This should end in a period, and be at most 70 characters. Please use "C-x 4 a" to format the message correctly. > * lisp/mwheel.el (mwheel-scroll): Respond to wheel-right and wheel-left > * lisp/mwheel.el (mwheel-tilt-scroll-p): Enable tilt scrolling Log entries pertaining to the same source file should state the file only once, like this: * lisp/mwheel.el (mwheel-scroll): Respond to wheel-right and wheel-left. (wheel-tilt-scroll-p): Enable tilt scrolling. > # NEWS > > ** Emacs can scroll horizontally using mouse, touchpad, and trackbar. > You can start scrolling by customizing `mwheel-tilt-scroll-p'. When > direction of scroll is opposite, customize `mwheel-flip-direction'. We use quoting 'like this' in NEWS. > --- doc/emacs/frames.texi 2017-04-12 08:09:52.565691400 +0900 > +++ doc/emacs/frames-b.texi 2017-04-12 08:16:45.075204400 +0900 It is best to send patches by invoking "git diff" or "git format-patch". > +Emacs also supports horizontal scrolling by tilting ``wheel''. The There's no need to take ``wheel'' in quotes more than once, when it is first mentioned. (It is quoted, because it's not a real wheel.) You can see that the existing text only quotes it once. > +variables @code{mwheel-tilt-scroll-p} turns the feature on. When > +direction is opposite as you wish, turn the variable > +@code{mwheel-flip-direction} on. User variables should be indexed by using @vindex. > +(defcustom mwheel-tilt-scroll-p nil > + "Enable scroll using tilting mouse wheel." > + :group 'mouse > + :type 'boolean) Defcustoms should have the :version tag stating the Emacs release where they were first introduced, in this case 26.1. I also made some of your defcustoms defvars, as I think there are too many customizable variables in the patch. Thanks again for working on this. ------------=_1492004162-31453-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 3 Apr 2017 11:36:24 +0000 Received: from localhost ([127.0.0.1]:58159 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cv0HW-0005LZ-Av for submit@debbugs.gnu.org; Mon, 03 Apr 2017 07:36:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cv0HT-0005LH-Se for submit@debbugs.gnu.org; Mon, 03 Apr 2017 07:36:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cv0HM-0007gD-Ub for submit@debbugs.gnu.org; Mon, 03 Apr 2017 07:36:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:37803) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cv0HM-0007g3-RR for submit@debbugs.gnu.org; Mon, 03 Apr 2017 07:36:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36719) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cv0HL-000741-2c for bug-gnu-emacs@gnu.org; Mon, 03 Apr 2017 07:36:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cv0HH-0007bH-Ln for bug-gnu-emacs@gnu.org; Mon, 03 Apr 2017 07:36:11 -0400 Received: from mxl069v64.mxlogic.net ([208.81.69.64]:65056 helo=s18p02o141.mxlogic.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cv0HH-0007Wn-1r for bug-gnu-emacs@gnu.org; Mon, 03 Apr 2017 07:36:07 -0400 Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s18p02o141.mxlogic.net(mxl_mta-8.5.0-1675) with ESMTP id 6a332e85.7f2f7bfff700.144267.00-544.316603.s18p02o141.mxlogic.net (envelope-from ); Mon, 03 Apr 2017 05:36:06 -0600 (MDT) X-MXL-Hash: 58e233a64a3c7e09-7496bb2b8d4689fd2e6dcda0ff8bac74d9244da8 Received: from unknown [42.127.236.175] (EHLO mlsec.cc.okayama-u.ac.jp) by s18p02o141.mxlogic.net(mxl_mta-8.5.0-1675) over TLS secured channel with ESMTP id 40e22e85.0.144053.00-387.316108.s18p02o141.mxlogic.net (envelope-from ); Mon, 03 Apr 2017 05:12:05 -0600 (MDT) X-MXL-Hash: 58e22e05276ff8f0-a2b7c0e659140980da3a60d63696420110b20bba Received: from alml002.ouadm.okayama-u.ac.jp (unknown [42.127.236.168]) by mlsec.cc.okayama-u.ac.jp with smtp id 6a7b_88ce_e2ea21ac_eead_4d70_b356_b312ef68b87a; Mon, 03 Apr 2017 20:12:01 +0900 Received: from [192.168.1.50] (vesta.misasa.okayama-u.ac.jp [150.46.48.154]) by alml002.ouadm.okayama-u.ac.jp (Postfix) with ESMTPSA id E1AD94C0A40; Mon, 3 Apr 2017 20:12:01 +0900 (JST) From: Tak Kunihiro Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: patch for mwheel.el Date: Mon, 3 Apr 2017 20:11:45 +0900 Message-Id: <338AA78D-144B-4857-AFE7-97E624DD85C4@misasa.okayama-u.ac.jp> To: bug-gnu-emacs@gnu.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) X-Mailer: Apple Mail (2.1878.6) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 11 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 4 Rules triggered EDT_SA_AU_PASS=0, EDT_SA_DN_PASS=0, EDT_SA_TS_PASS=0, RV5988=0 X-NAI-Spam-Version: 2.3.0.9418 : core <5988> : inlines <5770> : streams <1739753> : uri <2403022> X-AnalysisOut: [v=2.2 cv=Iev3YSia c=1 sm=1 tr=0 a=8LLPK8U+aGQ6qN8QlyMYtQ==] X-AnalysisOut: [:117 a=8LLPK8U+aGQ6qN8QlyMYtQ==:17 a=N659UExz7-8A:10 a=Azv] X-AnalysisOut: [cPWV-tVgA:10 a=ukymv0HeN-OhJwg9w00A:9 a=pILNOxqGKmIA:10] X-Spam: [F=0.5100000000; CM=0.500; MH=0.510(2017040306); S=0.200(2015072901)] X-MAIL-FROM: X-SOURCE-IP: [42.127.236.175] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.4 (----) X-Debbugs-Envelope-To: submit Cc: Kunihiro Tak X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.4 (----) This patch tries to extend a global minor mode `mouse-wheel-mode' and makes Emacs scroll both vertically and horizontally by swiping `touchpad' or tilting `trackbar=92. To make the tilt scroll work, add a following line to init file. (setq mwheel-tilt-scroll-p t) How it is implemented is described below. To scroll horizontally, a function `mwheel-scroll' is extended. An event `wheel-right' or `wheel-left' calls `scroll-right' or `scroll-right', respectively. During not only horizontal scroll but also vertical scroll, `auto-hscroll-mode' should be disabled by following three aspects. (1) It should be off during horizontal scroll. If it is on, scope jumps randomly when point is at the edge. Also, since horizontal scroll does not move point, there will be inconsistency between point and scope, and the inconsistency will result in unexpected shift of the scope. (2) It should be off during vertical scroll. When a buffer is with short and long alternative lines, scope jumps from the end of long line to the end of short line. Sudden shift of the scope makes edition of a wide document hard. (3) During horizontal scroll, you may scroll a little in vertical direction without intention. The scrolling should be tolerance against such perturbation. This is somewhat similar to (2). After scroll, you want to set `auto-hscroll-mode' t back again otherwise too inconvenient for edition. Approach of this patch is to turn on another minor-mode `mwheel--scroll-mode' with `auto-hscroll-mode' nil at the beginning of `mwheel-scroll'. The minor mode is turned off upon any key inputs that move point. This is my first to time to send a patch. I follow `(emacs) Sending Patches=92. I hope this is helpful. --- = /Applications/MacPorts/Emacs-25.1.app/Contents/Resources/lisp/mwheel.el = 2017-04-03 16:28:52.000000000 +0900 +++ mwheel.el 2017-04-03 16:20:16.000000000 +0900 @@ -187,8 +187,8 @@ (defun mwheel-scroll (event) "Scroll up or down according to the EVENT. -This should be bound only to mouse buttons 4 and 5 on non-Windows -systems." +This should be bound only to mouse buttons 4, 5, 6, and 7 on +non-Windows systems." (interactive (list last-input-event)) (let* ((curwin (if mouse-wheel-follow-mouse (prog1 @@ -210,6 +210,9 @@ ;; When the double-mouse-N comes in, a mouse-N has been executed = already, ;; So by adding things up we get a squaring up (1, 3, 6, 10, 15, = ...). (setq amt (* amt (event-click-count event)))) + ;; Turn on minor-mode with auto-hscroll-mode nil for tilt scroll + (if mwheel-tilt-scroll-p + (with-current-buffer buffer (mwheel--scroll-mode 1))) (unwind-protect (let ((button (mwheel-event-button event))) (cond ((eq button mouse-wheel-down-event) @@ -231,6 +234,16 @@ (condition-case nil (funcall mwheel-scroll-up-function = amt) ;; Make sure we do indeed scroll to the end of the = buffer. (end-of-buffer (while t (funcall = mwheel-scroll-up-function))))) + ((eq button mouse-wheel-left-event) ; for tilt scroll + (when mwheel-tilt-scroll-p + (funcall (if mwheel-flip-direction + mwheel-scroll-right-function + mwheel-scroll-left-function) amt))) + ((eq button mouse-wheel-right-event) ; for tilt scroll + (when mwheel-tilt-scroll-p + (funcall (if mwheel-flip-direction + mwheel-scroll-left-function + mwheel-scroll-right-function) amt))) (t (error "Bad binding in mwheel-scroll")))) (if curwin (select-window curwin))) ;; If there is a temporarily active region, deactivate it if @@ -276,7 +289,7 @@ (global-unset-key key)))) ;; Setup bindings as needed. (when mouse-wheel-mode - (dolist (event (list mouse-wheel-down-event mouse-wheel-up-event)) + (dolist (event (list mouse-wheel-down-event mouse-wheel-up-event = mouse-wheel-right-event mouse-wheel-left-event)) (dolist (key (mapcar (lambda (amt) `[(,@(if (consp amt) (car = amt)) ,event)]) mouse-wheel-scroll-amount)) (global-set-key key 'mwheel-scroll) @@ -288,6 +301,92 @@ "Enable mouse wheel support." (mouse-wheel-mode (if uninstall -1 1))) + +;;; +;;; For tilt-scroll +;;; +(defcustom mwheel-tilt-scroll-p nil + "Enable tilt scroll and disable `auto-hscroll-mode' during scroll." + :group 'mouse + :type 'boolean) + +(defcustom mwheel-flip-direction nil + "Swap direction of 'wheel-right and 'wheel-left." + :group 'mouse + :type 'boolean) + +(defcustom mwheel-scroll-left-function 'scroll-left + "Function that does the job of scrolling left." + :group 'mouse + :type 'function) + +(defcustom mwheel-scroll-right-function 'scroll-right + "Function that does the job of scrolling right." + :group 'mouse + :type 'function) + +(defcustom mouse-wheel-left-event + (if (or (featurep 'w32-win) (featurep 'ns-win)) + 'wheel-left + (intern "mouse-6")) + "Event used for scrolling left." + :group 'mouse + :type 'symbol) + +(defcustom mouse-wheel-right-event + (if (or (featurep 'w32-win) (featurep 'ns-win)) + 'wheel-right + (intern "mouse-7")) + "Event used for scrolling right." + :group 'mouse + :type 'symbol) + +(defvar mouse--cursor-type cursor-type + "Cursor used by user. This variable is used internally to + restore original `cursor-type'.") + +(defun mwheel-disable--scroll-mode () + "Disable minor mode `mwheel--scroll-mode' to enable +`auto-hscroll-mode' back. Then invoke command that is bound to +the original key." + (interactive) + (mwheel--scroll-mode 0) ; turn off minor-mode + (call-interactively (key-binding (this-command-keys)))) + +(define-minor-mode mwheel--scroll-mode + "A minor-mode with `auto-hscroll-mode' off. This minor mode is +used internally." + :init-value nil + :keymap (let ((map (make-sparse-keymap))) + (define-key map [remap keyboard-quit] = 'mwheel-disable--scroll-mode) + (define-key map [remap mouse-drag-region] = 'mwheel-disable--scroll-mode) + (define-key map [remap right-char] = 'mwheel-disable--scroll-mode) + (define-key map [remap forward-char] = 'mwheel-disable--scroll-mode) + (define-key map [remap forward-word] = 'mwheel-disable--scroll-mode) + (define-key map [remap forward-sentence] = 'mwheel-disable--scroll-mode) + (define-key map [remap left-char] = 'mwheel-disable--scroll-mode) + (define-key map [remap backward-char] = 'mwheel-disable--scroll-mode) + (define-key map [remap backward-word] = 'mwheel-disable--scroll-mode) + (define-key map [remap backward-sentence] = 'mwheel-disable--scroll-mode) + (define-key map [remap move-beginning-of-line] = 'mwheel-disable--scroll-mode) + (define-key map [remap move-end-of-line] = 'mwheel-disable--scroll-mode) + (define-key map [remap next-line] = 'mwheel-disable--scroll-mode) + (define-key map [remap scroll-up-command] = 'mwheel-disable--scroll-mode) + (define-key map [remap previous-line] = 'mwheel-disable--scroll-mode) + (define-key map [remap scroll-down-command] = 'mwheel-disable--scroll-mode) + (define-key map [remap beginning-of-buffer] = 'mwheel-disable--scroll-mode) + (define-key map [remap end-of-buffer] = 'mwheel-disable--scroll-mode) + ;; listed as much as I can ... map all but = (where-is-internal 'mwheel-scroll) + map) + :group 'mouse + + (if mwheel--scroll-mode + (progn + (setq-local cursor-type 'hollow) + (setq-local auto-hscroll-mode nil)) + (setq-local cursor-type mouse--cursor-type) + (setq-local auto-hscroll-mode t))) + (provide 'mwheel) ;;; mwheel.el ends here ------------=_1492004162-31453-1--