aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2008-05-02 17:32:51 +0000
committerStefan Monnier <[email protected]>2008-05-02 17:32:51 +0000
commite5b5b82d4eb877083dafd278c19a4e73357f3dd7 (patch)
tree7bf5f389badbf919d4a6d33626fcee5b23cddded /lisp
parent2bd49e46f4568851ecf267bb79f240c778933c38 (diff)
(completion--insert-strings): Use string-width rather than length.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog1
-rw-r--r--lisp/minibuffer.el10
2 files changed, 7 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bf1265a835..6405f47dec 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -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 <[email protected]>
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 2890978908..02f695e41d 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -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))