Add: (org-ql-search-buffer-major-modes) to extend mode list

This commit is contained in:
Slava Barinov 2025-07-03 14:12:43 +09:00
parent 4b8330a683
commit 0777057286
2 changed files with 7 additions and 1 deletions

View file

@ -99,6 +99,11 @@ directories, etc, which would make it slow to list the
`org-directory' files recursively." `org-directory' files recursively."
:type 'boolean) :type 'boolean)
(defcustom org-ql-search-buffer-major-modes '(org-mode)
"Search not only in buffers with `org-mode' set as major mode.
E.g. `org-journal-mode' can be enabled as well."
:type '(repeat symbol))
;;;; Commands ;;;; Commands
;;;###autoload ;;;###autoload

View file

@ -1147,7 +1147,8 @@ current buffer. Otherwise BUFFERS-FILES is returned unchanged."
"Return BUFFERS-FILES expanded to a list of files or buffers. "Return BUFFERS-FILES expanded to a list of files or buffers.
The counterpart to `org-ql-view--contract-buffers-files'." The counterpart to `org-ql-view--contract-buffers-files'."
(pcase-exhaustive buffers-files (pcase-exhaustive buffers-files
("all" (--select (equal (buffer-local-value 'major-mode it) 'org-mode) ("all" (--select (member (buffer-local-value 'major-mode it)
org-ql-search-buffer-major-modes)
(buffer-list))) (buffer-list)))
("org-agenda-files" (org-agenda-files)) ("org-agenda-files" (org-agenda-files))
("org-directory" (org-ql-search-directories-files)) ("org-directory" (org-ql-search-directories-files))