changeset 1666:c12fbca81b63

(Info-{first,second,third,fourth,fifth}-menu-item): Removed. (Info-nth-menu-item): New function; bound to 1..9.
author Roland McGrath <roland@gnu.org>
date Wed, 09 Dec 1992 17:28:25 +0000
parents 4383bffb2ad9
children 9c0e14881b8f
files lisp/info.el
diffstat 1 files changed, 17 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/info.el	Tue Dec 08 00:39:49 1992 +0000
+++ b/lisp/info.el	Wed Dec 09 17:28:25 1992 +0000
@@ -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 @@
 	nil))
     (Info-extract-menu-node-name)))
 
-(defun Info-first-menu-item ()
-  "Go to the node of the first menu item."
-  (interactive)
-  (Info-goto-node (Info-extract-menu-counting 1)))
-
-(defun Info-second-menu-item ()
-  "Go to the node of the second 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 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 @@
   (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)