icomplete-prospects-height fix (tiny change)
authorWesley Dawson <whd@lavabit.com>
Fri, 4 Jan 2013 08:20:49 +0000 (00:20 -0800)
committerGlenn Morris <rgm@gnu.org>
Fri, 4 Jan 2013 08:20:49 +0000 (00:20 -0800)
* icomplete.el (icomplete-completions):
Honor icomplete-prospects-height once more following 2012-11-29 changes.

Fixes: debbugs:13224

lisp/ChangeLog
lisp/icomplete.el

index cc1e652..0dbe5ac 100644 (file)
@@ -1,3 +1,9 @@
+2013-01-04  Wesley Dawson  <whd@lavabit.com>  (tiny change)
+
+       * icomplete.el (icomplete-completions):
+       Honor icomplete-prospects-height once more following
+       2012-11-29 changes.  (Bug#13224)
+
 2013-01-04  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * subr.el (internal--called-interactively-p--get-frame): Find aliases
index 0493a5b..9407de4 100644 (file)
@@ -343,8 +343,10 @@ are exhibited within the square braces.)"
                                (t (concat "…" (substring most compare))))
                               close-bracket)))
             ;;"-prospects" - more than one candidate
-            (prospects-len (+ (length determ) 6 ;; take {,...} into account
-                               (string-width (buffer-string))))
+            (prospects-len (+ (length determ)
+                              (string-width icomplete-separator)
+                              3 ;; take {…} into account
+                              (string-width (buffer-string))))
              (prospects-max
               ;; Max total length to use, including the minibuffer content.
               (* (+ icomplete-prospects-height
@@ -375,7 +377,9 @@ are exhibited within the square braces.)"
            (cond ((string-equal comp "") (setq most-is-exact t))
                  ((member comp prospects))
                  (t (setq prospects-len
-                           (+ (string-width comp) 1 prospects-len))
+                           (+ (string-width comp)
+                             (string-width icomplete-separator)
+                             prospects-len))
                     (if (< prospects-len prospects-max)
                         (push comp prospects)
                       (setq limit t))))))