summaryrefslogtreecommitdiff
path: root/lisp/face-remap.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-11-25 06:29:10 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2020-11-25 06:29:10 +0100
commitd7a580c7eb189c0b0daf131f9a1f3c8c7fe5f196 (patch)
tree8efa42ff84f0e4d788f793b8a99660c6613c3625 /lisp/face-remap.el
parent30c437752df0a3a9410f1249fa0f237110811af2 (diff)
downloademacs-d7a580c7eb189c0b0daf131f9a1f3c8c7fe5f196.tar.gz
Move code in face-remap.el to avoid a compilation warning
* lisp/face-remap.el (text-scale--refresh): Move code to avoid compilation warning. In text-scale--refresh: face-remap.el:241:14: Warning: reference to free variable ‘text-scale-mode’
Diffstat (limited to 'lisp/face-remap.el')
-rw-r--r--lisp/face-remap.el22
1 files changed, 11 insertions, 11 deletions
diff --git a/lisp/face-remap.el b/lisp/face-remap.el
index 9f9dddfe68e..4ccd463aff2 100644
--- a/lisp/face-remap.el
+++ b/lisp/face-remap.el
@@ -233,17 +233,6 @@ Each positive or negative step scales the default face height by this amount."
"If non-nil, text scaling may change font size of header lines too.")
(make-variable-buffer-local 'text-scale-header-line)
-(defun text-scale--refresh (symbol newval operation where)
- "Watcher for `text-scale-remap-header-line'.
-See `add-variable-watcher'."
- (when (and (eq symbol 'text-scale-remap-header-line)
- (eq operation 'set)
- text-scale-mode)
- (with-current-buffer where
- (let ((text-scale-remap-header-line newval))
- (text-scale-mode 1)))))
-(add-variable-watcher 'text-scale-remap-header-line #'text-scale--refresh)
-
(defun face-remap--clear-remappings ()
(dolist (remapping
;; This is a bit messy to stay backwards compatible.
@@ -288,6 +277,17 @@ the font size of the header line."
(face-remap--remap-face 'header-line)))
(force-window-update (current-buffer)))
+(defun text-scale--refresh (symbol newval operation where)
+ "Watcher for `text-scale-remap-header-line'.
+See `add-variable-watcher'."
+ (when (and (eq symbol 'text-scale-remap-header-line)
+ (eq operation 'set)
+ text-scale-mode)
+ (with-current-buffer where
+ (let ((text-scale-remap-header-line newval))
+ (text-scale-mode 1)))))
+(add-variable-watcher 'text-scale-remap-header-line #'text-scale--refresh)
+
(defun text-scale-min-amount ()
"Return the minimum amount of text-scaling we allow."
;; When the resulting pixel-height of characters will become smaller