aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Rudalics2008-10-10 13:47:49 +0000
committerMartin Rudalics2008-10-10 13:47:49 +0000
commitc24d482671e94c63a9408f0cb11f232fb57aef26 (patch)
tree46cb0c44c532fb7e4b290c64909d757911ed2152
parentd64d5ff59e3c16ad7e692bd225e7c113e4618f98 (diff)
downloademacs-c24d482671e94c63a9408f0cb11f232fb57aef26.tar.gz
emacs-c24d482671e94c63a9408f0cb11f232fb57aef26.zip
(Info-extract-menu-counting): New argment no-detail to
skip detailed node listings. (Info-forward-node): New argument not-up to inhibit going up. (Info-final-node): Call Info-extract-menu-counting and Info-forward-node with the new arguments set to avoid infinite looping. (Bug#1116)
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/info.el31
2 files changed, 28 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index cb4bd363f8c..562f43f1f75 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12008-10-10 Martin Rudalics <rudalics@gmx.at>
2
3 * info.el (Info-extract-menu-counting): New argment no-detail to
4 skip detailed node listings.
5 (Info-forward-node): New argument not-up to inhibit going up.
6 (Info-final-node): Call Info-extract-menu-counting and
7 Info-forward-node with the new arguments set to avoid infinite
8 looping. (Bug#1116)
9
12008-10-10 Eli Zaretskii <eliz@gnu.org> 102008-10-10 Eli Zaretskii <eliz@gnu.org>
2 11
3 * startup.el (command-line): Don't invoke tool-bar-mode if it is 12 * startup.el (command-line): Don't invoke tool-bar-mode if it is
diff --git a/lisp/info.el b/lisp/info.el
index 3b7603a2f83..19604424970 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -2412,17 +2412,21 @@ new buffer."
2412 (Info-extract-menu-node-name nil (Info-index-node)))))) 2412 (Info-extract-menu-node-name nil (Info-index-node))))))
2413 2413
2414;; If COUNT is nil, use the last item in the menu. 2414;; If COUNT is nil, use the last item in the menu.
2415(defun Info-extract-menu-counting (count) 2415(defun Info-extract-menu-counting (count &optional no-detail)
2416 (let ((case-fold-search t)) 2416 (let ((case-fold-search t))
2417 (save-excursion 2417 (save-excursion
2418 (let ((case-fold-search t)) 2418 (let ((case-fold-search t)
2419 (bound (when (and no-detail
2420 (re-search-forward
2421 "^[ \t-]*The Detailed Node Listing" nil t))
2422 (match-beginning 0))))
2419 (goto-char (point-min)) 2423 (goto-char (point-min))
2420 (or (search-forward "\n* menu:" nil t) 2424 (or (search-forward "\n* menu:" bound t)
2421 (error "No menu in this node")) 2425 (error "No menu in this node"))
2422 (if count 2426 (if count
2423 (or (search-forward "\n* " nil t count) 2427 (or (search-forward "\n* " bound t count)
2424 (error "Too few items in menu")) 2428 (error "Too few items in menu"))
2425 (while (search-forward "\n* " nil t) 2429 (while (search-forward "\n* " bound t)
2426 nil)) 2430 nil))
2427 (Info-extract-menu-node-name nil (Info-index-node)))))) 2431 (Info-extract-menu-node-name nil (Info-index-node))))))
2428 2432
@@ -2445,17 +2449,19 @@ N is the digit argument used to invoke this command."
2445 (Info-goto-node "Top") 2449 (Info-goto-node "Top")
2446 (let ((Info-history nil) 2450 (let ((Info-history nil)
2447 (case-fold-search t)) 2451 (case-fold-search t))
2448 ;; Go to the last node in the menu of Top. 2452 ;; Go to the last node in the menu of Top. But don't delve into
2449 (Info-goto-node (Info-extract-menu-counting nil)) 2453 ;; detailed node listings.
2454 (Info-goto-node (Info-extract-menu-counting nil t))
2450 ;; If the last node in the menu is not last in pointer structure, 2455 ;; If the last node in the menu is not last in pointer structure,
2451 ;; move forward until we can't go any farther. 2456 ;; move forward (but not down- or upward - see bug#1116) until we
2452 (while (Info-forward-node t t) nil) 2457 ;; can't go any farther.
2458 (while (Info-forward-node t t t) nil)
2453 ;; Then keep moving down to last subnode, unless we reach an index. 2459 ;; Then keep moving down to last subnode, unless we reach an index.
2454 (while (and (not (Info-index-node)) 2460 (while (and (not (Info-index-node))
2455 (save-excursion (search-forward "\n* Menu:" nil t))) 2461 (save-excursion (search-forward "\n* Menu:" nil t)))
2456 (Info-goto-node (Info-extract-menu-counting nil))))) 2462 (Info-goto-node (Info-extract-menu-counting nil)))))
2457 2463
2458(defun Info-forward-node (&optional not-down no-error) 2464(defun Info-forward-node (&optional not-down not-up no-error)
2459 "Go forward one node, considering all nodes as forming one sequence." 2465 "Go forward one node, considering all nodes as forming one sequence."
2460 (interactive) 2466 (interactive)
2461 (goto-char (point-min)) 2467 (goto-char (point-min))
@@ -2473,7 +2479,8 @@ N is the digit argument used to invoke this command."
2473 ((save-excursion (search-backward "next:" nil t)) 2479 ((save-excursion (search-backward "next:" nil t))
2474 (Info-next) 2480 (Info-next)
2475 t) 2481 t)
2476 ((and (save-excursion (search-backward "up:" nil t)) 2482 ((and (not not-up)
2483 (save-excursion (search-backward "up:" nil t))
2477 ;; Use string-equal, not equal, to ignore text props. 2484 ;; Use string-equal, not equal, to ignore text props.
2478 (not (string-equal (downcase (Info-extract-pointer "up")) 2485 (not (string-equal (downcase (Info-extract-pointer "up"))
2479 "top"))) 2486 "top")))
@@ -2481,7 +2488,7 @@ N is the digit argument used to invoke this command."
2481 (Info-up) 2488 (Info-up)
2482 (let (Info-history success) 2489 (let (Info-history success)
2483 (unwind-protect 2490 (unwind-protect
2484 (setq success (Info-forward-node t no-error)) 2491 (setq success (Info-forward-node t nil no-error))
2485 (or success (Info-goto-node old-node)))))) 2492 (or success (Info-goto-node old-node))))))
2486 (no-error nil) 2493 (no-error nil)
2487 (t (error "No pointer forward from this node"))))) 2494 (t (error "No pointer forward from this node")))))