emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r107549: Give completion field overla


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107549: Give completion field overlays high priority.
Date: Sat, 10 Mar 2012 15:08:51 +0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107549
fixes bug(s): http://debbugs.gnu.org/6830
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Sat 2012-03-10 15:08:51 +0800
message:
  Give completion field overlays high priority.
  
  * lisp/minibuffer.el (completion-in-region, completion-help-at-point):
  Give the completion field overlay a high priority.
modified:
  lisp/ChangeLog
  lisp/minibuffer.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-03-10 05:20:58 +0000
+++ b/lisp/ChangeLog    2012-03-10 07:08:51 +0000
@@ -1,5 +1,8 @@
 2012-03-10  Chong Yidong  <address@hidden>
 
+       * 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.

=== modified file 'lisp/minibuffer.el'
--- a/lisp/minibuffer.el        2012-02-23 15:41:12 +0000
+++ b/lisp/minibuffer.el        2012-03-10 07:08:51 +0000
@@ -1483,10 +1483,13 @@
           (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 @@
         ;; 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))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]