From 1301d1a9b8236ba06236b50e82da6ad6c87865dd Mon Sep 17 00:00:00 2001 From: Katsumi Yamaoka Date: Wed, 22 Dec 2004 03:27:58 +0000 Subject: [PATCH] (gnus-spec-tab): Make a Lisp form which works correctly even if there are wide characters. --- lisp/ChangeLog | 5 +++++ lisp/gnus-spec.el | 22 ++++++++-------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e223d2496..4b7f73571 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-12-22 Katsumi Yamaoka + + * gnus-spec.el (gnus-spec-tab): Make a Lisp form which works + correctly even if there are wide characters. + 2004-12-21 Teodor Zlatanov * spam.el (spam-check-BBDB): fix the BBDB caching code to use diff --git a/lisp/gnus-spec.el b/lisp/gnus-spec.el index cd8a36fff..8a69b9bb4 100644 --- a/lisp/gnus-spec.el +++ b/lisp/gnus-spec.el @@ -281,21 +281,15 @@ Return a list of updated types." (defun gnus-spec-tab (column) (if (> column 0) - `(insert (make-string (max (- ,column (current-column)) 0) ? )) + `(insert-char ? (max (- ,column (current-column)) 0)) (let ((column (abs column))) - (if gnus-use-correct-string-widths - `(progn - (if (> (current-column) ,column) - (while (progn - (delete-backward-char 1) - (> (current-column) ,column)))) - (insert (make-string (max (- ,column (current-column)) 0) ? ))) - `(progn - (if (> (current-column) ,column) - (delete-region (point) - (- (point) (- (current-column) ,column))) - (insert (make-string (max (- ,column (current-column)) 0) - ? )))))))) + `(if (> (current-column) ,column) + (let ((end (point))) + (if (= (move-to-column ,column) ,column) + (delete-region (point) end) + (delete-region (1- (point)) end) + (insert " "))) + (insert-char ? (max (- ,column (current-column)) 0)))))) (defun gnus-correct-length (string) "Return the correct width of STRING." -- 2.25.1