mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
Enable completion-in-region-mode in minibuffer-complete-history/defaults
* lisp/minibuffer.el (minibuffer-complete-history) (minibuffer-complete-defaults): Let-bind completion-in-region-mode-predicate to lambda that checks if the "*Completions*" buffer window is visible. This enables completion-in-region-mode that supports arrows with minibuffer-visible-completions.
This commit is contained in:
parent
579ea5f6e2
commit
94763aa521
1 changed files with 12 additions and 8 deletions
|
|
@ -4727,13 +4727,15 @@ instead of the default completion table."
|
|||
history)
|
||||
(user-error "No history available"))))
|
||||
;; FIXME: Can we make it work for CRM?
|
||||
(completion-in-region
|
||||
(minibuffer--completion-prompt-end) (point-max)
|
||||
(lambda (string pred action)
|
||||
(if (eq action 'metadata)
|
||||
'(metadata (display-sort-function . identity)
|
||||
(cycle-sort-function . identity))
|
||||
(complete-with-action action completions string pred))))))
|
||||
(let ((completion-in-region-mode-predicate
|
||||
(lambda () (get-buffer-window "*Completions*" 0))))
|
||||
(completion-in-region
|
||||
(minibuffer--completion-prompt-end) (point-max)
|
||||
(lambda (string pred action)
|
||||
(if (eq action 'metadata)
|
||||
'(metadata (display-sort-function . identity)
|
||||
(cycle-sort-function . identity))
|
||||
(complete-with-action action completions string pred)))))))
|
||||
|
||||
(defun minibuffer-complete-defaults ()
|
||||
"Complete minibuffer defaults as far as possible.
|
||||
|
|
@ -4744,7 +4746,9 @@ instead of the completion table."
|
|||
(functionp minibuffer-default-add-function))
|
||||
(setq minibuffer-default-add-done t
|
||||
minibuffer-default (funcall minibuffer-default-add-function)))
|
||||
(let ((completions (ensure-list minibuffer-default)))
|
||||
(let ((completions (ensure-list minibuffer-default))
|
||||
(completion-in-region-mode-predicate
|
||||
(lambda () (get-buffer-window "*Completions*" 0))))
|
||||
(completion-in-region
|
||||
(minibuffer--completion-prompt-end) (point-max)
|
||||
(lambda (string pred action)
|
||||
|
|
|
|||
Loading…
Reference in a new issue