GNU bug report logs - #48307
Feature request: provide default keybindings to change the font size in all windows

Previous Next

Package: emacs;

Reported by: Clément Pit-Claudel <cpitclaudel <at> gmail.com>

Date: Sun, 9 May 2021 07:10:02 UTC

Severity: wishlist

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Clément Pit-Claudel <cpitclaudel <at> gmail.com>
To: Gregory Heytings <gregory <at> heytings.org>
Cc: 48307 <at> debbugs.gnu.org
Subject: bug#48307: Feature request: provide default keybindings to change the font size in all windows
Date: Sun, 9 May 2021 17:36:18 -0400
On 5/9/21 4:16 PM, Gregory Heytings wrote:
>> Not all the implementations are good, and it would be very nice if such a feature were available out of the box.
>>
> 
> Would the following do what you want?
> 
> (defun global-text-scale-adjust-do (increment)
>   (set-face-attribute 'default nil :height
>               (+ (face-attribute 'default :height) increment))
>   (message "Use + and - for further adjustment")
>   (set-transient-map
>    (let ((map (make-sparse-keymap)))
>      (define-key map (kbd "+") 'global-text-scale-adjust-increase)
>      (define-key map (kbd "-") 'global-text-scale-adjust-decrease)
>      map)))
> (defun global-text-scale-adjust-increase ()
>   (interactive)
>   (global-text-scale-adjust-do +5))
> (defun global-text-scale-adjust-decrease ()
>   (interactive)
>   (global-text-scale-adjust-do -5))
> (global-set-key (kbd "C-x M-+") 'global-text-scale-adjust-increase)
> (global-set-key (kbd "C-x M--") 'global-text-scale-adjust-decrease)

Yup, probably.  The performance isn't great, but that's more or less what I have in my .emacs.




This bug report was last modified 2 years and 327 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.