all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#11560: 24.0.97; [PATCH] forward-same-syntax: wrong-type-argument number-or-marker-p nil
@ 2012-05-25 19:40 Aaron S. Hawley
  2012-05-26  2:41 ` Glenn Morris
  2012-05-26 13:24 ` Stefan Monnier
  0 siblings, 2 replies; 4+ messages in thread
From: Aaron S. Hawley @ 2012-05-25 19:40 UTC (permalink / raw
  To: 11560

[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  <aaron.s.hawley@gmail.com>

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#11560: 24.0.97; [PATCH] forward-same-syntax: wrong-type-argument number-or-marker-p nil
  2012-05-25 19:40 bug#11560: 24.0.97; [PATCH] forward-same-syntax: wrong-type-argument number-or-marker-p nil Aaron S. Hawley
@ 2012-05-26  2:41 ` Glenn Morris
  2012-05-26 13:24 ` Stefan Monnier
  1 sibling, 0 replies; 4+ messages in thread
From: Glenn Morris @ 2012-05-26  2:41 UTC (permalink / raw
  To: 11560-done

Version: 24.2

Thanks; applied.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#11560: 24.0.97; [PATCH] forward-same-syntax: wrong-type-argument number-or-marker-p nil
  2012-05-25 19:40 bug#11560: 24.0.97; [PATCH] forward-same-syntax: wrong-type-argument number-or-marker-p nil Aaron S. Hawley
  2012-05-26  2:41 ` Glenn Morris
@ 2012-05-26 13:24 ` Stefan Monnier
  2012-05-26 21:41   ` Aaron S. Hawley
  1 sibling, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2012-05-26 13:24 UTC (permalink / raw
  To: Aaron S. Hawley; +Cc: 11560

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

Actually, unless (forward-same-syntax) used to work, the better fix is
to make the argument non-optional.


        Stefan





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#11560: 24.0.97; [PATCH] forward-same-syntax: wrong-type-argument number-or-marker-p nil
  2012-05-26 13:24 ` Stefan Monnier
@ 2012-05-26 21:41   ` Aaron S. Hawley
  0 siblings, 0 replies; 4+ messages in thread
From: Aaron S. Hawley @ 2012-05-26 21:41 UTC (permalink / raw
  To: Stefan Monnier; +Cc: 11560

On 5/26/12, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>>  (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))
>
> Actually, unless (forward-same-syntax) used to work, the better fix is
> to make the argument non-optional.

I considered that, but assumed it's better to keep it consistent with
the rest of the forward-* functions in Emacs.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-05-26 21:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-25 19:40 bug#11560: 24.0.97; [PATCH] forward-same-syntax: wrong-type-argument number-or-marker-p nil Aaron S. Hawley
2012-05-26  2:41 ` Glenn Morris
2012-05-26 13:24 ` Stefan Monnier
2012-05-26 21:41   ` Aaron S. Hawley

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.