Skip to content

Instantly share code, notes, and snippets.

@Wilfred
Created June 2, 2017 16:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wilfred/16432886aacba566a7bb2e9ae283a923 to your computer and use it in GitHub Desktop.
Save Wilfred/16432886aacba566a7bb2e9ae283a923 to your computer and use it in GitHub Desktop.
Confusing Emacs argument parsing with cl-defun
(cl-defun wh/foo (arg1 arg2 &key (kwarg1 t))
(list arg1 arg2 kwarg1))
;; We've forgotten arg2, but we get the error:
;; (error "Keyword argument 2 not one of (:kwarg1)")
(wh/foo 1 :kwarg1 2)
;; Instead, it would be clearer to say
;; "Expected a keyword argument (one of (:kwargs1)) but got 1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment