=== modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-06-09 02:26:47 +0000 +++ lisp/ChangeLog 2012-06-09 03:37:42 +0000 @@ -1,3 +1,8 @@ +2012-06-09 Christopher Schmidt + + * info.el (Info-next-reference, Info-prev-reference): Add numeric + prefix argument. + 2012-06-09 Stefan Monnier * emacs-lisp/macroexp.el (macroexp--expand-all): Only autoload === modified file 'lisp/info.el' --- lisp/info.el 2012-06-08 04:23:26 +0000 +++ lisp/info.el 2012-06-09 03:16:29 +0000 @@ -2914,48 +2914,58 @@ (select-window (posn-window (event-start e)))) (Info-scroll-down))) -(defun Info-next-reference (&optional recur) - "Move cursor to the next cross-reference or menu item in the node." - (interactive) - (let ((pat "\\*note[ \n\t]+\\([^:]+\\):\\|^\\* .*:\\|[hf]t?tps?://") - (old-pt (point)) - (case-fold-search t)) - (or (eobp) (forward-char 1)) - (or (re-search-forward pat nil t) - (progn - (goto-char (point-min)) - (or (re-search-forward pat nil t) - (progn - (goto-char old-pt) - (user-error "No cross references in this node"))))) - (goto-char (or (match-beginning 1) (match-beginning 0))) - (if (looking-at "\\* Menu:") - (if recur - (user-error "No cross references in this node") - (Info-next-reference t)) - (if (looking-at "^\\* ") - (forward-char 2))))) +(defun Info-next-reference (&optional recur count) + "Move cursor to the next cross-reference or menu item in the node. +If COUNT is non-nil (interactively with a prefix arg), jump over +COUNT cross-references." + (interactive "i\np") + (unless count + (setq count 1)) + (while (unless (zerop count) (setq count (1- count))) + (let ((pat "\\*note[ \n\t]+\\([^:]+\\):\\|^\\* .*:\\|[hf]t?tps?://") + (old-pt (point)) + (case-fold-search t)) + (or (eobp) (forward-char 1)) + (or (re-search-forward pat nil t) + (progn + (goto-char (point-min)) + (or (re-search-forward pat nil t) + (progn + (goto-char old-pt) + (user-error "No cross references in this node"))))) + (goto-char (or (match-beginning 1) (match-beginning 0))) + (if (looking-at "\\* Menu:") + (if recur + (user-error "No cross references in this node") + (Info-next-reference t)) + (if (looking-at "^\\* ") + (forward-char 2)))))) -(defun Info-prev-reference (&optional recur) - "Move cursor to the previous cross-reference or menu item in the node." - (interactive) - (let ((pat "\\*note[ \n\t]+\\([^:]+\\):\\|^\\* .*:\\|[hf]t?tps?://") - (old-pt (point)) - (case-fold-search t)) - (or (re-search-backward pat nil t) - (progn - (goto-char (point-max)) - (or (re-search-backward pat nil t) - (progn - (goto-char old-pt) - (user-error "No cross references in this node"))))) - (goto-char (or (match-beginning 1) (match-beginning 0))) - (if (looking-at "\\* Menu:") - (if recur - (user-error "No cross references in this node") - (Info-prev-reference t)) - (if (looking-at "^\\* ") - (forward-char 2))))) +(defun Info-prev-reference (&optional recur count) + "Move cursor to the previous cross-reference or menu item in the node. +If COUNT is non-nil (interactively with a prefix arg), jump over +COUNT cross-references." + (interactive "i\np") + (unless count + (setq count 1)) + (while (unless (zerop count) (setq count (1- count))) + (let ((pat "\\*note[ \n\t]+\\([^:]+\\):\\|^\\* .*:\\|[hf]t?tps?://") + (old-pt (point)) + (case-fold-search t)) + (or (re-search-backward pat nil t) + (progn + (goto-char (point-max)) + (or (re-search-backward pat nil t) + (progn + (goto-char old-pt) + (user-error "No cross references in this node"))))) + (goto-char (or (match-beginning 1) (match-beginning 0))) + (if (looking-at "\\* Menu:") + (if recur + (user-error "No cross references in this node") + (Info-prev-reference t)) + (if (looking-at "^\\* ") + (forward-char 2)))))) (defvar Info-index-nodes nil "Alist of cached index node names of visited Info files.