diff options
| author | Colin Walters | 2002-05-21 22:22:10 +0000 |
|---|---|---|
| committer | Colin Walters | 2002-05-21 22:22:10 +0000 |
| commit | 544e5562dca591883197d29480768dcbfca8a407 (patch) | |
| tree | 922d08cb4c60b2cb7a14050994810991df23712d | |
| parent | 2fdd365daacd5107fd4ff58911d20393e91e1320 (diff) | |
| download | emacs-544e5562dca591883197d29480768dcbfca8a407.tar.gz emacs-544e5562dca591883197d29480768dcbfca8a407.zip | |
(Info-fontify): Deleted.
(Info-select-node): Don't use it.
(Info-mode-hook): New variable.
(Info-mode): Set up categories.
(Info-fontify-menu-headers, Info-fontify-node): Use categories.
| -rw-r--r-- | lisp/info.el | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/lisp/info.el b/lisp/info.el index b8e91cc431b..f81e53690d4 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -55,11 +55,6 @@ because that gives you a printed manual as well." | |||
| 55 | The Lisp code is executed when the node is selected.") | 55 | The Lisp code is executed when the node is selected.") |
| 56 | (put 'Info-enable-active-nodes 'risky-local-variable t) | 56 | (put 'Info-enable-active-nodes 'risky-local-variable t) |
| 57 | 57 | ||
| 58 | (defcustom Info-fontify t | ||
| 59 | "*Non-nil enables highlighting and fonts in Info nodes." | ||
| 60 | :type 'boolean | ||
| 61 | :group 'info) | ||
| 62 | |||
| 63 | (defface info-node | 58 | (defface info-node |
| 64 | '((((class color) (background light)) (:foreground "brown" :weight bold :slant italic)) | 59 | '((((class color) (background light)) (:foreground "brown" :weight bold :slant italic)) |
| 65 | (((class color) (background dark)) (:foreground "white" :weight bold :slant italic)) | 60 | (((class color) (background dark)) (:foreground "white" :weight bold :slant italic)) |
| @@ -150,6 +145,11 @@ when you hit the end of the current node." | |||
| 150 | :type 'boolean | 145 | :type 'boolean |
| 151 | :group 'info) | 146 | :group 'info) |
| 152 | 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 | 153 | (defvar Info-current-file nil |
| 154 | "Info file that Info is now looking at, or nil. | 154 | "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. | 155 | This is the name that was specified in Info, not the actual file name. |
| @@ -997,7 +997,7 @@ Bind this in case the user sets it to nil." | |||
| 997 | (read (current-buffer)))))) | 997 | (read (current-buffer)))))) |
| 998 | (point-max))) | 998 | (point-max))) |
| 999 | (if Info-enable-active-nodes (eval active-expression)) | 999 | (if Info-enable-active-nodes (eval active-expression)) |
| 1000 | (if Info-fontify (Info-fontify-node)) | 1000 | (Info-fontify-node) |
| 1001 | (if Info-use-header-line | 1001 | (if Info-use-header-line |
| 1002 | (Info-setup-header-line) | 1002 | (Info-setup-header-line) |
| 1003 | (setq Info-header-line nil) | 1003 | (setq Info-header-line nil) |
| @@ -2340,6 +2340,16 @@ Advanced commands: | |||
| 2340 | (setq Info-tag-table-marker (make-marker)) | 2340 | (setq Info-tag-table-marker (make-marker)) |
| 2341 | (make-local-variable 'Info-tag-table-buffer) | 2341 | (make-local-variable 'Info-tag-table-buffer) |
| 2342 | (setq Info-tag-table-buffer nil) | 2342 | (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))) | ||
| 2343 | (make-local-variable 'Info-history) | 2353 | (make-local-variable 'Info-history) |
| 2344 | (make-local-variable 'Info-index-alternatives) | 2354 | (make-local-variable 'Info-index-alternatives) |
| 2345 | (set (make-local-variable 'tool-bar-map) info-tool-bar-map) | 2355 | (set (make-local-variable 'tool-bar-map) info-tool-bar-map) |
| @@ -2587,10 +2597,10 @@ the variable `Info-file-list-for-emacs'." | |||
| 2587 | (goto-char (point-min)) | 2597 | (goto-char (point-min)) |
| 2588 | (when (re-search-forward "\\* Menu:" nil t) | 2598 | (when (re-search-forward "\\* Menu:" nil t) |
| 2589 | (put-text-property (match-beginning 0) (match-end 0) | 2599 | (put-text-property (match-beginning 0) (match-end 0) |
| 2590 | 'face 'info-menu-header) | 2600 | 'category 'info-menu-header) |
| 2591 | (while (re-search-forward "\n\n\\([^*\n ].*\\)\n\n?[*]" nil t) | 2601 | (while (re-search-forward "\n\n\\([^*\n ].*\\)\n\n?[*]" nil t) |
| 2592 | (put-text-property (match-beginning 1) (match-end 1) | 2602 | (put-text-property (match-beginning 1) (match-end 1) |
| 2593 | 'face 'info-menu-header))))) | 2603 | 'category 'info-menu-header))))) |
| 2594 | 2604 | ||
| 2595 | (defun Info-fontify-node () | 2605 | (defun Info-fontify-node () |
| 2596 | ;; Only fontify the node if it hasn't already been done. [We pass in | 2606 | ;; Only fontify the node if it hasn't already been done. [We pass in |
| @@ -2618,8 +2628,8 @@ the variable `Info-file-list-for-emacs'." | |||
| 2618 | (tbeg (match-beginning 1)) | 2628 | (tbeg (match-beginning 1)) |
| 2619 | (tag (buffer-substring tbeg (match-end 1)))) | 2629 | (tag (buffer-substring tbeg (match-end 1)))) |
| 2620 | (if (string-equal tag "Node") | 2630 | (if (string-equal tag "Node") |
| 2621 | (put-text-property nbeg nend 'face 'info-header-node) | 2631 | (put-text-property nbeg nend 'category 'info-header-node) |
| 2622 | (put-text-property nbeg nend 'face 'info-header-xref) | 2632 | (put-text-property nbeg nend 'category 'info-header-xref) |
| 2623 | (put-text-property tbeg nend 'mouse-face 'highlight) | 2633 | (put-text-property tbeg nend 'mouse-face 'highlight) |
| 2624 | (put-text-property tbeg nend | 2634 | (put-text-property tbeg nend |
| 2625 | 'help-echo | 2635 | 'help-echo |
| @@ -2646,14 +2656,14 @@ the variable `Info-file-list-for-emacs'." | |||
| 2646 | (goto-char (point-min)) | 2656 | (goto-char (point-min)) |
| 2647 | (while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*+\\|=+\\|-+\\|\\.+\\)$" | 2657 | (while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*+\\|=+\\|-+\\|\\.+\\)$" |
| 2648 | nil t) | 2658 | nil t) |
| 2649 | (let ((c (preceding-char)) | 2659 | (let* ((c (preceding-char)) |
| 2650 | face) | 2660 | (category |
| 2651 | (cond ((= c ?*) (setq face 'Info-title-1-face)) | 2661 | (cond ((= c ?*) 'Info-title-1-face) |
| 2652 | ((= c ?=) (setq face 'Info-title-2-face)) | 2662 | ((= c ?=) 'Info-title-2-face) |
| 2653 | ((= c ?-) (setq face 'Info-title-3-face)) | 2663 | ((= c ?-) 'Info-title-3-face) |
| 2654 | (t (setq face 'Info-title-4-face))) | 2664 | (t 'Info-title-4-face)))) |
| 2655 | (put-text-property (match-beginning 1) (match-end 1) | 2665 | (put-text-property (match-beginning 1) (match-end 1) |
| 2656 | 'face face)) | 2666 | 'category category)) |
| 2657 | ;; This is a serious problem for trying to handle multiple | 2667 | ;; This is a serious problem for trying to handle multiple |
| 2658 | ;; frame types at once. We want this text to be invisible | 2668 | ;; frame types at once. We want this text to be invisible |
| 2659 | ;; on frames that can display the font above. | 2669 | ;; on frames that can display the font above. |
| @@ -2665,7 +2675,7 @@ the variable `Info-file-list-for-emacs'." | |||
| 2665 | (if (= (char-after (1- (match-beginning 0))) ?\") ; hack | 2675 | (if (= (char-after (1- (match-beginning 0))) ?\") ; hack |
| 2666 | nil | 2676 | nil |
| 2667 | (add-text-properties (match-beginning 1) (match-end 1) | 2677 | (add-text-properties (match-beginning 1) (match-end 1) |
| 2668 | '(face info-xref | 2678 | '(category info-xref |
| 2669 | mouse-face highlight | 2679 | mouse-face highlight |
| 2670 | help-echo "mouse-2: go to this node")))) | 2680 | help-echo "mouse-2: go to this node")))) |
| 2671 | (goto-char (point-min)) | 2681 | (goto-char (point-min)) |
| @@ -2679,9 +2689,9 @@ the variable `Info-file-list-for-emacs'." | |||
| 2679 | (if (zerop (% n 3)) ; visual aids to help with 1-9 keys | 2689 | (if (zerop (% n 3)) ; visual aids to help with 1-9 keys |
| 2680 | (put-text-property (match-beginning 0) | 2690 | (put-text-property (match-beginning 0) |
| 2681 | (1+ (match-beginning 0)) | 2691 | (1+ (match-beginning 0)) |
| 2682 | 'face 'info-menu-5)) | 2692 | 'category 'info-menu-5)) |
| 2683 | (add-text-properties (match-beginning 1) (match-end 1) | 2693 | (add-text-properties (match-beginning 1) (match-end 1) |
| 2684 | '(face info-xref | 2694 | '(category info-xref |
| 2685 | mouse-face highlight | 2695 | mouse-face highlight |
| 2686 | help-echo "mouse-2: go to this node"))))) | 2696 | help-echo "mouse-2: go to this node"))))) |
| 2687 | (Info-fontify-menu-headers) | 2697 | (Info-fontify-menu-headers) |