From 698a00393dbb119a56e70ee6da71993a6b2901f3 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 21 Aug 2019 03:38:49 +0200 Subject: [PATCH] Bind changing font size to C-mouse-4 and C-mouse-5 * lisp/mouse.el ([C-mouse-4], [C-mouse-5]): Bind to text-scale-increase and text-scale-decrease. (Bug#28182) * lisp/mwheel.el (mouse-wheel-scroll-amount): Use the meta modifier for scrolling by near full screen instead of control. * etc/NEWS: Announce it. --- etc/NEWS | 14 ++++++++++++++ lisp/mouse.el | 3 +++ lisp/mwheel.el | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 56e5fd2f83..f15fc81314 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2021,6 +2021,20 @@ valid event type. --- ** The obsolete package xesam.el (since Emacs 24) has been removed. +--- +** 'C-mouse-4' and 'C-mouse-5' will now decrease or increase the font size. +This commonly corresponds to holding the control key and using the +scroll wheel available on many mice. + +Previously, the control key modifier was used to scroll up or down by +an amount which was close to near a full screen. This functionality +is now instead available by holding down the meta modifier key. You +can get the old functionality back by adding the following to your +Emacs init file: + +(customize-set-variable 'mouse-wheel-scroll-amount + '(5 ((shift) . 1) ((control) . nil))) + * Lisp Changes in Emacs 27.1 diff --git a/lisp/mouse.el b/lisp/mouse.el index e947e16d47..4b1afe261d 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -2728,6 +2728,9 @@ function-key-map (mouse-menu-bar-map) (mouse-menu-major-mode-map))))) +(global-set-key [C-mouse-4] 'text-scale-increase) +(global-set-key [C-mouse-5] 'text-scale-decrease) + ;; Binding mouse-1 to mouse-select-window when on mode-, header-, or ;; vertical-line prevents Emacs from signaling an error when the mouse ;; button is released after dragging these lines, on non-toolkit diff --git a/lisp/mwheel.el b/lisp/mwheel.el index dfea55374b..d75c1d88c1 100644 --- a/lisp/mwheel.el +++ b/lisp/mwheel.el @@ -84,7 +84,7 @@ mouse-wheel-inhibit-click-time :group 'mouse :type 'number) -(defcustom mouse-wheel-scroll-amount '(5 ((shift) . 1) ((control) . nil)) +(defcustom mouse-wheel-scroll-amount '(5 ((shift) . 1) ((meta) . nil)) "Amount to scroll windows by when spinning the mouse wheel. This is an alist mapping the modifier key to the amount to scroll when the wheel is moved with the modifier key depressed. -- 2.20.1