mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-30 12:21:25 -08:00
Fontify _emphasis_ in info nodes
* lisp/info.el (Info-fontify-node): Fontify _emphasis_ (bug#23798). (info-emphasis): New face.
This commit is contained in:
parent
e9b05221ab
commit
72963b4e82
1 changed files with 17 additions and 0 deletions
17
lisp/info.el
17
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue