From: Richard M. Stallman Date: Sun, 21 Apr 1996 01:47:02 +0000 (+0000) Subject: (Info-next-reference, Info-prev-reference): Add optional X-Git-Tag: emacs-19.34~806 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=56cda6f5c199a78d551218c9638c0d943a000568;p=emacs.git (Info-next-reference, Info-prev-reference): Add optional argument RECUR to avoid infinite recursion on malformed nodes. --- diff --git a/lisp/info.el b/lisp/info.el index bf55202f501..bb232b33910 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -1242,7 +1242,7 @@ previous node or back up to the parent node." (Info-last-preorder) (scroll-down)))) -(defun Info-next-reference () +(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]*\\([^:]*\\):\\|^\\* .*:") @@ -1257,9 +1257,11 @@ previous node or back up to the parent node." (error "No cross references in this node"))))) (goto-char (match-beginning 0)) (if (looking-at "\\* Menu:") - (Info-next-reference)))) + (if recur + (error "No cross references in this node") + (Info-next-reference t))))) -(defun Info-prev-reference () +(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]*\\([^:]*\\):\\|^\\* .*:") @@ -1273,7 +1275,9 @@ previous node or back up to the parent node." (error "No cross references in this node"))))) (goto-char (match-beginning 0)) (if (looking-at "\\* Menu:") - (Info-prev-reference)))) + (if recur + (error "No cross references in this node") + (Info-prev-reference t))))) (defun Info-index (topic) "Look up a string in the index for this file.