summaryrefslogtreecommitdiff
path: root/lisp/minibuffer.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@gnu.org>2012-03-10 15:08:51 +0800
committerChong Yidong <cyd@gnu.org>2012-03-10 15:08:51 +0800
commit7a2c7ca7ca06089158560f7d3e2807554d3276cf (patch)
treed4c5eaee9165cbea458c96f8aa4b97bc72424421 /lisp/minibuffer.el
parent82dcf4e4d8d761c26ef0a54e90e0e4a02fa4c430 (diff)
downloademacs-7a2c7ca7ca06089158560f7d3e2807554d3276cf.tar.gz
Give completion field overlays high priority.
* lisp/minibuffer.el (completion-in-region, completion-help-at-point): Give the completion field overlay a high priority. Fixes: debbugs:6830
Diffstat (limited to 'lisp/minibuffer.el')
-rw-r--r--lisp/minibuffer.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 1fdf33bf610..1a1a37258c4 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -1483,10 +1483,13 @@ exit."
(minibuffer-completion-predicate predicate)
(ol (make-overlay start end nil nil t)))
(overlay-put ol 'field 'completion)
+ ;; HACK: if the text we are completing is already in a field, we
+ ;; want the completion field to take priority (e.g. Bug#6830).
+ (overlay-put ol 'priority 100)
(when completion-in-region-mode-predicate
(completion-in-region-mode 1)
(setq completion-in-region--data
- (list (current-buffer) start end collection)))
+ (list (current-buffer) start end collection)))
(unwind-protect
(call-interactively 'minibuffer-complete)
(delete-overlay ol)))))
@@ -1653,9 +1656,10 @@ The completion method is determined by `completion-at-point-functions'."
;; introduce a corresponding hook (plus another for word-completion,
;; and another for force-completion, maybe?).
(overlay-put ol 'field 'completion)
+ (overlay-put ol 'priority 100)
(completion-in-region-mode 1)
(setq completion-in-region--data
- (list (current-buffer) start end collection))
+ (list (current-buffer) start end collection))
(unwind-protect
(call-interactively 'minibuffer-completion-help)
(delete-overlay ol))))