This commit is contained in:
Omar Antolín Camarena 2026-06-01 05:12:51 +00:00 committed by GitHub
commit bc11236b87
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -332,26 +332,26 @@ single predicate)."
;; ensuring all of the BUFFERS-FILES are loaded and initialized before calling ;; ensuring all of the BUFFERS-FILES are loaded and initialized before calling
;; `completing-read'. ;; `completing-read'.
(mapc #'org-ql--ensure-buffer buffers-files) (mapc #'org-ql--ensure-buffer buffers-files)
(let* ((completion-styles '(org-ql-completing-read)) (let ((selected
(completion-styles-alist (cons (list 'org-ql-completing-read #'try #'all "Org QL Find") (minibuffer-with-setup-hook
completion-styles-alist)) (lambda ()
(selected (setq-local completion-styles '(org-ql-completing-read))
(minibuffer-with-setup-hook (setq-local completion-styles-alist (cons (list 'org-ql-completing-read #'try #'all "Org QL Find")
(lambda () completion-styles-alist))
(use-local-map (make-composed-keymap org-ql-completing-read-map (current-local-map)))) (use-local-map (make-composed-keymap org-ql-completing-read-map (current-local-map))))
(cl-letf* (((symbol-function 'org-ql-completing-read-export) (cl-letf* (((symbol-function 'org-ql-completing-read-export)
(lambda () (lambda ()
(interactive) (interactive)
(run-at-time 0 nil (run-at-time 0 nil
#'org-ql-search #'org-ql-search
buffers-files buffers-files
(minibuffer-contents-no-properties)) (minibuffer-contents-no-properties))
(if (fboundp 'minibuffer-quit-recursive-edit) (if (fboundp 'minibuffer-quit-recursive-edit)
(minibuffer-quit-recursive-edit) (minibuffer-quit-recursive-edit)
(abort-recursive-edit)))) (abort-recursive-edit))))
((symbol-function 'embark-export) ((symbol-function 'embark-export)
(symbol-function 'org-ql-completing-read-export))) (symbol-function 'org-ql-completing-read-export)))
(completing-read prompt #'collection nil t))))) (completing-read prompt #'collection nil t)))))
;; (debug-message "SELECTED:%S KEYS:%S" selected (hash-table-keys table)) ;; (debug-message "SELECTED:%S KEYS:%S" selected (hash-table-keys table))
(or (gethash selected table) (or (gethash selected table)
;; If there are completions in the table, but none of them exactly match the user input ;; If there are completions in the table, but none of them exactly match the user input