emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r115523: * lisp/icomplete.el (icomplete-completions)


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r115523: * lisp/icomplete.el (icomplete-completions): Make sure the prefix is already
Date: Sat, 14 Dec 2013 14:24:40 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 115523
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Sat 2013-12-14 09:24:36 -0500
message:
  * lisp/icomplete.el (icomplete-completions): Make sure the prefix is already
  displayed elsewhere before hiding it.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/icomplete.el              
icomplete.el-20091113204419-o5vbwnq5f7feedwu-643
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-12-14 06:46:13 +0000
+++ b/lisp/ChangeLog    2013-12-14 14:24:36 +0000
@@ -1,3 +1,8 @@
+2013-12-14  Stefan Monnier  <address@hidden>
+
+       * icomplete.el (icomplete-completions): Make sure the prefix is already
+       displayed elsewhere before hiding it.
+
 2013-12-14  Dmitry Gutov  <address@hidden>
 
        * progmodes/ruby-mode.el (ruby-smie-rules): Return nil before
@@ -9,12 +14,11 @@
 2013-12-13  Teodor Zlatanov  <address@hidden>
 
        * progmodes/cfengine.el: Fix `add-hook' doc.
-       (cfengine-mode-syntax-functions-regex):
-       Initialize sensibly.
+       (cfengine-mode-syntax-functions-regex): Initialize sensibly.
        (cfengine3--current-word): Fix parameters.
        (cfengine3-make-syntax-cache): Simplify further.
-       (cfengine3-completion-function, cfengine3--current-function): Use
-       `assq' for symbols.
+       (cfengine3-completion-function, cfengine3--current-function):
+       Use `assq' for symbols.
        (cfengine3--current-function): Fix `cfengine3--current-word' call.
 
 2013-12-13  Glenn Morris  <address@hidden>
@@ -31,8 +35,8 @@
        cf-promises doesn't run.
        (cfengine3--current-word): Reimplement using
        `cfengine-mode-syntax-functions-regex'.
-       (cfengine3-completion-function, cfengine3--current-function): Use
-       `cfengine3-make-syntax-cache' directly.
+       (cfengine3-completion-function, cfengine3--current-function):
+       Use `cfengine3-make-syntax-cache' directly.
        (cfengine3-clear-syntax-cache): New function.
        (cfengine3-make-syntax-cache): Simplify and create
        `cfengine-mode-syntax-functions-regex' on demand.
@@ -85,8 +89,8 @@
 
 2013-12-12  Fabián Ezequiel Gallina  <address@hidden>
 
-       * progmodes/python.el (python-indent-calculate-indentation): Fix
-       de-denters cornercase. (Bug#15731)
+       * progmodes/python.el (python-indent-calculate-indentation):
+       Fix de-denters cornercase. (Bug#15731)
 
 2013-12-12  Stefan Monnier  <address@hidden>
 

=== modified file 'lisp/icomplete.el'
--- a/lisp/icomplete.el 2013-10-19 15:22:57 +0000
+++ b/lisp/icomplete.el 2013-12-14 14:24:36 +0000
@@ -416,18 +416,22 @@
                     ;; one line, increase the allowable space accordingly.
                     (/ prospects-len (window-width)))
                  (window-width)))
+             ;; Find the common prefix among `comps'.
+             ;; We can't use the optimization below because its assumptions
+             ;; aren't always true, e.g. when completion-cycling (bug#10850):
+             ;; (if (eq t (compare-strings (car comps) nil (length most)
+             ;;                         most nil nil completion-ignore-case))
+             ;;     ;; Common case.
+             ;;     (length most)
+             ;; Else, use try-completion.
             (prefix (when icomplete-hide-common-prefix
                       (try-completion "" comps)))
              (prefix-len
-              ;; Find the common prefix among `comps'.
-             ;; We can't use the optimization below because its assumptions
-             ;; aren't always true, e.g. when completion-cycling (bug#10850):
-             ;; (if (eq t (compare-strings (car comps) nil (length most)
-             ;;                         most nil nil completion-ignore-case))
-             ;;     ;; Common case.
-             ;;     (length most)
-             ;; Else, use try-completion.
-             (and (stringp prefix) (length prefix))) ;;)
+             (and (stringp prefix)
+                   ;; Only hide the prefix if the corresponding info
+                   ;; is already displayed via `most'.
+                   (string-prefix-p prefix most t)
+                   (length prefix))) ;;)
             prospects comp limit)
        (if (or (eq most-try t) (not (consp (cdr comps))))
            (setq prospects nil)


reply via email to

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