Skip to content

Commit 4c99c02

Browse files
committed
Query text-scale-mode-amount safely
1 parent f85d5c1 commit 4c99c02

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## master (unreleased)
44

5+
### Bugs fixed
6+
7+
- Inspector: avoid `Symbol's value as variable is void: text-scale-mode-amount` under certain Emacs clients.
8+
59
## 1.8.3 (2023-10-18)
610

711
### Changes

cider-inspector.el

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,11 +388,13 @@ MAX-COLL-SIZE if non nil."
388388
;; Render Inspector from Structured Values
389389
(defun cider-inspector--render-value (value)
390390
"Render VALUE."
391-
(let ((font-size (when-let ((b (get-buffer cider-inspector-buffer)))
391+
(let ((font-size (when-let* ((b (get-buffer cider-inspector-buffer))
392+
(variable 'text-scale-mode-amount)
393+
(continue (local-variable-p variable b)))
392394
;; The font size is lost between inspector 'screens',
393395
;; because on each re-rendering, we wipe everything, including the mode.
394396
;; Enabling cider-inspector-mode is the specific step that loses the font size.
395-
(buffer-local-value 'text-scale-mode-amount b))))
397+
(buffer-local-value variable b))))
396398
(cider-make-popup-buffer cider-inspector-buffer 'cider-inspector-mode 'ancillary)
397399
(cider-inspector-render cider-inspector-buffer value font-size))
398400
(cider-popup-buffer-display cider-inspector-buffer cider-inspector-auto-select-buffer)

0 commit comments

Comments
 (0)