diff options
| author | Drew Adams <drew.adams@oracle.com> | 2019-06-25 14:53:05 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen <larsi@gnus.org> | 2019-06-25 14:53:52 +0200 |
| commit | 72963b4e82eef5767e3172f28bd9bd97f487c98a (patch) | |
| tree | ba367ad7574059a5da59d4442a5d67c01c772ae0 | |
| parent | e9b05221abc7c8b440072d6600691017ffda5015 (diff) | |
| download | emacs-72963b4e82eef5767e3172f28bd9bd97f487c98a.tar.gz | |
Fontify _emphasis_ in info nodes
* lisp/info.el (Info-fontify-node): Fontify _emphasis_ (bug#23798).
(info-emphasis): New face.
| -rw-r--r-- | lisp/info.el | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lisp/info.el b/lisp/info.el index c211887a39a..9ecb187e958 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -136,6 +136,12 @@ The Lisp code is executed when the node is selected.") :version "22.1" :group 'info) +(defface info-emphasis + '((t (:inherit italic))) + "*Face for emphasized text (enclosed with underscores)." + :version "25.1" + :group 'info) + (defcustom Info-fontify-visited-nodes t "Non-nil to fontify references to visited nodes in `info-xref-visited' face." :version "22.1" @@ -4688,6 +4694,17 @@ first line or header line, and for breadcrumb links.") (put-text-property (match-beginning 1) (match-end 1) 'invisible t))))))) + ;; Fontify emphasis: _..._ + (goto-char (point-min)) + (when (and font-lock-mode not-fontified-p) + (while (re-search-forward "_\\(\\sw+\\)_" nil t) + (add-text-properties (match-beginning 0) (1+ (match-beginning 0)) + '(invisible t front-sticky nil rear-nonsticky t)) + (add-text-properties (1- (match-end 0)) (match-end 0) + '(invisible t front-sticky nil rear-nonsticky t)) + (put-text-property (match-beginning 1) (match-end 1) + 'font-lock-face 'info-emphasis))) + ;; Fontify titles (goto-char (point-min)) (when (and font-lock-mode not-fontified-p) |
