org-agenda-search-headline-for-time: Ignore all the timestamps in headings

* lisp/org-agenda.el (org-agenda-format-item): When
`org-agenda-search-headline-for-time' is non-nil, exclude timestamps
in headings from searching the time.
(org-agenda-search-headline-for-time): Remove warning about timestamps
in headings from the docstring.
* etc/ORG-NEWS (~org-agenda-search-headline-for-time~ now ignores all
the timestamp in headings): Announce the change.

Reported-by: rameiko87@posteo.net
Link: https://orgmode.org/list/dc5c0aa3748f5d7ad8b79bea674266e7@posteo.net
This commit is contained in:
Ihor Radchenko 2024-01-06 13:29:43 +01:00
parent b6643884cb
commit fa198cbbe4
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
2 changed files with 16 additions and 5 deletions

View File

@ -13,6 +13,14 @@ Please send Org bug reports to mailto:emacs-orgmode@gnu.org.
* Version 9.7 (not released yet)
** Important announcements and breaking changes
*** ~org-agenda-search-headline-for-time~ now ignores all the timestamp in headings
Previously, ~org-agenda-search-headline-for-time~ made Org agenda
match anything resembling time inside headings. Even when the time
was a part of a timestamp.
Now, all the timestamps in headings are ignored when searching the time.
*** ODT export no longer opens the exported file in the background
ODT exporter used to open the exported file in ~archive-mode~ "for

View File

@ -1537,10 +1537,7 @@ value, don't limit agenda view by outline level."
"Non-nil means search headline for a time-of-day.
If the headline contains a time-of-day in one format or another, it will
be used to sort the entry into the time sequence of items for a day.
Some people have time stamps in the headline that refer to the creation
time or so, and then this produces an unwanted side effect. If this is
the case for your, use this variable to turn off searching the headline
for a time."
Timestamps in the headline will be ignored."
:group 'org-agenda-time-grid
:type 'boolean)
@ -6967,7 +6964,13 @@ Any match of REMOVE-RE will be removed from TXT."
time
(ts (when dotime (concat
(if (stringp dotime) dotime "")
(and org-agenda-search-headline-for-time txt))))
(and org-agenda-search-headline-for-time
;; Do not search inside
;; timestamps. They are handled
;; separately.
(replace-regexp-in-string
org-ts-regexp-both ""
txt)))))
(time-of-day (and dotime (org-get-time-of-day ts)))
stamp plain s0 s1 s2 rtn srp l
duration breadcrumbs)