comparison lisp/info.el @ 19043:a2853a75ce57

(info-node, info-xref, info-menu-5): Define faces with defface. (Info-mode): Don't define faces here, and don't alter Info-fontify. Locally set line-move-ignore-invisible. (Info-fontify-node): Test type of frame here.
author Richard M. Stallman <rms@gnu.org>
date Wed, 30 Jul 1997 18:15:19 +0000
parents 515056981900
children 40ce8607b883
comparison
equal deleted inserted replaced
19042:e50604c01474 19043:a2853a75ce57
54 (put 'Info-enable-active-nodes 'risky-local-variable t) 54 (put 'Info-enable-active-nodes 'risky-local-variable t)
55 55
56 (defcustom Info-fontify t 56 (defcustom Info-fontify t
57 "*Non-nil enables highlighting and fonts in Info nodes." 57 "*Non-nil enables highlighting and fonts in Info nodes."
58 :type 'boolean 58 :type 'boolean
59 :group 'info)
60
61 (defface info-node
62 '((t (:bold t :italic t)))
63 "Face for Info node names."
64 :group 'info)
65
66 (defface info-menu-5
67 '((t (:underline t)))
68 "Face for the fifth and tenth `*' in an Info menu."
69 :group 'info)
70
71 (defface info-xref
72 '((t (:bold t)))
73 "Face for Info cross-references."
59 :group 'info) 74 :group 'info)
60 75
61 (defcustom Info-fontify-maximum-menu-size 30000 76 (defcustom Info-fontify-maximum-menu-size 30000
62 "*Maximum size of menu to fontify if `Info-fontify' is non-nil." 77 "*Maximum size of menu to fontify if `Info-fontify' is non-nil."
63 :type 'integer 78 :type 'integer
1784 (setq Info-tag-table-marker (make-marker)) 1799 (setq Info-tag-table-marker (make-marker))
1785 (make-local-variable 'Info-tag-table-buffer) 1800 (make-local-variable 'Info-tag-table-buffer)
1786 (setq Info-tag-table-buffer nil) 1801 (setq Info-tag-table-buffer nil)
1787 (make-local-variable 'Info-history) 1802 (make-local-variable 'Info-history)
1788 (make-local-variable 'Info-index-alternatives) 1803 (make-local-variable 'Info-index-alternatives)
1789 (if (memq (framep (selected-frame)) '(x pc w32)) 1804 ;; This is for the sake of the invisible text we use handling titles.
1790 (progn 1805 (make-local-variable 'line-move-ignore-invisible)
1791 (make-face 'info-node) 1806 (setq line-move-ignore-invisible t)
1792 (make-face 'info-menu-5)
1793 (make-face 'info-xref)
1794 (or (face-differs-from-default-p 'info-node)
1795 (if (face-differs-from-default-p 'bold-italic)
1796 (copy-face 'bold-italic 'info-node)
1797 (copy-face 'bold 'info-node)))
1798 (or (face-differs-from-default-p 'info-menu-5)
1799 (set-face-underline-p 'info-menu-5 t))
1800 (or (face-differs-from-default-p 'info-xref)
1801 (copy-face 'bold 'info-xref)))
1802 (setq Info-fontify nil))
1803 (Info-set-mode-line) 1807 (Info-set-mode-line)
1804 (run-hooks 'Info-mode-hook)) 1808 (run-hooks 'Info-mode-hook))
1805 1809
1806 (defvar Info-edit-map nil 1810 (defvar Info-edit-map nil
1807 "Local keymap used within `e' command of Info.") 1811 "Local keymap used within `e' command of Info.")
1986 (while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*+\\|=+\\|-+\\)$" 1990 (while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*+\\|=+\\|-+\\)$"
1987 nil t) 1991 nil t)
1988 (put-text-property (match-beginning 1) (match-end 1) 1992 (put-text-property (match-beginning 1) (match-end 1)
1989 'face 1993 'face
1990 (cdr (assq (preceding-char) Info-title-face-alist))) 1994 (cdr (assq (preceding-char) Info-title-face-alist)))
1991 (put-text-property (match-end 1) (match-end 2) 1995 ;; This is a serious problem for trying to handle multiple
1992 'invisible t)) 1996 ;; frame types at once. We want this text to be invisible
1997 ;; on frames that can display the font above.
1998 (if (memq (framep (selected-frame)) '(x pc w32))
1999 (put-text-property (match-end 1) (match-end 2)
2000 'invisible t)))
1993 (goto-char (point-min)) 2001 (goto-char (point-min))
1994 (while (re-search-forward "\\*Note[ \n\t]+\\([^:]*\\):" nil t) 2002 (while (re-search-forward "\\*Note[ \n\t]+\\([^:]*\\):" nil t)
1995 (if (= (char-after (1- (match-beginning 0))) ?\") ; hack 2003 (if (= (char-after (1- (match-beginning 0))) ?\") ; hack
1996 nil 2004 nil
1997 (put-text-property (match-beginning 1) (match-end 1) 2005 (put-text-property (match-beginning 1) (match-end 1)