aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/man.el19
1 files changed, 13 insertions, 6 deletions
diff --git a/lisp/man.el b/lisp/man.el
index 397162a7ad1..9e1d294b1ec 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -1379,17 +1379,24 @@ Same for the ANSI bold and normal escape sequences."
1379 (put-text-property (1- (point)) (point) 1379 (put-text-property (1- (point)) (point)
1380 'font-lock-face 'Man-underline)))) 1380 'font-lock-face 'Man-underline))))
1381 (goto-char (point-min)) 1381 (goto-char (point-min))
1382 (while (and (search-forward "_\b" nil t) (not (eobp))) 1382 (while (and (re-search-forward "_\b\\([^_]\\)" nil t) (not (eobp)))
1383 (delete-char -2) 1383 (replace-match "\\1")
1384 (put-text-property (point) (1+ (point)) 'font-lock-face 'Man-underline)) 1384 (put-text-property (1- (point)) (point) 'font-lock-face 'Man-underline))
1385 (goto-char (point-min)) 1385 (goto-char (point-min))
1386 (while (search-forward "\b_" nil t) 1386 (while (re-search-forward "\\([^_]\\)\b_" nil t)
1387 (delete-char -2) 1387 (replace-match "\\1")
1388 (put-text-property (1- (point)) (point) 'font-lock-face 'Man-underline)) 1388 (put-text-property (1- (point)) (point) 'font-lock-face 'Man-underline))
1389 (goto-char (point-min)) 1389 (goto-char (point-min))
1390 (while (re-search-forward "\\(.\\)\\(\b+\\1\\)+" nil t) 1390 (while (re-search-forward "\\([^_]\\)\\(\b+\\1\\)+" nil t)
1391 (replace-match "\\1") 1391 (replace-match "\\1")
1392 (put-text-property (1- (point)) (point) 'font-lock-face 'Man-overstrike)) 1392 (put-text-property (1- (point)) (point) 'font-lock-face 'Man-overstrike))
1393 ;; Special case for "__": is it an underlined underscore or a bold
1394 ;; underscore? Look at the face after it to know.
1395 (goto-char (point-min))
1396 (while (search-forward "_\b_" nil t)
1397 (delete-char -2)
1398 (let ((face (get-text-property (point) 'font-lock-face)))
1399 (put-text-property (1- (point)) (point) 'font-lock-face face)))
1393 (goto-char (point-min)) 1400 (goto-char (point-min))
1394 (while (re-search-forward "o\b\\+\\|\\+\bo" nil t) 1401 (while (re-search-forward "o\b\\+\\|\\+\bo" nil t)
1395 (replace-match "o") 1402 (replace-match "o")