Skip to content

Commit 932f80c

Browse files
authored
Merge pull request #807 from rswgnu/rsw
hycontrol-frame-zoom - Fix to check for zoom-frm-in
2 parents 61117aa + b820f5c commit 932f80c

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333

3434
2025-10-26 Bob Weiner <[email protected]>
3535

36+
* hycontrol.el (hycontrol-frame-zoom): Fix to check for an autoloaded function, 'zoom-frm-in'.
37+
(hycontrol-frame-zoom-reset): Add (require 'zoom-frm).
38+
3639
* hywiki.el (hywiki-publish-to-html): Rewrite to use standard Org html ids, not
3740
HyWiki-specific ones.
3841

hycontrol.el

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; Author: Bob Weiner
44
;;
55
;; Orig-Date: 1-Jun-16 at 15:35:36
6-
;; Last-Mod: 13-Oct-25 at 23:47:09 by Mats Lidell
6+
;; Last-Mod: 26-Oct-25 at 16:04:51 by Bob Weiner
77
;;
88
;; SPDX-License-Identifier: GPL-3.0-or-later
99
;;
@@ -845,24 +845,26 @@ the hycontrol menu."
845845

846846
(defun hycontrol-frame-zoom (increment)
847847
"Change the font size of all faces by INCREMENT.
848-
Use `global-text-scale-adjust' if it exists. If on an older Emacs that
849-
does not have it see if zoom-frm.el is available and use that."
848+
Use `global-text-scale-adjust' if it exists. If on an older Emacs without
849+
that function, use \"zoom-frm.el\" if available."
850850
(if (fboundp 'global-text-scale-adjust)
851851
(hycontrol-global-text-scale-adjust increment)
852-
(if (not (and (fboundp 'zoom-all-frames-in) (fboundp 'zoom-all-frames-out)))
853-
(hycontrol-user-error hycontrol-debug "(HyControl): Zooming requires separate \"zoom-frm.el\" Emacs Lisp library installation")
854-
(if (< 0 increment)
855-
(zoom-all-frames-in)
856-
(zoom-all-frames-out)))))
852+
(unless (fboundp 'zoom-frm-in)
853+
(hycontrol-user-error hycontrol-debug "(HyControl): Zooming requires separate \"zoom-frm.el\" Emacs Lisp library installation"))
854+
(require 'zoom-frm)
855+
(if (< 0 increment)
856+
(zoom-all-frames-in)
857+
(zoom-all-frames-out))))
857858

858859
(defun hycontrol-frame-zoom-reset ()
859860
"Reset zoom level back to default."
860861
(if (fboundp 'global-text-scale-adjust)
861862
(hycontrol-global-text-scale-adjust 0)
862-
(if (not (fboundp 'zoom-frm-unzoom))
863-
(hycontrol-user-error hycontrol-debug "(HyControl): Zooming requires separate \"zoom-frm.el\" Emacs Lisp library installation")
864-
(dolist (fr (visible-frame-list))
865-
(zoom-frm-unzoom fr)))))
863+
(unless (fboundp 'zoom-frm-in)
864+
(hycontrol-user-error hycontrol-debug "(HyControl): Zooming requires separate \"zoom-frm.el\" Emacs Lisp library installation"))
865+
(require 'zoom-frm)
866+
(dolist (fr (visible-frame-list))
867+
(zoom-frm-unzoom fr))))
866868

867869
(defun hycontrol-make-frame ()
868870
"Create a new frame with the same size and selected buffer as the selected frame.

0 commit comments

Comments
 (0)