unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#26335: time-stamp-pattern examples unclear
@ 2017-04-01 22:30 積丹尼 Dan Jacobson
  2019-07-26 10:40 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: 積丹尼 Dan Jacobson @ 2017-04-01 22:30 UTC (permalink / raw)
  To: 26335

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}{%%}"





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

* bug#26335: time-stamp-pattern examples unclear
  2017-04-01 22:30 bug#26335: time-stamp-pattern examples unclear 積丹尼 Dan Jacobson
@ 2019-07-26 10:40 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-26 10:40 UTC (permalink / raw)
  To: 積丹尼 Dan Jacobson; +Cc: 26335

積丹尼 Dan Jacobson <jidanni@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





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

end of thread, other threads:[~2019-07-26 10:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-01 22:30 bug#26335: time-stamp-pattern examples unclear 積丹尼 Dan Jacobson
2019-07-26 10:40 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).