# HG changeset patch # User Eli Zaretskii # Date 961072315 0 # Node ID 50fecf68aa38b1dba0080d70754cd57d064489ff # Parent 1e6eeead2f1d67f53bb63fcd3e173076bda7d8f3 (woman-man-buffer): Fix bold and underlined CJK characters, which use series of two ^H characters instead of one. diff -r 1e6eeead2f1d -r 50fecf68aa38 lisp/woman.el --- a/lisp/woman.el Thu Jun 15 12:20:34 2000 +0000 +++ b/lisp/woman.el Thu Jun 15 12:31:55 2000 +0000 @@ -1619,9 +1619,23 @@ (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))