Hi,

I find that the doc string of `org-at-timestamp-p' about match groups
is not consistent with the behavior. The doc string says

When matching, the match groups are the following:
  group 1: year, if any
  group 2: month, if any
  group 3: day number, if any
  group 4: day name, if any
  group 5: hours, if any
  group 6: minutes, if any

but for timestamps like <2023-08-23 Wed>, (when (org-at-timestamp-p)
(match-string 2)) will return the year 2023 instead of the month. This
patch corrects the group numbers.
From a3c31e4f8f40202fcef61fc7c4b16acaf006e24f Mon Sep 17 00:00:00 2001
From: Liu Hui <liuhui1...@gmail.com>
Date: Wed, 23 Aug 2023 14:27:21 +0800
Subject: [PATCH] * lisp/org.el (org-at-timestamp-p): fix doc string

---
 lisp/org.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 3d9d61f69..6b89e14c4 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -14843,12 +14843,12 @@ (defun org-at-timestamp-p (&optional extended)
 values are possible).
 
 When matching, the match groups are the following:
-  group 1: year, if any
-  group 2: month, if any
-  group 3: day number, if any
-  group 4: day name, if any
-  group 5: hours, if any
-  group 6: minutes, if any"
+  group 2: year, if any
+  group 3: month, if any
+  group 4: day number, if any
+  group 5: day name, if any
+  group 7: hours, if any
+  group 8: minutes, if any"
   (let* ((regexp
           (if extended
               (if (eq extended 'agenda)
-- 
2.25.1

Reply via email to