From: Lars Ingebrigtsen Date: Wed, 25 Nov 2020 05:29:10 +0000 (+0100) Subject: Move code in face-remap.el to avoid a compilation warning X-Git-Tag: emacs-28.0.90~5034 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d7a580c7eb189c0b0daf131f9a1f3c8c7fe5f196;p=emacs.git 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’ --- 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