Avoid duplicate entries in Org location queries

This happens when the current buffer is already part of the Org agenda files.  In this case, we do
not add the default buffer to the list of search files.
This commit is contained in:
Daniel Borchmann 2025-08-17 15:41:07 +02:00
parent 0ac05e43ef
commit 195a6afb5f
No known key found for this signature in database
GPG Key ID: 50EA937BF472ADD1

View File

@ -1896,7 +1896,8 @@ linking to any item."
org-agenda-files))) org-agenda-files)))
(scope (cond (use-all-org-files (scope (cond (use-all-org-files
(append (list (buffer-file-name default-buffer)) (append (unless current-buffer-is-in-org-agenda-files? ; avoid duplicate entries
(list (buffer-file-name default-buffer)))
(org-agenda-files) (org-agenda-files)
(cl-remove-if-not #'stringp (cl-remove-if-not #'stringp
org-agenda-text-search-extra-files))) org-agenda-text-search-extra-files)))