From 56cda6f5c199a78d551218c9638c0d943a000568 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 21 Apr 1996 01:47:02 +0000 Subject: [PATCH] (Info-next-reference, Info-prev-reference): Add optional argument RECUR to avoid infinite recursion on malformed nodes. --- lisp/info.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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. -- 2.39.2