changeset 13084:805486dfbc82

(Info-title-face-alist): New var. (Info-fontify-node): Check for headings that are `underlined' with characters on the following line.
author Karl Heuer <kwzh@gnu.org>
date Mon, 25 Sep 1995 18:58:51 +0000
parents 16638ebb209f
children 5be0696ddc1e
files lisp/info.el
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/info.el	Mon Sep 25 18:46:19 1995 +0000
+++ b/lisp/info.el	Mon Sep 25 18:58:51 1995 +0000
@@ -1745,6 +1745,13 @@
 	  (t
 	   (Info-goto-emacs-command-node command)))))
 
+(defvar Info-title-face-alist
+  '((?* bold underline)
+    (?= bold-italic underline)
+    (?- italic underline))
+  "*Alist of face or list of faces to use for pseudo-underlined titles.
+The alist key is the character the title is underlined with (?*, ?= or ?-).")
+
 (defun Info-fontify-node ()
   (save-excursion
     (let ((buffer-read-only nil))
@@ -1760,6 +1767,14 @@
 	      (put-text-property (match-beginning 1) (match-end 1)
 				 'mouse-face 'highlight))))
       (goto-char (point-min))
+      (while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*+\\|=+\\|-+\\)$"
+				 nil t)
+	(put-text-property (match-beginning 1) (match-end 1)
+			   'face
+			   (assq (preceding-char) Info-title-face-alist))
+	(put-text-property (match-end 1) (match-end 2)
+			   'invisible t))
+      (goto-char (point-min))
       (while (re-search-forward "\\*Note[ \n\t]+\\([^:]*\\):" nil t)
 	(if (= (char-after (1- (match-beginning 0))) ?\") ; hack
 	    nil