emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r116616: lisp/icomplete.el: Use "..." when U+2026 ca


From: Juanma Barranquero
Subject: [Emacs-diffs] trunk r116616: lisp/icomplete.el: Use "..." when U+2026 cannot be displayed.
Date: Sat, 01 Mar 2014 01:25:43 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116616
revision-id: address@hidden
parent: address@hidden
committer: Juanma Barranquero <address@hidden>
branch nick: trunk
timestamp: Sat 2014-03-01 02:25:29 +0100
message:
  lisp/icomplete.el: Use "..." when U+2026 cannot be displayed.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/icomplete.el              
icomplete.el-20091113204419-o5vbwnq5f7feedwu-643
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-02-28 20:00:12 +0000
+++ b/lisp/ChangeLog    2014-03-01 01:25:29 +0000
@@ -1,3 +1,8 @@
+2014-03-01  Juanma Barranquero  <address@hidden>
+
+       * icomplete.el (icomplete-completions):
+       Revert back to using "..." when ?… cannot be displayed.
+
 2014-02-28  Juanma Barranquero  <address@hidden>
 
        * finder.el (finder-unload-function): New function.

=== modified file 'lisp/icomplete.el'
--- a/lisp/icomplete.el 2014-02-12 08:27:27 +0000
+++ b/lisp/icomplete.el 2014-03-01 01:25:29 +0000
@@ -392,6 +392,7 @@
              ;; 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 @@
                                 (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.


reply via email to

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