Subject: bug#11560: closed (Re: bug#11560: 24.0.97; [PATCH] forward-same-syntax: wrong-type-argument number-or-marker-p nil)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 26 May 2012 02:43:03 +0000

Your bug report

#11560: 24.0.97; [PATCH] forward-same-syntax: wrong-type-argument number-or-marker-p nil

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
11560: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11560
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#11560: 24.0.97; [PATCH] forward-same-syntax: wrong-type-argument number-or-marker-p nil
From: Glenn Morris <[email-masked]>
To: [email-masked]
Date: Fri, 25 May 2012 22:41:07 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 24.2

Thanks; applied.

Subject: 24.0.97; [PATCH] forward-same-syntax: wrong-type-argument number-or-marker-p nil
From: "Aaron S. Hawley" <[email-masked]>
To: bug-gnu-emacs <[email-masked]>
Date: Fri, 25 May 2012 15:40:13 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

[I'm using a pretest, but this isn't a regression.  Applying the fix
in 24.2 is fine with me.]

Reproduce:

M-x load-library thingatpt
M-: (forward-same-syntax)

gives Lisp error: (wrong-type-argument number-or-marker-p nil)

Thanks for Emacs,
/a

2012-05-25  Aaron S. Hawley  <[email-masked]>

        * thingatpt.el (forward-same-syntax): Calling as a function in
        Lisp with no argument gives error "wrong-type-argument
        number-or-marker-p nil" from `while'.

--- thingatpt.el	2012-04-07 23:03:02.000000000 -0400
+++ thingatpt.el	2012-05-25 12:33:28.817991100 -0400
@@ -455,8 +455,9 @@
 (defun forward-same-syntax (&optional arg)
  "Move point past all characters with the same syntax class.
 With prefix argument ARG, do it ARG times if positive, or move
 backwards ARG times if negative."
   (interactive "p")
+  (or arg (setq arg 1))
   (while (< arg 0)
     (skip-syntax-backward
      (char-to-string (char-syntax (char-before))))