(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))
+ (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 (search-forward "\b_" nil t)
- (delete-char -2)
+ (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)
+ (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 "_\b_": 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")