Subject: bug#20204: 24.4; (smie-backward-sexp-command) throws (wrong-type-argument number-or-marker-p nil)

From: Stefan Monnier <[email-masked]>
Date: Thu, 26 Mar 2015 09:37:41 -0400

Version: 24.5

> This is due to `smie-backward-sexp-command' not checking whether `n'
> is `nil' before passing `(- n)' to `smie-forward-sexp-command'.

Indeed.  I installed the patch below which just doesn't let you skip
the argument.

        Stefan

--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -834,12 +834,12 @@ Possible return values:
 
 ;;; Miscellaneous commands using the precedence parser.
 
-(defun smie-backward-sexp-command (&optional n)
+(defun smie-backward-sexp-command (n)
   "Move backward through N logical elements."
   (interactive "^p")
   (smie-forward-sexp-command (- n)))
 
-(defun smie-forward-sexp-command (&optional n)
+(defun smie-forward-sexp-command (n)
   "Move forward through N logical elements."
   (interactive "^p")
   (let ((forw (> n 0))