Skip to content

Commit 0ac3271

Browse files
author
Dan Sutton
committed
Catch wrong number of arguments in calling actions
1 parent 5253e33 commit 0ac3271

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

resize-window.el

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,16 @@ If SCALED, then call action with the resize-window-capital-argument."
207207
;; (char function description)
208208
(let ((action (resize-window--choice-lambda choice))
209209
(description (resize-window--choice-documentation choice)))
210-
(if scaled
211-
(funcall action (resize-window-uppercase-argument))
212-
(funcall action))
213210
(unless (equal (resize-window--choice-keybinding choice) ??)
214-
(resize-window--notify "%s" description))))
211+
(resize-window--notify "%s" description))
212+
(condition-case nil
213+
(if scaled
214+
(funcall action (resize-window-uppercase-argument))
215+
(funcall action))
216+
217+
(wrong-number-of-arguments
218+
(message "Invalid arity in function for %s"
219+
(char-to-string (resize-window--choice-keybinding choice)))))))
215220

216221
;;;###autoload
217222
(defun resize-window ()

0 commit comments

Comments
 (0)