From: Juanma Barranquero Date: Sat, 1 Mar 2014 01:25:29 +0000 (+0100) Subject: lisp/icomplete.el: Use "..." when U+2026 cannot be displayed. X-Git-Url: http://git.hcoop.net/bpt/emacs.git/commitdiff_plain/9a15505898e90defdca153b6bc11bf4584bd007d lisp/icomplete.el: Use "..." when U+2026 cannot be displayed. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d8dda13d34..97fef60ee8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-03-01 Juanma Barranquero + + * icomplete.el (icomplete-completions): + Revert back to using "..." when ?… cannot be displayed. + 2014-02-28 Juanma Barranquero * finder.el (finder-unload-function): New function. diff --git a/lisp/icomplete.el b/lisp/icomplete.el index 18bdd899e6..e3f7fde779 100644 --- a/lisp/icomplete.el +++ b/lisp/icomplete.el @@ -392,6 +392,7 @@ matches exist." ;; a prefix of most, or something else. (compare (compare-strings name nil nil most nil nil completion-ignore-case)) + (ellipsis (if (char-displayable-p ?…) "…" "...")) (determ (unless (or (eq t compare) (eq t most-try) (= (setq compare (1- (abs compare))) (length most))) @@ -402,14 +403,14 @@ matches exist." (substring most compare)) ;; Don't bother truncating if it doesn't gain ;; us at least 2 columns. - ((< compare 3) most) - (t (concat "…" (substring most compare)))) + ((< compare (+ 2 (length ellipsis))) most) + (t (concat ellipsis (substring most compare)))) close-bracket))) ;;"-prospects" - more than one candidate (prospects-len (+ (string-width (or determ (concat open-bracket close-bracket))) (string-width icomplete-separator) - 3 ;; take {…} into account + (+ 2 (length ellipsis)) ;; take {…} into account (string-width (buffer-string)))) (prospects-max ;; Max total length to use, including the minibuffer content.