diff options
| author | Miles Bader | 2001-10-10 14:39:23 +0000 |
|---|---|---|
| committer | Miles Bader | 2001-10-10 14:39:23 +0000 |
| commit | 07becdb1973bdeb055eedb959d7f10abe36b574b (patch) | |
| tree | b77688256552e7aa5f689baed1f374399155b718 | |
| parent | 619632ac2a224fcf33da4f4b1fa52b892524b0c9 (diff) | |
| download | emacs-07becdb1973bdeb055eedb959d7f10abe36b574b.tar.gz emacs-07becdb1973bdeb055eedb959d7f10abe36b574b.zip | |
(Info-insert-dir): Don't call `Info-fontify-menu-headers'.
(Info-fontify-node): Don't fontify the node if it's already been done.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/info.el | 152 |
2 files changed, 83 insertions, 74 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9a81459925e..e415237dcd8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2001-10-10 Miles Bader <miles@gnu.org> | ||
| 2 | |||
| 3 | * info.el (Info-insert-dir): Don't call `Info-fontify-menu-headers'. | ||
| 4 | (Info-fontify-node): Don't fontify the node if it's already been done. | ||
| 5 | |||
| 1 | 2001-10-10 Gerd Moellmann <gerd@gnu.org> | 6 | 2001-10-10 Gerd Moellmann <gerd@gnu.org> |
| 2 | 7 | ||
| 3 | * simple.el (end-of-buffer): Fix code scrolling specially | 8 | * simple.el (end-of-buffer): Fix code scrolling specially |
diff --git a/lisp/info.el b/lisp/info.el index c6fe420a1eb..1317d14db66 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -901,7 +901,6 @@ a case-insensitive match is tried." | |||
| 901 | (while buffers | 901 | (while buffers |
| 902 | (kill-buffer (car buffers)) | 902 | (kill-buffer (car buffers)) |
| 903 | (setq buffers (cdr buffers))) | 903 | (setq buffers (cdr buffers))) |
| 904 | (if Info-fontify (Info-fontify-menu-headers)) | ||
| 905 | (goto-char (point-min)) | 904 | (goto-char (point-min)) |
| 906 | (if problems | 905 | (if problems |
| 907 | (message "Composing main Info directory...problems encountered, see `*Messages*'") | 906 | (message "Composing main Info directory...problems encountered, see `*Messages*'") |
| @@ -2553,80 +2552,85 @@ the variable `Info-file-list-for-emacs'." | |||
| 2553 | 'face 'info-menu-header))))) | 2552 | 'face 'info-menu-header))))) |
| 2554 | 2553 | ||
| 2555 | (defun Info-fontify-node () | 2554 | (defun Info-fontify-node () |
| 2556 | (save-excursion | 2555 | ;; Only fontify the node if it hasn't already been done. [We pass in |
| 2557 | (let ((buffer-read-only nil) | 2556 | ;; LIMIT arg to `next-property-change' because it seems to search past |
| 2558 | (case-fold-search t)) | 2557 | ;; (point-max).] |
| 2559 | (goto-char (point-min)) | 2558 | (unless (< (next-property-change (point-min) nil (point-max)) |
| 2560 | (when (looking-at "^File: [^,: \t]+,?[ \t]+") | 2559 | (point-max)) |
| 2561 | (goto-char (match-end 0)) | 2560 | (save-excursion |
| 2562 | (while (looking-at "[ \t]*\\([^:, \t\n]+\\):[ \t]+\\([^:,\t\n]+\\),?") | 2561 | (let ((buffer-read-only nil) |
| 2562 | (case-fold-search t)) | ||
| 2563 | (goto-char (point-min)) | ||
| 2564 | (when (looking-at "^File: [^,: \t]+,?[ \t]+") | ||
| 2563 | (goto-char (match-end 0)) | 2565 | (goto-char (match-end 0)) |
| 2564 | (let* ((nbeg (match-beginning 2)) | 2566 | (while (looking-at "[ \t]*\\([^:, \t\n]+\\):[ \t]+\\([^:,\t\n]+\\),?") |
| 2565 | (nend (match-end 2)) | 2567 | (goto-char (match-end 0)) |
| 2566 | (tbeg (match-beginning 1)) | 2568 | (let* ((nbeg (match-beginning 2)) |
| 2567 | (tag (buffer-substring tbeg (match-end 1)))) | 2569 | (nend (match-end 2)) |
| 2568 | (if (string-equal tag "Node") | 2570 | (tbeg (match-beginning 1)) |
| 2569 | (put-text-property nbeg nend 'face 'info-header-node) | 2571 | (tag (buffer-substring tbeg (match-end 1)))) |
| 2570 | (put-text-property nbeg nend 'face 'info-header-xref) | 2572 | (if (string-equal tag "Node") |
| 2571 | (put-text-property nbeg nend 'mouse-face 'highlight) | 2573 | (put-text-property nbeg nend 'face 'info-header-node) |
| 2572 | (put-text-property tbeg nend | 2574 | (put-text-property nbeg nend 'face 'info-header-xref) |
| 2573 | 'help-echo | 2575 | (put-text-property nbeg nend 'mouse-face 'highlight) |
| 2574 | (concat "Go to node " | 2576 | (put-text-property tbeg nend |
| 2575 | (buffer-substring nbeg nend))) | 2577 | 'help-echo |
| 2576 | (let ((fun (cdr (assoc tag '(("Prev" . Info-prev) | 2578 | (concat "Go to node " |
| 2577 | ("Next" . Info-next) | 2579 | (buffer-substring nbeg nend))) |
| 2578 | ("Up" . Info-up)))))) | 2580 | (let ((fun (cdr (assoc tag '(("Prev" . Info-prev) |
| 2579 | (when fun | 2581 | ("Next" . Info-next) |
| 2580 | (let ((keymap (make-sparse-keymap))) | 2582 | ("Up" . Info-up)))))) |
| 2581 | (define-key keymap [header-line mouse-1] fun) | 2583 | (when fun |
| 2582 | (define-key keymap [header-line mouse-2] fun) | 2584 | (let ((keymap (make-sparse-keymap))) |
| 2583 | (put-text-property tbeg nend 'local-map keymap)))) | 2585 | (define-key keymap [header-line mouse-1] fun) |
| 2584 | )))) | 2586 | (define-key keymap [header-line mouse-2] fun) |
| 2585 | (goto-char (point-min)) | 2587 | (put-text-property tbeg nend 'local-map keymap)))) |
| 2586 | (while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*+\\|=+\\|-+\\|\\.+\\)$" | 2588 | )))) |
| 2587 | nil t) | 2589 | (goto-char (point-min)) |
| 2588 | (let ((c (preceding-char)) | 2590 | (while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*+\\|=+\\|-+\\|\\.+\\)$" |
| 2589 | face) | 2591 | nil t) |
| 2590 | (cond ((= c ?*) (setq face 'Info-title-1-face)) | 2592 | (let ((c (preceding-char)) |
| 2591 | ((= c ?=) (setq face 'Info-title-2-face)) | 2593 | face) |
| 2592 | ((= c ?-) (setq face 'Info-title-3-face)) | 2594 | (cond ((= c ?*) (setq face 'Info-title-1-face)) |
| 2593 | (t (setq face 'Info-title-4-face))) | 2595 | ((= c ?=) (setq face 'Info-title-2-face)) |
| 2594 | (put-text-property (match-beginning 1) (match-end 1) | 2596 | ((= c ?-) (setq face 'Info-title-3-face)) |
| 2595 | 'face face)) | 2597 | (t (setq face 'Info-title-4-face))) |
| 2596 | ;; This is a serious problem for trying to handle multiple | 2598 | (put-text-property (match-beginning 1) (match-end 1) |
| 2597 | ;; frame types at once. We want this text to be invisible | 2599 | 'face face)) |
| 2598 | ;; on frames that can display the font above. | 2600 | ;; This is a serious problem for trying to handle multiple |
| 2599 | (when (memq (framep (selected-frame)) '(x pc w32 mac)) | 2601 | ;; frame types at once. We want this text to be invisible |
| 2600 | (add-text-properties (match-end 1) (match-end 2) | 2602 | ;; on frames that can display the font above. |
| 2601 | '(invisible t intangible t)) | 2603 | (when (memq (framep (selected-frame)) '(x pc w32 mac)) |
| 2602 | (add-text-properties (1- (match-end 1)) (match-end 2) | 2604 | (add-text-properties (match-end 1) (match-end 2) |
| 2603 | '(intangible t)))) | 2605 | '(invisible t intangible t)) |
| 2604 | (goto-char (point-min)) | 2606 | (add-text-properties (1- (match-end 1)) (match-end 2) |
| 2605 | (while (re-search-forward "\\*Note[ \n\t]+\\([^:]*\\):" nil t) | 2607 | '(intangible t)))) |
| 2606 | (if (= (char-after (1- (match-beginning 0))) ?\") ; hack | 2608 | (goto-char (point-min)) |
| 2607 | nil | 2609 | (while (re-search-forward "\\*Note[ \n\t]+\\([^:]*\\):" nil t) |
| 2608 | (add-text-properties (match-beginning 1) (match-end 1) | 2610 | (if (= (char-after (1- (match-beginning 0))) ?\") ; hack |
| 2609 | '(face info-xref | 2611 | nil |
| 2610 | mouse-face highlight | 2612 | (add-text-properties (match-beginning 1) (match-end 1) |
| 2611 | help-echo "mouse-2: go to this node")))) | 2613 | '(face info-xref |
| 2612 | (goto-char (point-min)) | 2614 | mouse-face highlight |
| 2613 | (if (and (search-forward "\n* Menu:" nil t) | 2615 | help-echo "mouse-2: go to this node")))) |
| 2614 | (not (string-match "\\<Index\\>" Info-current-node)) | 2616 | (goto-char (point-min)) |
| 2615 | ;; Don't take time to annotate huge menus | 2617 | (if (and (search-forward "\n* Menu:" nil t) |
| 2616 | (< (- (point-max) (point)) Info-fontify-maximum-menu-size)) | 2618 | (not (string-match "\\<Index\\>" Info-current-node)) |
| 2617 | (let ((n 0)) | 2619 | ;; Don't take time to annotate huge menus |
| 2618 | (while (re-search-forward "^\\* +\\([^:\t\n]*\\):" nil t) | 2620 | (< (- (point-max) (point)) Info-fontify-maximum-menu-size)) |
| 2619 | (setq n (1+ n)) | 2621 | (let ((n 0)) |
| 2620 | (if (memq n '(5 9)) ; visual aids to help with 1-9 keys | 2622 | (while (re-search-forward "^\\* +\\([^:\t\n]*\\):" nil t) |
| 2621 | (put-text-property (match-beginning 0) | 2623 | (setq n (1+ n)) |
| 2622 | (1+ (match-beginning 0)) | 2624 | (if (memq n '(5 9)) ; visual aids to help with 1-9 keys |
| 2623 | 'face 'info-menu-5)) | 2625 | (put-text-property (match-beginning 0) |
| 2624 | (add-text-properties (match-beginning 1) (match-end 1) | 2626 | (1+ (match-beginning 0)) |
| 2625 | '(face info-xref | 2627 | 'face 'info-menu-5)) |
| 2626 | mouse-face highlight | 2628 | (add-text-properties (match-beginning 1) (match-end 1) |
| 2627 | help-echo "mouse-2: go to this node"))))) | 2629 | '(face info-xref |
| 2628 | (Info-fontify-menu-headers) | 2630 | mouse-face highlight |
| 2629 | (set-buffer-modified-p nil)))) | 2631 | help-echo "mouse-2: go to this node"))))) |
| 2632 | (Info-fontify-menu-headers) | ||
| 2633 | (set-buffer-modified-p nil))))) | ||
| 2630 | 2634 | ||
| 2631 | 2635 | ||
| 2632 | ;; When an Info buffer is killed, make sure the associated tags buffer | 2636 | ;; When an Info buffer is killed, make sure the associated tags buffer |