Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Error in gnus-delay-article and extension

0 views
Skip to first unread message

Cecil Westerhof

unread,
Dec 21, 2009, 6:01:34 PM12/21/09
to
I am working with GNUS 5.11.

When looking at gnus-delay-article I see the following statement:
(string-match
"\\([0-9][0-9][0-9]?[0-9]?\\)-\\([0-9]+\\)-\\([0-9]+\\)"
delay)

First of all should the regular expression not be (year should always be
four long):
"\\([0-9][0-9][0-9][0-9]\\)-\\([0-9]+\\)-\\([0-9]+\\)"

Secondly I have been playing a little:
(setq delay "2009-12-22")

(string-match "\\([0-9][0-9][0-9][0-9]\\)-\\([0-9]+\\)-\\([0-9]+\\)"
delay)

(match-string 1 delay)

(match-string 2 delay)

(match-string 3 delay)

(match-string 0 delay)

The string-match gives 0, so the match is found. But the first three
match-string do give nil.
And the last gives:
Debugger entered--Lisp error: (args-out-of-range "2009-12-22" 973 976)
match-string(0 "2009-12-22")
eval((match-string 0 delay))
eval-last-sexp-1(nil)
eval-last-sexp(nil)
call-interactively(eval-last-sexp)

What is happening here?

--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

Dan Christensen

unread,
Dec 21, 2009, 11:05:33 PM12/21/09
to info-gnu...@gnu.org
I'll just comment on your second question:

Cecil Westerhof <Ce...@decebal.nl> writes:

> Secondly I have been playing a little:
> (setq delay "2009-12-22")
>
> (string-match "\\([0-9][0-9][0-9][0-9]\\)-\\([0-9]+\\)-\\([0-9]+\\)"
> delay)
>
> (match-string 1 delay)
>
> (match-string 2 delay)
>
> (match-string 3 delay)
>
> (match-string 0 delay)
>
> The string-match gives 0, so the match is found. But the first three
> match-string do give nil.
> And the last gives:
> Debugger entered--Lisp error: (args-out-of-range "2009-12-22" 973 976)

Hmm, here's what I get:

(setq delay "2009-12-22")
"2009-12-22"

(string-match "\\([0-9][0-9][0-9][0-9]\\)-\\([0-9]+\\)-\\([0-9]+\\)"
delay)

0

(match-string 1 delay)
"2009"

(match-string 2 delay)
"12"

(match-string 3 delay)
"22"

(match-string 0 delay)
"2009-12-22"

Dan

Cecil Westerhof

unread,
Dec 21, 2009, 11:22:24 PM12/21/09
to
Dan Christensen <j...@uwo.ca> writes:

> Hmm, here's what I get:
>
> (setq delay "2009-12-22")
> "2009-12-22"
>
> (string-match "\\([0-9][0-9][0-9][0-9]\\)-\\([0-9]+\\)-\\([0-9]+\\)"
> delay)
> 0
>
> (match-string 1 delay)
> "2009"
>
> (match-string 2 delay)
> "12"
>
> (match-string 3 delay)
> "22"
>
> (match-string 0 delay)
> "2009-12-22"

Very strange, when doing it in the message buffer it works. But when I
copy those statements to the scratch buffer it goes wrong again. Looks
like the scratch buffer acts differently.

0 new messages