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

Previous Next

Package: emacs;

Reported by: Clément Pit--Claudel <clement.pitclaudel <at> live.com>

Date: Thu, 26 Mar 2015 03:39:01 UTC

Severity: normal

Found in version 24.4

Fixed in version 24.5

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 20204 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Clément Pit--Claudel <clement.pitclaudel <at> live.com>
Cc: 20204 <at> debbugs.gnu.org
Subject: Re: 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
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))




This bug report was last modified 10 years and 63 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.