GNU bug report logs -
#26335
time-stamp-pattern examples unclear
Previous Next
Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Date: Sun, 2 Apr 2017 00:17:01 UTC
Severity: wishlist
Tags: fixed
Fixed in version 27.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #8 received at 26335 <at> debbugs.gnu.org (full text, mbox):
積丹尼 Dan Jacobson <jidanni <at> jidanni.org> writes:
> time-stamp-pattern is a variable defined in ‘time-stamp.el’.
> ...
> This string has four parts, each of which is optional.
> ...
> Examples:
> "-10/"
> "-9/^Last modified: %%$"
> "@set Time-stamp: %:b %:d, %:y$"
> "newcommand{\\\\timestamp}{%%}"
>
> Please say
> Examples:
>
> This only has the first part:
> "-10/"
>
> This has the first part, followed by the second and maybe? the third part:
> "-9/^Last modified: %%$"
>
> This has the second part followed by the ??th part:
> "@set Time-stamp: %:b %:d, %:y$"
>
> This has the ??nd part followed by the ??th part:
> "newcommand{\\\\timestamp}{%%}"
Well, all that stuff is pretty much incomprehensible, so I went through
the examples using the code like this:
(progn
(string-match "\\`\\(\\(-?[0-9]+\\)/\\)?\\([^%]+\\)?\\(\\(%[-.,:@+_ #^()0-9]*[A-Za-z%][^%]*\\)*%[-.,:@+_ #^()0-9]*[A-Za-z%]\\)?\\([^%]+\\)?\\'"
"newcommand{\\\\\\\\timestamp}{%%}")
(match-data))
=> (0 29 nil nil nil nil 0 26 26 28 nil nil 28 29)
and matched up to this code fragment:
(and (match-beginning 2)
(setq line-limit
(string-to-number (match-string 2 time-stamp-pattern))))
(and (match-beginning 3)
(setq ts-start (match-string 3 time-stamp-pattern)))
(and (match-beginning 4)
(not (string-equal (match-string 4 time-stamp-pattern) "%%"))
(setq ts-format (match-string 4 time-stamp-pattern)))
(and (match-beginning 6)
(setq ts-end (match-string 6 time-stamp-pattern)))))
and added the explanations about what's set. It was probably not worth
it, though.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
This bug report was last modified 5 years and 305 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.