Give argument of db/org-get-location a more descriptive name

It's not a universal arguments, so calling it ARG is not only just
non-informative, but also misleading.
This commit is contained in:
Daniel Borchmann 2023-07-29 19:50:12 +02:00
parent 42af8216e0
commit c0660fe0f6
No known key found for this signature in database
GPG Key ID: 784AA8DF0CCDF625

View File

@ -1404,20 +1404,21 @@ not."
(t (user-error "Neither ID nor CUSTOM_ID given"))))) (t (user-error "Neither ID nor CUSTOM_ID given")))))
(org-search-view nil query))) (org-search-view nil query)))
(defun db/org-get-location (&optional arg) (defun db/org-get-location (&optional use-all-org-files)
"Interactively query for location and return mark. "Interactively query for location and return mark.
When ARG is nil, this functions by default searches through the When USE-ALL-ORG-FILES is nil, this functions by default searches
current buffer if that one is an Org buffer and is associated through the current buffer if that one is an Org buffer and is
with a file, and `db/org-default-org-file' otherwise. If the associated with a file, and `db/org-default-org-file' otherwise.
current buffer is associated with a file from the variable If the current buffer is associated with a file from the variable
`org-agenda-files', though, the search is extended through all `org-agenda-files', though, the search is extended through all
agenda files (the rationale being that Org agenda files are agenda files (the rationale being that Org agenda files are
always considered to be one large data collection). always considered to be one large data collection).
When ARG is non-nil, search through all files in the variables When USE-ALL-ORG-FILES is non-nil, search through all files in
`org-agenda-files', `org-agenda-text-search-extra-files', and the the variables `org-agenda-files',
current file or `db/org-default-org-file' as described above. `org-agenda-text-search-extra-files', and the current file or
`db/org-default-org-file' as described above.
Search is always conducted up to level 9. If the selected Search is always conducted up to level 9. If the selected
location does not have an associated point or mark, error out. location does not have an associated point or mark, error out.
@ -1445,16 +1446,16 @@ linking to any item."
'((org-agenda-files :maxlevel . 9)) '((org-agenda-files :maxlevel . 9))
'((nil :maxlevel . 9))) '((nil :maxlevel . 9)))
;; When ARG is non-nil, add all agenda ;; When USE-ALL-ORG-FILES is non-nil, add
;; files, but only if not already done ;; all agenda files, but only if not
;; so. ;; already done so.
(and arg (and use-all-org-files
(not current-buffer-is-in-org-agenda-files?) (not current-buffer-is-in-org-agenda-files?)
'((org-agenda-files :maxlevel . 9))) '((org-agenda-files :maxlevel . 9)))
;; When ARG is non-nil, add extra file ;; When USE-ALL-ORG-FILES is non-nil, add
;; files to search though. ;; extra file files to search though.
(and arg (and use-all-org-files
`((,(cl-remove-if-not #'stringp `((,(cl-remove-if-not #'stringp
org-agenda-text-search-extra-files) org-agenda-text-search-extra-files)
:maxlevel . 9))))) :maxlevel . 9)))))