Mercurial > emacs
comparison lisp/woman.el @ 29669:50fecf68aa38
(woman-man-buffer): Fix bold and underlined CJK
characters, which use series of two ^H characters instead of one.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Thu, 15 Jun 2000 12:31:55 +0000 |
parents | eea914233f47 |
children | c7243fc7bcb6 |
comparison
equal
deleted
inserted
replaced
29668:1e6eeead2f1d | 29669:50fecf68aa38 |
---|---|
1617 ;; Squeeze multiple blank lines: | 1617 ;; Squeeze multiple blank lines: |
1618 (goto-char (point-min)) | 1618 (goto-char (point-min)) |
1619 (while (re-search-forward "^[ \t]*\n\\([ \t]*\n\\)+" nil t) | 1619 (while (re-search-forward "^[ \t]*\n\\([ \t]*\n\\)+" nil t) |
1620 (replace-match "\n" t t)) | 1620 (replace-match "\n" t t)) |
1621 | 1621 |
1622 ;; CJK characters are underlined by double-sized "__". | |
1623 ;; (Code lifted from man.el, with trivial changes.) | |
1624 (if (< (buffer-size) (position-bytes (point-max))) | |
1625 ;; Multibyte characters exist. | |
1626 (progn | |
1627 (goto-char (point-min)) | |
1628 (while (search-forward "__\b\b" nil t) | |
1629 (backward-delete-char 4) | |
1630 (woman-set-face (point) (1+ (point)) 'woman-italic-face)) | |
1631 (goto-char (point-min)) | |
1632 (while (search-forward "\b\b__" nil t) | |
1633 (backward-delete-char 4) | |
1634 (woman-set-face (1- (point)) (point) 'woman-italic-face)))) | |
1635 | |
1622 ;; Interpret overprinting to indicate bold face: | 1636 ;; Interpret overprinting to indicate bold face: |
1623 (goto-char (point-min)) | 1637 (goto-char (point-min)) |
1624 (while (re-search-forward "\\(.\\)\\(\\(\\1\\)+\\)" nil t) | 1638 (while (re-search-forward "\\(.\\)\\(\\(+\\1\\)+\\)" nil t) |
1625 (woman-delete-match 2) | 1639 (woman-delete-match 2) |
1626 (woman-set-face (1- (point)) (point) 'woman-bold-face)) | 1640 (woman-set-face (1- (point)) (point) 'woman-bold-face)) |
1627 | 1641 |
1628 ;; Interpret underlining to indicate italic face: | 1642 ;; Interpret underlining to indicate italic face: |
1629 ;; (Must be AFTER emboldening to interpret bold _ correctly!) | 1643 ;; (Must be AFTER emboldening to interpret bold _ correctly!) |