diff options
| author | Stefan Monnier | 2008-05-02 17:32:51 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2008-05-02 17:32:51 +0000 |
| commit | e5b5b82d4eb877083dafd278c19a4e73357f3dd7 (patch) | |
| tree | 7bf5f389badbf919d4a6d33626fcee5b23cddded | |
| parent | 2bd49e46f4568851ecf267bb79f240c778933c38 (diff) | |
| download | emacs-e5b5b82d4eb877083dafd278c19a4e73357f3dd7.tar.gz emacs-e5b5b82d4eb877083dafd278c19a4e73357f3dd7.zip | |
(completion--insert-strings): Use string-width rather than length.
| -rw-r--r-- | lisp/ChangeLog | 1 | ||||
| -rw-r--r-- | lisp/minibuffer.el | 10 |
2 files changed, 7 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index bf1265a835d..6405f47dece 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | 8 | ||
| 9 | * minibuffer.el (completion-hilit-commonality): Revert last change: | 9 | * minibuffer.el (completion-hilit-commonality): Revert last change: |
| 10 | the leftover code was actually useful. | 10 | the leftover code was actually useful. |
| 11 | (completion--insert-strings): Use string-width rather than length. | ||
| 11 | 12 | ||
| 12 | 2008-05-02 Sam Steingold <sds@gnu.org> | 13 | 2008-05-02 Sam Steingold <sds@gnu.org> |
| 13 | 14 | ||
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 2890978908a..02f695e41d3 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el | |||
| @@ -578,8 +578,9 @@ It also eliminates runs of equal strings." | |||
| 578 | (let* ((length (apply 'max | 578 | (let* ((length (apply 'max |
| 579 | (mapcar (lambda (s) | 579 | (mapcar (lambda (s) |
| 580 | (if (consp s) | 580 | (if (consp s) |
| 581 | (+ (length (car s)) (length (cadr s))) | 581 | (+ (string-width (car s)) |
| 582 | (length s))) | 582 | (string-width (cadr s))) |
| 583 | (string-width s))) | ||
| 583 | strings))) | 584 | strings))) |
| 584 | (window (get-buffer-window (current-buffer) 0)) | 585 | (window (get-buffer-window (current-buffer) 0)) |
| 585 | (wwidth (if window (1- (window-width window)) 79)) | 586 | (wwidth (if window (1- (window-width window)) 79)) |
| @@ -610,8 +611,9 @@ It also eliminates runs of equal strings." | |||
| 610 | `(display (space :align-to ,column)))) | 611 | `(display (space :align-to ,column)))) |
| 611 | (when (< wwidth (+ (max colwidth | 612 | (when (< wwidth (+ (max colwidth |
| 612 | (if (consp str) | 613 | (if (consp str) |
| 613 | (+ (length (car str)) (length (cadr str))) | 614 | (+ (string-width (car str)) |
| 614 | (length str))) | 615 | (string-width (cadr str))) |
| 616 | (string-width str))) | ||
| 615 | column)) | 617 | column)) |
| 616 | (delete-char -2) (insert "\n") (setq column 0)) | 618 | (delete-char -2) (insert "\n") (setq column 0)) |
| 617 | (if (not (consp str)) | 619 | (if (not (consp str)) |