55 |
The Lisp code is executed when the node is selected.") |
The Lisp code is executed when the node is selected.") |
56 |
(put 'Info-enable-active-nodes 'risky-local-variable t) |
(put 'Info-enable-active-nodes 'risky-local-variable t) |
57 |
|
|
|
(defcustom Info-fontify t |
|
|
"*Non-nil enables highlighting and fonts in Info nodes." |
|
|
:type 'boolean |
|
|
:group 'info) |
|
|
|
|
58 |
(defface info-node |
(defface info-node |
59 |
'((((class color) (background light)) (:foreground "brown" :weight bold :slant italic)) |
'((((class color) (background light)) (:foreground "brown" :weight bold :slant italic)) |
60 |
(((class color) (background dark)) (:foreground "white" :weight bold :slant italic)) |
(((class color) (background dark)) (:foreground "white" :weight bold :slant italic)) |
145 |
:type 'boolean |
:type 'boolean |
146 |
:group 'info) |
:group 'info) |
147 |
|
|
148 |
|
(defcustom Info-mode-hook '(font-lock-mode) |
149 |
|
"Hooks run when `info-mode' is called." |
150 |
|
:type 'hook |
151 |
|
:group 'info) |
152 |
|
|
153 |
(defvar Info-current-file nil |
(defvar Info-current-file nil |
154 |
"Info file that Info is now looking at, or nil. |
"Info file that Info is now looking at, or nil. |
155 |
This is the name that was specified in Info, not the actual file name. |
This is the name that was specified in Info, not the actual file name. |
997 |
(read (current-buffer)))))) |
(read (current-buffer)))))) |
998 |
(point-max))) |
(point-max))) |
999 |
(if Info-enable-active-nodes (eval active-expression)) |
(if Info-enable-active-nodes (eval active-expression)) |
1000 |
(if Info-fontify (Info-fontify-node)) |
(Info-fontify-node) |
1001 |
(if Info-use-header-line |
(if Info-use-header-line |
1002 |
(Info-setup-header-line) |
(Info-setup-header-line) |
1003 |
(setq Info-header-line nil) |
(setq Info-header-line nil) |
2340 |
(setq Info-tag-table-marker (make-marker)) |
(setq Info-tag-table-marker (make-marker)) |
2341 |
(make-local-variable 'Info-tag-table-buffer) |
(make-local-variable 'Info-tag-table-buffer) |
2342 |
(setq Info-tag-table-buffer nil) |
(setq Info-tag-table-buffer nil) |
2343 |
|
(set (make-local-variable 'font-lock-category-alist) |
2344 |
|
'((info-menu-header . info-menu-header) |
2345 |
|
(info-header-node . info-header-node) |
2346 |
|
(info-header-xref . info-header-xref) |
2347 |
|
(Info-title-1-face . Info-title-1-face) |
2348 |
|
(Info-title-2-face . Info-title-2-face) |
2349 |
|
(Info-title-3-face . Info-title-3-face) |
2350 |
|
(Info-title-4-face . Info-title-4-face) |
2351 |
|
(info-menu-5 . info-menu-5) |
2352 |
|
(info-xref . info-xref))) |
2353 |
(make-local-variable 'Info-history) |
(make-local-variable 'Info-history) |
2354 |
(make-local-variable 'Info-index-alternatives) |
(make-local-variable 'Info-index-alternatives) |
2355 |
(set (make-local-variable 'tool-bar-map) info-tool-bar-map) |
(set (make-local-variable 'tool-bar-map) info-tool-bar-map) |
2597 |
(goto-char (point-min)) |
(goto-char (point-min)) |
2598 |
(when (re-search-forward "\\* Menu:" nil t) |
(when (re-search-forward "\\* Menu:" nil t) |
2599 |
(put-text-property (match-beginning 0) (match-end 0) |
(put-text-property (match-beginning 0) (match-end 0) |
2600 |
'face 'info-menu-header) |
'category 'info-menu-header) |
2601 |
(while (re-search-forward "\n\n\\([^*\n ].*\\)\n\n?[*]" nil t) |
(while (re-search-forward "\n\n\\([^*\n ].*\\)\n\n?[*]" nil t) |
2602 |
(put-text-property (match-beginning 1) (match-end 1) |
(put-text-property (match-beginning 1) (match-end 1) |
2603 |
'face 'info-menu-header))))) |
'category 'info-menu-header))))) |
2604 |
|
|
2605 |
(defun Info-fontify-node () |
(defun Info-fontify-node () |
2606 |
;; Only fontify the node if it hasn't already been done. [We pass in |
;; Only fontify the node if it hasn't already been done. [We pass in |
2628 |
(tbeg (match-beginning 1)) |
(tbeg (match-beginning 1)) |
2629 |
(tag (buffer-substring tbeg (match-end 1)))) |
(tag (buffer-substring tbeg (match-end 1)))) |
2630 |
(if (string-equal tag "Node") |
(if (string-equal tag "Node") |
2631 |
(put-text-property nbeg nend 'face 'info-header-node) |
(put-text-property nbeg nend 'category 'info-header-node) |
2632 |
(put-text-property nbeg nend 'face 'info-header-xref) |
(put-text-property nbeg nend 'category 'info-header-xref) |
2633 |
(put-text-property tbeg nend 'mouse-face 'highlight) |
(put-text-property tbeg nend 'mouse-face 'highlight) |
2634 |
(put-text-property tbeg nend |
(put-text-property tbeg nend |
2635 |
'help-echo |
'help-echo |
2656 |
(goto-char (point-min)) |
(goto-char (point-min)) |
2657 |
(while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*+\\|=+\\|-+\\|\\.+\\)$" |
(while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*+\\|=+\\|-+\\|\\.+\\)$" |
2658 |
nil t) |
nil t) |
2659 |
(let ((c (preceding-char)) |
(let* ((c (preceding-char)) |
2660 |
face) |
(category |
2661 |
(cond ((= c ?*) (setq face 'Info-title-1-face)) |
(cond ((= c ?*) 'Info-title-1-face) |
2662 |
((= c ?=) (setq face 'Info-title-2-face)) |
((= c ?=) 'Info-title-2-face) |
2663 |
((= c ?-) (setq face 'Info-title-3-face)) |
((= c ?-) 'Info-title-3-face) |
2664 |
(t (setq face 'Info-title-4-face))) |
(t 'Info-title-4-face)))) |
2665 |
(put-text-property (match-beginning 1) (match-end 1) |
(put-text-property (match-beginning 1) (match-end 1) |
2666 |
'face face)) |
'category category)) |
2667 |
;; This is a serious problem for trying to handle multiple |
;; This is a serious problem for trying to handle multiple |
2668 |
;; frame types at once. We want this text to be invisible |
;; frame types at once. We want this text to be invisible |
2669 |
;; on frames that can display the font above. |
;; on frames that can display the font above. |
2675 |
(if (= (char-after (1- (match-beginning 0))) ?\") ; hack |
(if (= (char-after (1- (match-beginning 0))) ?\") ; hack |
2676 |
nil |
nil |
2677 |
(add-text-properties (match-beginning 1) (match-end 1) |
(add-text-properties (match-beginning 1) (match-end 1) |
2678 |
'(face info-xref |
'(category info-xref |
2679 |
mouse-face highlight |
mouse-face highlight |
2680 |
help-echo "mouse-2: go to this node")))) |
help-echo "mouse-2: go to this node")))) |
2681 |
(goto-char (point-min)) |
(goto-char (point-min)) |
2689 |
(if (zerop (% n 3)) ; visual aids to help with 1-9 keys |
(if (zerop (% n 3)) ; visual aids to help with 1-9 keys |
2690 |
(put-text-property (match-beginning 0) |
(put-text-property (match-beginning 0) |
2691 |
(1+ (match-beginning 0)) |
(1+ (match-beginning 0)) |
2692 |
'face 'info-menu-5)) |
'category 'info-menu-5)) |
2693 |
(add-text-properties (match-beginning 1) (match-end 1) |
(add-text-properties (match-beginning 1) (match-end 1) |
2694 |
'(face info-xref |
'(category info-xref |
2695 |
mouse-face highlight |
mouse-face highlight |
2696 |
help-echo "mouse-2: go to this node"))))) |
help-echo "mouse-2: go to this node"))))) |
2697 |
(Info-fontify-menu-headers) |
(Info-fontify-menu-headers) |