comparison lisp/info.el @ 21910:702383d93b75

(Info-up): New arg SAME-FILE: don't move to different file. (Info-next-preorder): Pass new arg to Info-up. (Info-last-preorder): Likewise. (Info-last-preorder): Don't follow the Prev if it's same as the Up. Instead, follow it as the Up.
author Richard M. Stallman <rms@gnu.org>
date Sun, 03 May 1998 00:02:10 +0000
parents d17bf0e8a170
children 5665490a6f9e
comparison
equal deleted inserted replaced
21909:bd22ccd2151e 21910:702383d93b75
909 (defun Info-prev () 909 (defun Info-prev ()
910 "Go to the previous node of this node." 910 "Go to the previous node of this node."
911 (interactive) 911 (interactive)
912 (Info-goto-node (Info-extract-pointer "prev[ious]*" "previous"))) 912 (Info-goto-node (Info-extract-pointer "prev[ious]*" "previous")))
913 913
914 (defun Info-up () 914 (defun Info-up (&optional same-file)
915 "Go to the superior node of this node." 915 "Go to the superior node of this node.
916 (interactive) 916 If SAME-FILE is non-nil, do not move to a different Info file."
917 (Info-goto-node (Info-extract-pointer "up")) 917 (interactive)
918 (let ((node (Info-extract-pointer "up")))
919 (and same-file
920 (string-match "^(" node)
921 (error "Up node is in another Info file"))
922 (Info-goto-node node))
918 (Info-restore-point Info-history)) 923 (Info-restore-point Info-history))
919 924
920 (defun Info-last () 925 (defun Info-last ()
921 "Go back to the last node visited." 926 "Go back to the last node visited."
922 (interactive) 927 (interactive)
1275 (defun Info-next-preorder () 1280 (defun Info-next-preorder ()
1276 "Go to the next subnode or the next node, or go up a level." 1281 "Go to the next subnode or the next node, or go up a level."
1277 (interactive) 1282 (interactive)
1278 (cond ((Info-no-error (Info-next-menu-item))) 1283 (cond ((Info-no-error (Info-next-menu-item)))
1279 ((Info-no-error (Info-next))) 1284 ((Info-no-error (Info-next)))
1280 ((Info-no-error (Info-up)) 1285 ((Info-no-error (Info-up t))
1281 ;; Since we have already gone thru all the items in this menu, 1286 ;; Since we have already gone thru all the items in this menu,
1282 ;; go up to the end of this node. 1287 ;; go up to the end of this node.
1283 (goto-char (point-max)) 1288 (goto-char (point-max))
1284 ;; Since logically we are done with the node with that menu, 1289 ;; Since logically we are done with the node with that menu,
1285 ;; move on from it. 1290 ;; move on from it.
1300 (Info-last-menu-item) 1305 (Info-last-menu-item)
1301 ;; If we go down a menu item, go to the end of the node 1306 ;; If we go down a menu item, go to the end of the node
1302 ;; so we can scroll back through it. 1307 ;; so we can scroll back through it.
1303 (goto-char (point-max)))) 1308 (goto-char (point-max))))
1304 (recenter -1)) 1309 (recenter -1))
1305 ((Info-no-error (Info-prev)) 1310 ((and (not (equal (Info-extract-pointer "up")
1311 (Info-extract-pointer "prev"))))
1312 (Info-no-error (Info-prev))
1306 (goto-char (point-max)) 1313 (goto-char (point-max))
1307 (while (Info-no-error 1314 (while (Info-no-error
1308 (Info-last-menu-item) 1315 (Info-last-menu-item)
1309 ;; If we go down a menu item, go to the end of the node 1316 ;; If we go down a menu item, go to the end of the node
1310 ;; so we can scroll back through it. 1317 ;; so we can scroll back through it.
1311 (goto-char (point-max)))) 1318 (goto-char (point-max))))
1312 (recenter -1)) 1319 (recenter -1))
1313 ((Info-no-error (Info-up)) 1320 ((Info-no-error (Info-up t))
1314 (goto-char (point-min)) 1321 (goto-char (point-min))
1315 (or (search-forward "\n* Menu:" nil t) 1322 (or (search-forward "\n* Menu:" nil t)
1316 (goto-char (point-max)))) 1323 (goto-char (point-max))))
1317 (t (error "No previous nodes")))) 1324 (t (error "No previous nodes"))))
1318 1325