diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 9c4c044..4109557 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -322,7 +322,23 @@ single predicate)." (mapc #'org-ql--ensure-buffer buffers-files) (let* ((completion-styles '(org-ql-completing-read)) (completion-styles-alist (list (list 'org-ql-completing-read #'try #'all "Org QL Find"))) - (selected (completing-read prompt #'collection nil t))) + (selected + (minibuffer-with-setup-hook + (lambda () + (let ((map (make-sparse-keymap))) + (define-key + map (kbd "C-c C-e") + (lambda () + (interactive) + (run-at-time 0 nil + #'org-ql-search + buffers-files + (minibuffer-contents-no-properties)) + (if (fboundp 'minibuffer-quit-recursive-edit) + (minibuffer-quit-recursive-edit) + (abort-recursive-edit)))) + (use-local-map (make-composed-keymap map (current-local-map))))) + (completing-read prompt #'collection nil t)))) ;; (debug-message "SELECTED:%S KEYS:%S" selected (hash-table-keys table)) (or (gethash selected table) ;; If there are completions in the table, but none of them exactly match the user input