]> git.eshelyaron.com Git - emacs.git/commitdiff
Give completion field overlays high priority.
authorChong Yidong <cyd@gnu.org>
Sat, 10 Mar 2012 07:08:51 +0000 (15:08 +0800)
committerChong Yidong <cyd@gnu.org>
Sat, 10 Mar 2012 07:08:51 +0000 (15:08 +0800)
* lisp/minibuffer.el (completion-in-region, completion-help-at-point):
Give the completion field overlay a high priority.

Fixes: debbugs:6830
lisp/ChangeLog
lisp/minibuffer.el

index 4419099388717de4b58a7b375d927284931a4f2f..c3b28cd8777d09e41defb6ca4b44571c392c6960 100644 (file)
@@ -1,5 +1,8 @@
 2012-03-10  Chong Yidong  <cyd@gnu.org>
 
+       * minibuffer.el (completion-in-region, completion-help-at-point):
+       Give the completion field overlay a high priority (Bug#6830).
+
        * dired.el (dired-goto-file): Recognize absolute file name
        listings (Bug#7126).
        (dired-goto-file-1): New helper function.
index 1fdf33bf61028ac9e1c5771ddf6f4fc7f1d84a94..1a1a37258c4804cf0c6a92b3dd07e0852132675a 100644 (file)
@@ -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))))