bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20204: 24.4; (smie-backward-sexp-command) throws (wrong-type-argumen


From: Stefan Monnier
Subject: bug#20204: 24.4; (smie-backward-sexp-command) throws (wrong-type-argument number-or-marker-p nil)
Date: Thu, 26 Mar 2015 09:37:41 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

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))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]