+ org-ql-completing-read-group-name-function custom
This commit is contained in:
parent
4b8330a683
commit
61addb5537
1 changed files with 9 additions and 1 deletions
|
|
@ -81,6 +81,12 @@ For an experience like `org-rifle', use a newline."
|
|||
(const :tag "New line (shown under heading)" "\n")
|
||||
string))
|
||||
|
||||
(defcustom org-ql-completing-read-group-name-function #'buffer-name
|
||||
"Function used to generate group name in `org-ql-completing-read'.
|
||||
Function is called when need to make group name from the buffer object."
|
||||
:type '(choice (function-item :tag "Use buffer-name as group-name" buffer-name)
|
||||
(function :tag "Custom function")))
|
||||
|
||||
(defface org-ql-completing-read-snippet '((t (:inherit font-lock-comment-face)))
|
||||
"Snippets.")
|
||||
|
||||
|
|
@ -222,7 +228,9 @@ single predicate)."
|
|||
(or (funcall snippet (get-text-property 0 'org-marker candidate)) "")))
|
||||
(group (candidate transform)
|
||||
(pcase transform
|
||||
(`nil (buffer-name (marker-buffer (get-text-property 0 'org-marker candidate))))
|
||||
(`nil (let ((candidate-buffer (marker-buffer (get-text-property 0 'org-marker candidate))))
|
||||
(or (funcall org-ql-completing-read-group-name-function candidate-buffer)
|
||||
(buffer-name candidate-buffer))))
|
||||
(_ candidate)))
|
||||
(try (string _collection _pred point &optional _metadata)
|
||||
;; (debug-message "TRY: STRING:%S" string)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue