diff options
| author | Eric S. Raymond | 1992-08-04 16:49:42 +0000 |
|---|---|---|
| committer | Eric S. Raymond | 1992-08-04 16:49:42 +0000 |
| commit | 253db9175ecedc0700535a23203af4c69aae0c5e (patch) | |
| tree | 3e53a7f39016113e3982de54827c0b01167ec7dd | |
| parent | ae94cd0c12bca192afd0f9d7d31b996a42d5ee65 (diff) | |
| download | emacs-253db9175ecedc0700535a23203af4c69aae0c5e.tar.gz emacs-253db9175ecedc0700535a23203af4c69aae0c5e.zip | |
*** empty log message ***
| -rw-r--r-- | lisp/info.el | 62 |
1 files changed, 61 insertions, 1 deletions
diff --git a/lisp/info.el b/lisp/info.el index 9d8806b6d07..fef0d9b47c3 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -329,6 +329,14 @@ to read a file name from the minibuffer." | |||
| 329 | (goto-char (nth 2 (car hl))) | 329 | (goto-char (nth 2 (car hl))) |
| 330 | (Info-restore-point (cdr hl))))) | 330 | (Info-restore-point (cdr hl))))) |
| 331 | 331 | ||
| 332 | (defun Info-restore-point (hl) | ||
| 333 | "If this node has been visited, restore the point value when we left." | ||
| 334 | (if hl | ||
| 335 | (if (and (equal (nth 0 (car hl)) Info-current-file) | ||
| 336 | (equal (nth 1 (car hl)) Info-current-node)) | ||
| 337 | (goto-char (nth 2 (car hl))) | ||
| 338 | (Info-restore-point (cdr hl))))) | ||
| 339 | |||
| 332 | (defvar Info-last-search nil | 340 | (defvar Info-last-search nil |
| 333 | "Default regexp for \\<info-mode-map>\\[Info-search] command to search for.") | 341 | "Default regexp for \\<info-mode-map>\\[Info-search] command to search for.") |
| 334 | 342 | ||
| @@ -706,6 +714,57 @@ Completion is allowed, and the menu item point is on is the default." | |||
| 706 | (switch-to-buffer (prog1 (other-buffer (current-buffer)) | 714 | (switch-to-buffer (prog1 (other-buffer (current-buffer)) |
| 707 | (bury-buffer (current-buffer))))) | 715 | (bury-buffer (current-buffer))))) |
| 708 | 716 | ||
| 717 | (defun Info-next-menu-item () | ||
| 718 | (interactive) | ||
| 719 | (save-excursion | ||
| 720 | (forward-line -1) | ||
| 721 | (search-forward "\n* menu:" nil t) | ||
| 722 | (or (search-forward "\n* " nil t) | ||
| 723 | (error "No more items in menu")) | ||
| 724 | (Info-goto-node (Info-extract-menu-node-name)))) | ||
| 725 | |||
| 726 | (defun Info-last-menu-item () | ||
| 727 | (interactive) | ||
| 728 | (save-excursion | ||
| 729 | (forward-line 1) | ||
| 730 | (search-backward "\n* menu:" nil t) | ||
| 731 | (or (search-backward "\n* " nil t) | ||
| 732 | (error "No previous items in menu")) | ||
| 733 | (Info-goto-node (Info-extract-menu-node-name)))) | ||
| 734 | |||
| 735 | (defmacro no-error (&rest body) | ||
| 736 | (list 'condition-case nil (cons 'progn (append body '(t))) '(error nil))) | ||
| 737 | |||
| 738 | (defun Info-next-preorder () | ||
| 739 | "Go to the next node, popping up a level if there is none." | ||
| 740 | (interactive) | ||
| 741 | (cond ((no-error (Info-next-menu-item)) ) | ||
| 742 | ((no-error (Info-up)) (forward-line 1)) | ||
| 743 | (t (error "No more nodes")))) | ||
| 744 | |||
| 745 | (defun Info-last-preorder () | ||
| 746 | "Go to the last node, popping up a level if there is none." | ||
| 747 | (interactive) | ||
| 748 | (cond ((no-error (Info-last-menu-item)) ) | ||
| 749 | ((no-error (Info-up)) (forward-line -1)) | ||
| 750 | (t (error "No previous nodes")))) | ||
| 751 | |||
| 752 | (defun Info-scroll-up () | ||
| 753 | "Read the next screen. If end of buffer is visible, go to next entry." | ||
| 754 | (interactive) | ||
| 755 | (if (pos-visible-in-window-p (point-max)) | ||
| 756 | (Info-next-preorder) | ||
| 757 | (scroll-up)) | ||
| 758 | ) | ||
| 759 | |||
| 760 | (defun Info-scroll-down () | ||
| 761 | "Read the previous screen. If start of buffer is visible, go to last entry." | ||
| 762 | (interactive) | ||
| 763 | (if (pos-visible-in-window-p (point-min)) | ||
| 764 | (Info-last-preorder) | ||
| 765 | (scroll-down)) | ||
| 766 | ) | ||
| 767 | |||
| 709 | (defun Info-undefined () | 768 | (defun Info-undefined () |
| 710 | "Make command be undefined in Info." | 769 | "Make command be undefined in Info." |
| 711 | (interactive) | 770 | (interactive) |
| @@ -804,7 +863,8 @@ At end of the node's text, moves to the next node." | |||
| 804 | (setq Info-mode-map (make-keymap)) | 863 | (setq Info-mode-map (make-keymap)) |
| 805 | (suppress-keymap Info-mode-map) | 864 | (suppress-keymap Info-mode-map) |
| 806 | (define-key Info-mode-map "." 'beginning-of-buffer) | 865 | (define-key Info-mode-map "." 'beginning-of-buffer) |
| 807 | (define-key Info-mode-map " " 'scroll-up) | 866 | (define-key Info-mode-map " " 'Info-scroll-up) |
| 867 | (define-key Info-mode-map "\C-m" 'Info-next-preorder) | ||
| 808 | (define-key Info-mode-map "1" 'Info-first-menu-item) | 868 | (define-key Info-mode-map "1" 'Info-first-menu-item) |
| 809 | (define-key Info-mode-map "2" 'Info-second-menu-item) | 869 | (define-key Info-mode-map "2" 'Info-second-menu-item) |
| 810 | (define-key Info-mode-map "3" 'Info-third-menu-item) | 870 | (define-key Info-mode-map "3" 'Info-third-menu-item) |