aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuanma Barranquero2014-03-01 02:25:29 +0100
committerJuanma Barranquero2014-03-01 02:25:29 +0100
commit9a15505898e90defdca153b6bc11bf4584bd007d (patch)
treec5a45f7fd14b87ec3601a99f7f787234664d8034
parent8268febfe0c336ff47a61d0d416fd4bebf61a993 (diff)
downloademacs-9a15505898e90defdca153b6bc11bf4584bd007d.tar.gz
emacs-9a15505898e90defdca153b6bc11bf4584bd007d.zip
lisp/icomplete.el: Use "..." when U+2026 cannot be displayed.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/icomplete.el7
2 files changed, 9 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d8dda13d346..97fef60ee8c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12014-03-01 Juanma Barranquero <lekktu@gmail.com>
2
3 * icomplete.el (icomplete-completions):
4 Revert back to using "..." when ?… cannot be displayed.
5
12014-02-28 Juanma Barranquero <lekktu@gmail.com> 62014-02-28 Juanma Barranquero <lekktu@gmail.com>
2 7
3 * finder.el (finder-unload-function): New function. 8 * finder.el (finder-unload-function): New function.
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 18bdd899e6e..e3f7fde7797 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -392,6 +392,7 @@ matches exist."
392 ;; a prefix of most, or something else. 392 ;; a prefix of most, or something else.
393 (compare (compare-strings name nil nil 393 (compare (compare-strings name nil nil
394 most nil nil completion-ignore-case)) 394 most nil nil completion-ignore-case))
395 (ellipsis (if (char-displayable-p ?…) "…" "..."))
395 (determ (unless (or (eq t compare) (eq t most-try) 396 (determ (unless (or (eq t compare) (eq t most-try)
396 (= (setq compare (1- (abs compare))) 397 (= (setq compare (1- (abs compare)))
397 (length most))) 398 (length most)))
@@ -402,14 +403,14 @@ matches exist."
402 (substring most compare)) 403 (substring most compare))
403 ;; Don't bother truncating if it doesn't gain 404 ;; Don't bother truncating if it doesn't gain
404 ;; us at least 2 columns. 405 ;; us at least 2 columns.
405 ((< compare 3) most) 406 ((< compare (+ 2 (length ellipsis))) most)
406 (t (concat "…" (substring most compare)))) 407 (t (concat ellipsis (substring most compare))))
407 close-bracket))) 408 close-bracket)))
408 ;;"-prospects" - more than one candidate 409 ;;"-prospects" - more than one candidate
409 (prospects-len (+ (string-width 410 (prospects-len (+ (string-width
410 (or determ (concat open-bracket close-bracket))) 411 (or determ (concat open-bracket close-bracket)))
411 (string-width icomplete-separator) 412 (string-width icomplete-separator)
412 3 ;; take {…} into account 413 (+ 2 (length ellipsis)) ;; take {…} into account
413 (string-width (buffer-string)))) 414 (string-width (buffer-string))))
414 (prospects-max 415 (prospects-max
415 ;; Max total length to use, including the minibuffer content. 416 ;; Max total length to use, including the minibuffer content.