]> git.eshelyaron.com Git - emacs.git/commitdiff
(completion--insert-strings): Use string-width rather than length.
authorStefan Monnier <monnier@iro.umontreal.ca>
Fri, 2 May 2008 17:32:51 +0000 (17:32 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Fri, 2 May 2008 17:32:51 +0000 (17:32 +0000)
lisp/ChangeLog
lisp/minibuffer.el

index bf1265a835d7e2887c8f6aa55d3305c37b3669f3..6405f47dece2e853f4026aec362113e3dee318ef 100644 (file)
@@ -8,6 +8,7 @@
 
        * minibuffer.el (completion-hilit-commonality): Revert last change:
        the leftover code was actually useful.
+       (completion--insert-strings): Use string-width rather than length.
 
 2008-05-02  Sam Steingold  <sds@gnu.org>
 
index 2890978908a9b535f4180952c36daf6e3e5c99c7..02f695e41d3dc9658ee9d2280a451b6518021d0d 100644 (file)
@@ -578,8 +578,9 @@ It also eliminates runs of equal strings."
     (let* ((length (apply 'max
                          (mapcar (lambda (s)
                                    (if (consp s)
-                                       (+ (length (car s)) (length (cadr s)))
-                                     (length s)))
+                                       (+ (string-width (car s))
+                                           (string-width (cadr s)))
+                                     (string-width s)))
                                  strings)))
           (window (get-buffer-window (current-buffer) 0))
           (wwidth (if window (1- (window-width window)) 79))
@@ -610,8 +611,9 @@ It also eliminates runs of equal strings."
                                  `(display (space :align-to ,column))))
          (when (< wwidth (+ (max colwidth
                                  (if (consp str)
-                                     (+ (length (car str)) (length (cadr str)))
-                                   (length str)))
+                                     (+ (string-width (car str))
+                                         (string-width (cadr str)))
+                                   (string-width str)))
                             column))
            (delete-char -2) (insert "\n") (setq column 0))
          (if (not (consp str))