Anders Johansson writes: > Hi, > I noticed that this commit: > b1a570b3b org-agenda: Fix regression when diary sexp timestamps are ignored > > made a call like (org-at-timestamp-p 'agenda) match against the regexp > `org-element--timestamp-regexp`. However, this regexp doesn’t have the > match groups setup as the others (`org-ts-regexp3` and `org-ts-regexp2`) so > the last part of the docstring for org-at-timestamp-p doesn’t hold anymore > (that the timestamp parts should now be put in match groups). Confirmed. Can you try the attached patch? Also, unless I miss something, docstring was not fully obeyed even in the past. Consider the following timestamp: <2022-04-15 Fri 11:40> I ran the following code with point at the timestamp: (progn (org-at-timestamp-p ) (mapcar #'substring-no-properties (list (match-string 0) (match-string 1) (match-string 2) (match-string 3) (match-string 4) (match-string 5) (match-string 6) (match-string 7)))) The output is: ("<2022-04-15 Fri 11:40>" "2022-04-15 Fri 11:40" "2022" "04" "15" "Fri" " 11:40" "11" "40") There are two extra groups (group 1 and group 6), presumably due to earlier changes in org-ts-regexp1. > I was using this in some code of mine, but I also realize that this doesn’t > feel all that clean anyway. I am not sure if this is used elsewhere in org > though. I am currently working on an alternative concept of analyzing arbitrary org element components. Instead of named groups, I plan to provide named match groups: (progn (org-element-match 'timestamp) (org-element-match-data)) ((:minute-start 314 316) (:hour-start 311 313) (:day-start 304 306) (:month-start 301 303) (:year-start 296 300) (:date-start 296 316) (:timestamp-start 295 317) (:end-marker 316 317) (:begin-marker 295 296) (:full 295 317) (:full-no-blank 295 317) (:full-no-affiliated 295 317)) The current WIP implementation is in https://github.com/yantar92/org/blob/feature/org-font-lock-element/lisp/org-element-match.el The match groups set by org-at-timestamp-p are currently being used by the following functions: org-mouse-delete-timestamp, org-follow-timestamp-link, org-time-stamp, org-toggle-timestamp-type However, all but one of them are only using group 0 and org-follow-timestamp-link is using group 1 as currently set by org-at-timestamp-p against the docstring. Best, Ihor