Skip to content

Commit 7323f8a

Browse files
Added type check to let* capital in resize-window
Whenever the user clicks inside of an emacs window, that counts as a (read-key) and returns a seq instead of a number. When we bind `capital` in the let*, we pre-suppose that char is a number, so then we try to call + on a number and a list. This would make lisp very angry and we were stuck with a gross overlay. This commit adds a type check in the definition of `capital`. If the char entered is non-numeric, capital is defined as nil and the only other use of it, the and below, is free to interpret that as a falsy value.
1 parent 8bc6927 commit 7323f8a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

resize-window.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ to enlarge right."
192192
(while reading-characters
193193
(let* ((char (resize-window--match-alias (read-key)))
194194
(choice (assoc char resize-window-dispatch-alist))
195-
(capital (assoc (+ char 32) resize-window-dispatch-alist)))
195+
(capital (when (numberp char)
196+
(assoc (+ char 32) resize-window-dispatch-alist))))
196197
(cond
197198
(choice (resize-window--execute-action choice))
198199
((and capital (resize-window--allows-capitals capital))

0 commit comments

Comments
 (0)