aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2013-12-14 09:24:36 -0500
committerStefan Monnier2013-12-14 09:24:36 -0500
commitaa2bddd73d8359ad944fde7c424d2d89c0ccf0d9 (patch)
treeea48729c3004ca89943f882efdb5c8e652efb5a5
parent660efa1a1442306aa34378a5b0392075e9415d35 (diff)
downloademacs-aa2bddd73d8359ad944fde7c424d2d89c0ccf0d9.tar.gz
emacs-aa2bddd73d8359ad944fde7c424d2d89c0ccf0d9.zip
* lisp/icomplete.el (icomplete-completions): Make sure the prefix is already
displayed elsewhere before hiding it.
-rw-r--r--lisp/ChangeLog20
-rw-r--r--lisp/icomplete.el22
2 files changed, 25 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 62045b9cb64..129dde734ab 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12013-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * icomplete.el (icomplete-completions): Make sure the prefix is already
4 displayed elsewhere before hiding it.
5
12013-12-14 Dmitry Gutov <dgutov@yandex.ru> 62013-12-14 Dmitry Gutov <dgutov@yandex.ru>
2 7
3 * progmodes/ruby-mode.el (ruby-smie-rules): Return nil before 8 * progmodes/ruby-mode.el (ruby-smie-rules): Return nil before
@@ -9,12 +14,11 @@
92013-12-13 Teodor Zlatanov <tzz@lifelogs.com> 142013-12-13 Teodor Zlatanov <tzz@lifelogs.com>
10 15
11 * progmodes/cfengine.el: Fix `add-hook' doc. 16 * progmodes/cfengine.el: Fix `add-hook' doc.
12 (cfengine-mode-syntax-functions-regex): 17 (cfengine-mode-syntax-functions-regex): Initialize sensibly.
13 Initialize sensibly.
14 (cfengine3--current-word): Fix parameters. 18 (cfengine3--current-word): Fix parameters.
15 (cfengine3-make-syntax-cache): Simplify further. 19 (cfengine3-make-syntax-cache): Simplify further.
16 (cfengine3-completion-function, cfengine3--current-function): Use 20 (cfengine3-completion-function, cfengine3--current-function):
17 `assq' for symbols. 21 Use `assq' for symbols.
18 (cfengine3--current-function): Fix `cfengine3--current-word' call. 22 (cfengine3--current-function): Fix `cfengine3--current-word' call.
19 23
202013-12-13 Glenn Morris <rgm@gnu.org> 242013-12-13 Glenn Morris <rgm@gnu.org>
@@ -31,8 +35,8 @@
31 cf-promises doesn't run. 35 cf-promises doesn't run.
32 (cfengine3--current-word): Reimplement using 36 (cfengine3--current-word): Reimplement using
33 `cfengine-mode-syntax-functions-regex'. 37 `cfengine-mode-syntax-functions-regex'.
34 (cfengine3-completion-function, cfengine3--current-function): Use 38 (cfengine3-completion-function, cfengine3--current-function):
35 `cfengine3-make-syntax-cache' directly. 39 Use `cfengine3-make-syntax-cache' directly.
36 (cfengine3-clear-syntax-cache): New function. 40 (cfengine3-clear-syntax-cache): New function.
37 (cfengine3-make-syntax-cache): Simplify and create 41 (cfengine3-make-syntax-cache): Simplify and create
38 `cfengine-mode-syntax-functions-regex' on demand. 42 `cfengine-mode-syntax-functions-regex' on demand.
@@ -85,8 +89,8 @@
85 89
862013-12-12 Fabián Ezequiel Gallina <fgallina@gnu.org> 902013-12-12 Fabián Ezequiel Gallina <fgallina@gnu.org>
87 91
88 * progmodes/python.el (python-indent-calculate-indentation): Fix 92 * progmodes/python.el (python-indent-calculate-indentation):
89 de-denters cornercase. (Bug#15731) 93 Fix de-denters cornercase. (Bug#15731)
90 94
912013-12-12 Stefan Monnier <monnier@iro.umontreal.ca> 952013-12-12 Stefan Monnier <monnier@iro.umontreal.ca>
92 96
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 7620adb3c9c..fccb2644ccb 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -416,18 +416,22 @@ are exhibited within the square braces.)"
416 ;; one line, increase the allowable space accordingly. 416 ;; one line, increase the allowable space accordingly.
417 (/ prospects-len (window-width))) 417 (/ prospects-len (window-width)))
418 (window-width))) 418 (window-width)))
419 ;; Find the common prefix among `comps'.
420 ;; We can't use the optimization below because its assumptions
421 ;; aren't always true, e.g. when completion-cycling (bug#10850):
422 ;; (if (eq t (compare-strings (car comps) nil (length most)
423 ;; most nil nil completion-ignore-case))
424 ;; ;; Common case.
425 ;; (length most)
426 ;; Else, use try-completion.
419 (prefix (when icomplete-hide-common-prefix 427 (prefix (when icomplete-hide-common-prefix
420 (try-completion "" comps))) 428 (try-completion "" comps)))
421 (prefix-len 429 (prefix-len
422 ;; Find the common prefix among `comps'. 430 (and (stringp prefix)
423 ;; We can't use the optimization below because its assumptions 431 ;; Only hide the prefix if the corresponding info
424 ;; aren't always true, e.g. when completion-cycling (bug#10850): 432 ;; is already displayed via `most'.
425 ;; (if (eq t (compare-strings (car comps) nil (length most) 433 (string-prefix-p prefix most t)
426 ;; most nil nil completion-ignore-case)) 434 (length prefix))) ;;)
427 ;; ;; Common case.
428 ;; (length most)
429 ;; Else, use try-completion.
430 (and (stringp prefix) (length prefix))) ;;)
431 prospects comp limit) 435 prospects comp limit)
432 (if (or (eq most-try t) (not (consp (cdr comps)))) 436 (if (or (eq most-try t) (not (consp (cdr comps))))
433 (setq prospects nil) 437 (setq prospects nil)