From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tak Kunihiro Newsgroups: gmane.emacs.bugs Subject: bug#26347: patch for mwheel.el 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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_4D77D36A-9F2E-4404-BC69-20E9209E6436" X-Trace: blaine.gmane.org 1491363439 2609 195.159.176.226 (5 Apr 2017 03:37:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 5 Apr 2017 03:37:19 +0000 (UTC) Cc: Kunihiro Tak , 26347@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 05 05:37:15 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cvbkp-0007s1-ET for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Apr 2017 05:37:07 +0200 Original-Received: from localhost ([::1]:38592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvbkv-00083X-9t for geb-bug-gnu-emacs@m.gmane.org; Tue, 04 Apr 2017 23:37:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57114) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cvbkp-00083L-Mj for bug-gnu-emacs@gnu.org; Tue, 04 Apr 2017 23:37:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cvbkk-00084t-PQ for bug-gnu-emacs@gnu.org; Tue, 04 Apr 2017 23:37:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34884) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cvbkk-00084o-Ln for bug-gnu-emacs@gnu.org; Tue, 04 Apr 2017 23:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cvbkk-0005EA-CV for bug-gnu-emacs@gnu.org; Tue, 04 Apr 2017 23:37:02 -0400 X-Loop: help-debbugs@gnu.org 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: Original-Received: via spool by 26347-submit@debbugs.gnu.org id=B26347.149136336320019 (code B ref 26347); Wed, 05 Apr 2017 03:37:02 +0000 Original-Received: (at 26347) by debbugs.gnu.org; 5 Apr 2017 03:36:03 +0000 Original-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 Original-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 Original-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 Original-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 Original-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) In-Reply-To: <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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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" Xref: news.gmane.org gmane.emacs.bugs:131283 Archived-At: --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--