Fix bold or underline of underscores (bug#78839)
* lisp/man.el (Man-fontify-manpage): Fix the "_\b_" case.
This commit is contained in:
parent
4607d3e426
commit
00b8d11ac8
1 changed files with 14 additions and 7 deletions
21
lisp/man.el
21
lisp/man.el
|
|
@ -1379,17 +1379,24 @@ Same for the ANSI bold and normal escape sequences."
|
|||
(put-text-property (1- (point)) (point)
|
||||
'font-lock-face 'Man-underline))))
|
||||
(goto-char (point-min))
|
||||
(while (and (search-forward "_\b" nil t) (not (eobp)))
|
||||
(delete-char -2)
|
||||
(put-text-property (point) (1+ (point)) 'font-lock-face 'Man-underline))
|
||||
(goto-char (point-min))
|
||||
(while (search-forward "\b_" nil t)
|
||||
(delete-char -2)
|
||||
(while (and (re-search-forward "_\b\\([^_]\\)" nil t) (not (eobp)))
|
||||
(replace-match "\\1")
|
||||
(put-text-property (1- (point)) (point) 'font-lock-face 'Man-underline))
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "\\(.\\)\\(\b+\\1\\)+" nil t)
|
||||
(while (re-search-forward "\\([^_]\\)\b_" nil t)
|
||||
(replace-match "\\1")
|
||||
(put-text-property (1- (point)) (point) 'font-lock-face 'Man-underline))
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "\\([^_]\\)\\(\b+\\1\\)+" nil t)
|
||||
(replace-match "\\1")
|
||||
(put-text-property (1- (point)) (point) 'font-lock-face 'Man-overstrike))
|
||||
;; Special case for "__": is it an underlined underscore or a bold
|
||||
;; underscore? Look at the face after it to know.
|
||||
(goto-char (point-min))
|
||||
(while (search-forward "_\b_" nil t)
|
||||
(delete-char -2)
|
||||
(let ((face (get-text-property (point) 'font-lock-face)))
|
||||
(put-text-property (1- (point)) (point) 'font-lock-face face)))
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "o\b\\+\\|\\+\bo" nil t)
|
||||
(replace-match "o")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue