From a0dd66efd0b0a97420ee45561831e9c516f67fc3 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 15 Jun 2000 12:31:55 +0000 Subject: [PATCH] (woman-man-buffer): Fix bold and underlined CJK characters, which use series of two ^H characters instead of one. --- lisp/woman.el | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lisp/woman.el b/lisp/woman.el index dd1a37d296e..b6614992eb9 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -1619,9 +1619,23 @@ Do not call directly!" (while (re-search-forward "^[ \t]*\n\\([ \t]*\n\\)+" nil t) (replace-match "\n" t t)) + ;; CJK characters are underlined by double-sized "__". + ;; (Code lifted from man.el, with trivial changes.) + (if (< (buffer-size) (position-bytes (point-max))) + ;; Multibyte characters exist. + (progn + (goto-char (point-min)) + (while (search-forward "__\b\b" nil t) + (backward-delete-char 4) + (woman-set-face (point) (1+ (point)) 'woman-italic-face)) + (goto-char (point-min)) + (while (search-forward "\b\b__" nil t) + (backward-delete-char 4) + (woman-set-face (1- (point)) (point) 'woman-italic-face)))) + ;; Interpret overprinting to indicate bold face: (goto-char (point-min)) - (while (re-search-forward "\\(.\\)\\(\\(\\1\\)+\\)" nil t) + (while (re-search-forward "\\(.\\)\\(\\(+\\1\\)+\\)" nil t) (woman-delete-match 2) (woman-set-face (1- (point)) (point) 'woman-bold-face)) -- 2.39.5