aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRoland McGrath <[email protected]>1992-12-09 17:28:25 +0000
committerRoland McGrath <[email protected]>1992-12-09 17:28:25 +0000
commite38e7367083947a490d761e936ab6b5a3b8ad76a (patch)
treebd740d174834783f0866a50ac69c47790ebab4a6 /lisp
parent168e32e6e029349d9d124ce0cfa8a75562dbd751 (diff)
(Info-{first,second,third,fourth,fifth}-menu-item): Removed.
(Info-nth-menu-item): New function; bound to 1..9.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/info.el51
1 files changed, 17 insertions, 34 deletions
diff --git a/lisp/info.el b/lisp/info.el
index abda4427a0..9d7b910bd6 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -1,6 +1,6 @@
;;; info.el --- info package for Emacs.
-;; Copyright (C) 1985, 1986 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: help
@@ -607,30 +607,13 @@ Completion is allowed, and the menu item point is on is the default."
nil))
(Info-extract-menu-node-name)))
-(defun Info-first-menu-item ()
- "Go to the node of the first menu item."
+(defun Info-nth-menu-item ()
+ "Go to the node of the Nth menu item.
+N is the digit argument used to invoke this command."
(interactive)
- (Info-goto-node (Info-extract-menu-counting 1)))
-
-(defun Info-second-menu-item ()
- "Go to the node of the second menu item."
- (interactive)
- (Info-goto-node (Info-extract-menu-counting 2)))
-
-(defun Info-third-menu-item ()
- "Go to the node of the third menu item."
- (interactive)
- (Info-goto-node (Info-extract-menu-counting 3)))
-
-(defun Info-fourth-menu-item ()
- "Go to the node of the fourth menu item."
- (interactive)
- (Info-goto-node (Info-extract-menu-counting 4)))
-
-(defun Info-fifth-menu-item ()
- "Go to the node of the fifth menu item."
- (interactive)
- (Info-goto-node (Info-extract-menu-counting 5)))
+ (Info-goto-node
+ (Info-extract-menu-counting
+ (- (aref (this-command-keys) (1- (length (this-command-keys)))) ?0))))
(defun Info-top-node ()
"Go to the Top node of this file."
@@ -858,16 +841,16 @@ At end of the node's text, moves to the next node."
(define-key Info-mode-map "." 'beginning-of-buffer)
(define-key Info-mode-map " " 'Info-scroll-up)
(define-key Info-mode-map "\C-m" 'Info-next-preorder)
- (define-key Info-mode-map "1" 'Info-first-menu-item)
- (define-key Info-mode-map "2" 'Info-second-menu-item)
- (define-key Info-mode-map "3" 'Info-third-menu-item)
- (define-key Info-mode-map "4" 'Info-fourth-menu-item)
- (define-key Info-mode-map "5" 'Info-fifth-menu-item)
- (define-key Info-mode-map "6" 'undefined)
- (define-key Info-mode-map "7" 'undefined)
- (define-key Info-mode-map "8" 'undefined)
- (define-key Info-mode-map "9" 'undefined)
- (define-key Info-mode-map "0" 'undefined)
+ (define-key Info-mode-map "1" 'Info-nth-menu-item)
+ (define-key Info-mode-map "2" 'Info-nth-menu-item)
+ (define-key Info-mode-map "3" 'Info-nth-menu-item)
+ (define-key Info-mode-map "4" 'Info-nth-menu-item)
+ (define-key Info-mode-map "5" 'Info-nth-menu-item)
+ (define-key Info-mode-map "6" 'Info-nth-menu-item)
+ (define-key Info-mode-map "7" 'Info-nth-menu-item)
+ (define-key Info-mode-map "8" 'Info-nth-menu-item)
+ (define-key Info-mode-map "9" 'Info-nth-menu-item)
+ (define-key Info-mode-map "0" 'Info-nth-menu-item)
(define-key Info-mode-map "?" 'Info-summary)
(define-key Info-mode-map "]" 'Info-forward-node)
(define-key Info-mode-map "[" 'Info-backward-node)