aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorDrew Adams2019-06-25 14:53:05 +0200
committerLars Ingebrigtsen2019-06-25 14:53:52 +0200
commit72963b4e82eef5767e3172f28bd9bd97f487c98a (patch)
treeba367ad7574059a5da59d4442a5d67c01c772ae0 /lisp
parente9b05221abc7c8b440072d6600691017ffda5015 (diff)
downloademacs-72963b4e82eef5767e3172f28bd9bd97f487c98a.tar.gz
emacs-72963b4e82eef5767e3172f28bd9bd97f487c98a.zip
Fontify _emphasis_ in info nodes
* lisp/info.el (Info-fontify-node): Fontify _emphasis_ (bug#23798). (info-emphasis): New face.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/info.el17
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.")
136 :version "22.1" 136 :version "22.1"
137 :group 'info) 137 :group 'info)
138 138
139(defface info-emphasis
140 '((t (:inherit italic)))
141 "*Face for emphasized text (enclosed with underscores)."
142 :version "25.1"
143 :group 'info)
144
139(defcustom Info-fontify-visited-nodes t 145(defcustom Info-fontify-visited-nodes t
140 "Non-nil to fontify references to visited nodes in `info-xref-visited' face." 146 "Non-nil to fontify references to visited nodes in `info-xref-visited' face."
141 :version "22.1" 147 :version "22.1"
@@ -4688,6 +4694,17 @@ first line or header line, and for breadcrumb links.")
4688 (put-text-property (match-beginning 1) (match-end 1) 4694 (put-text-property (match-beginning 1) (match-end 1)
4689 'invisible t))))))) 4695 'invisible t)))))))
4690 4696
4697 ;; Fontify emphasis: _..._
4698 (goto-char (point-min))
4699 (when (and font-lock-mode not-fontified-p)
4700 (while (re-search-forward "_\\(\\sw+\\)_" nil t)
4701 (add-text-properties (match-beginning 0) (1+ (match-beginning 0))
4702 '(invisible t front-sticky nil rear-nonsticky t))
4703 (add-text-properties (1- (match-end 0)) (match-end 0)
4704 '(invisible t front-sticky nil rear-nonsticky t))
4705 (put-text-property (match-beginning 1) (match-end 1)
4706 'font-lock-face 'info-emphasis)))
4707
4691 ;; Fontify titles 4708 ;; Fontify titles
4692 (goto-char (point-min)) 4709 (goto-char (point-min))
4693 (when (and font-lock-mode not-fontified-p) 4710 (when (and font-lock-mode not-fontified-p)