From 99c9ed12a0d074be5c49e7b58f2328ab771d7336 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 1 Dec 1999 08:21:31 +0000 Subject: [PATCH] (article-treat-overstrike): Work for multibyte char with old Emacsen as well. --- lisp/gnus-art.el | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 1ee61f9..9a412a9 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -1418,23 +1418,29 @@ MAP is an alist where the elements are on the form (\"from\" \"to\")." (let ((buffer-read-only nil)) (while (search-forward "\b" nil t) (let ((next (char-after)) - (previous (char-after (- (point) 2)))) + start end previous) + (backward-char 2) + (setq start (point) + previous (char-after)) + (forward-char 3) + (setq end (point)) + (backward-char) ;; We do the boldification/underlining by hiding the ;; overstrikes and putting the proper text property ;; on the letters. (cond ((eq next previous) - (gnus-article-hide-text-type (- (point) 2) (point) 'overstrike) - (put-text-property (point) (1+ (point)) 'face 'bold)) + (gnus-article-hide-text-type start (point) 'overstrike) + (put-text-property (point) end 'face 'bold)) ((eq next ?_) (gnus-article-hide-text-type (1- (point)) (1+ (point)) 'overstrike) (put-text-property - (- (point) 2) (1- (point)) 'face 'underline)) + start (1- (point)) 'face 'underline)) ((eq previous ?_) - (gnus-article-hide-text-type (- (point) 2) (point) 'overstrike) + (gnus-article-hide-text-type start (point) 'overstrike) (put-text-property - (point) (1+ (point)) 'face 'underline))))))))) + (point) end 'face 'underline))))))))) (defun article-fill-long-lines () "Fill lines that are wider than the window width." -- 1.7.10.4