diff options
| author | Juri Linkov | 2011-09-20 23:16:42 +0300 |
|---|---|---|
| committer | Juri Linkov | 2011-09-20 23:16:42 +0300 |
| commit | 3820edebb4037162ddc7b4f6ccf528806185aedc (patch) | |
| tree | d83d118087907657f45bb35ce6baca810e07e77f | |
| parent | fd317ddfc9ff0628af84aa1e9d298cea6a208d19 (diff) | |
| download | emacs-3820edebb4037162ddc7b4f6ccf528806185aedc.tar.gz emacs-3820edebb4037162ddc7b4f6ccf528806185aedc.zip | |
* lisp/info.el (Info-history-skip-intermediate-nodes): New defcustom.
(Info-forward-node, Info-backward-node, Info-next-preorder)
(Info-last-preorder): Use it.
Fixes: debbugs:9528
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/info.el | 40 |
2 files changed, 36 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7e0da8727e1..0c16a44722a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,11 @@ | |||
| 1 | 2011-09-20 Juri Linkov <juri@jurta.org> | 1 | 2011-09-20 Juri Linkov <juri@jurta.org> |
| 2 | 2 | ||
| 3 | * info.el (Info-history-skip-intermediate-nodes): New defcustom. | ||
| 4 | (Info-forward-node, Info-backward-node, Info-next-preorder) | ||
| 5 | (Info-last-preorder): Use it. (Bug#9528) | ||
| 6 | |||
| 7 | 2011-09-20 Juri Linkov <juri@jurta.org> | ||
| 8 | |||
| 3 | * info.el (Info-last-preorder): Visit last menu item only when | 9 | * info.el (Info-last-preorder): Visit last menu item only when |
| 4 | `Info-scroll-prefer-subnodes' is non-nil (third test-case of bug#9528). | 10 | `Info-scroll-prefer-subnodes' is non-nil (third test-case of bug#9528). |
| 5 | 11 | ||
diff --git a/lisp/info.el b/lisp/info.el index 3fa35bb4d03..ea23cf35568 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -52,6 +52,15 @@ Each element of the stack is a list (FILENAME NODENAME BUFFERPOS).") | |||
| 52 | "List of all Info nodes user has visited. | 52 | "List of all Info nodes user has visited. |
| 53 | Each element of the list is a list (FILENAME NODENAME).") | 53 | Each element of the list is a list (FILENAME NODENAME).") |
| 54 | 54 | ||
| 55 | (defcustom Info-history-skip-intermediate-nodes t | ||
| 56 | "Non-nil means don't record intermediate Info nodes to the history. | ||
| 57 | Intermediate Info nodes are nodes visited by Info internally in the process of | ||
| 58 | searching the node to display. Intermediate nodes are not presented | ||
| 59 | to the user." | ||
| 60 | :type 'boolean | ||
| 61 | :group 'info | ||
| 62 | :version "24.1") | ||
| 63 | |||
| 55 | (defcustom Info-enable-edit nil | 64 | (defcustom Info-enable-edit nil |
| 56 | "Non-nil means the \\<Info-mode-map>\\[Info-edit] command in Info can edit the current node. | 65 | "Non-nil means the \\<Info-mode-map>\\[Info-edit] command in Info can edit the current node. |
| 57 | This is convenient if you want to write Info files by hand. | 66 | This is convenient if you want to write Info files by hand. |
| @@ -2668,10 +2677,13 @@ N is the digit argument used to invoke this command." | |||
| 2668 | "top"))) | 2677 | "top"))) |
| 2669 | (let ((old-node Info-current-node)) | 2678 | (let ((old-node Info-current-node)) |
| 2670 | (Info-up) | 2679 | (Info-up) |
| 2671 | (let (Info-history success) | 2680 | (let ((old-history Info-history) |
| 2681 | success) | ||
| 2672 | (unwind-protect | 2682 | (unwind-protect |
| 2673 | (setq success (Info-forward-node t nil no-error)) | 2683 | (setq success (Info-forward-node t nil no-error)) |
| 2674 | (or success (Info-goto-node old-node)))))) | 2684 | (or success (Info-goto-node old-node))) |
| 2685 | (if Info-history-skip-intermediate-nodes | ||
| 2686 | (setq Info-history old-history))))) | ||
| 2675 | (no-error nil) | 2687 | (no-error nil) |
| 2676 | (t (error "No pointer forward from this node"))))) | 2688 | (t (error "No pointer forward from this node"))))) |
| 2677 | 2689 | ||
| @@ -2693,10 +2705,12 @@ N is the digit argument used to invoke this command." | |||
| 2693 | ;; If we move back at the same level, | 2705 | ;; If we move back at the same level, |
| 2694 | ;; go down to find the last subnode*. | 2706 | ;; go down to find the last subnode*. |
| 2695 | (Info-prev) | 2707 | (Info-prev) |
| 2696 | (let (Info-history) | 2708 | (let ((old-history Info-history)) |
| 2697 | (while (and (not (Info-index-node)) | 2709 | (while (and (not (Info-index-node)) |
| 2698 | (save-excursion (search-forward "\n* Menu:" nil t))) | 2710 | (save-excursion (search-forward "\n* Menu:" nil t))) |
| 2699 | (Info-goto-node (Info-extract-menu-counting nil))))) | 2711 | (Info-goto-node (Info-extract-menu-counting nil))) |
| 2712 | (if Info-history-skip-intermediate-nodes | ||
| 2713 | (setq Info-history old-history)))) | ||
| 2700 | (t | 2714 | (t |
| 2701 | (error "No pointer backward from this node"))))) | 2715 | (error "No pointer backward from this node"))))) |
| 2702 | 2716 | ||
| @@ -2752,8 +2766,10 @@ N is the digit argument used to invoke this command." | |||
| 2752 | ;; Since logically we are done with the node with that menu, | 2766 | ;; Since logically we are done with the node with that menu, |
| 2753 | ;; move on from it. But don't add intermediate nodes | 2767 | ;; move on from it. But don't add intermediate nodes |
| 2754 | ;; to the history on recursive calls. | 2768 | ;; to the history on recursive calls. |
| 2755 | (let (Info-history) | 2769 | (let ((old-history Info-history)) |
| 2756 | (Info-next-preorder))) | 2770 | (Info-next-preorder) |
| 2771 | (if Info-history-skip-intermediate-nodes | ||
| 2772 | (setq Info-history old-history)))) | ||
| 2757 | (t | 2773 | (t |
| 2758 | (error "No more nodes")))) | 2774 | (error "No more nodes")))) |
| 2759 | 2775 | ||
| @@ -2767,24 +2783,28 @@ N is the digit argument used to invoke this command." | |||
| 2767 | ;; so we can scroll back through it. | 2783 | ;; so we can scroll back through it. |
| 2768 | (goto-char (point-max)))) | 2784 | (goto-char (point-max)))) |
| 2769 | ;; Keep going down, as long as there are nested menu nodes. | 2785 | ;; Keep going down, as long as there are nested menu nodes. |
| 2770 | (let (Info-history) ; Don't add intermediate nodes to the history. | 2786 | (let ((old-history Info-history)) |
| 2771 | (while (Info-no-error | 2787 | (while (Info-no-error |
| 2772 | (Info-last-menu-item) | 2788 | (Info-last-menu-item) |
| 2773 | ;; If we go down a menu item, go to the end of the node | 2789 | ;; If we go down a menu item, go to the end of the node |
| 2774 | ;; so we can scroll back through it. | 2790 | ;; so we can scroll back through it. |
| 2775 | (goto-char (point-max))))) | 2791 | (goto-char (point-max)))) |
| 2792 | (if Info-history-skip-intermediate-nodes | ||
| 2793 | (setq Info-history old-history))) | ||
| 2776 | (recenter -1)) | 2794 | (recenter -1)) |
| 2777 | ((and (Info-no-error (Info-extract-pointer "prev")) | 2795 | ((and (Info-no-error (Info-extract-pointer "prev")) |
| 2778 | (not (equal (Info-extract-pointer "up") | 2796 | (not (equal (Info-extract-pointer "up") |
| 2779 | (Info-extract-pointer "prev")))) | 2797 | (Info-extract-pointer "prev")))) |
| 2780 | (Info-no-error (Info-prev)) | 2798 | (Info-no-error (Info-prev)) |
| 2781 | (goto-char (point-max)) | 2799 | (goto-char (point-max)) |
| 2782 | (let (Info-history) ; Don't add intermediate nodes to the history. | 2800 | (let ((old-history Info-history)) |
| 2783 | (while (Info-no-error | 2801 | (while (Info-no-error |
| 2784 | (Info-last-menu-item) | 2802 | (Info-last-menu-item) |
| 2785 | ;; If we go down a menu item, go to the end of the node | 2803 | ;; If we go down a menu item, go to the end of the node |
| 2786 | ;; so we can scroll back through it. | 2804 | ;; so we can scroll back through it. |
| 2787 | (goto-char (point-max))))) | 2805 | (goto-char (point-max)))) |
| 2806 | (if Info-history-skip-intermediate-nodes | ||
| 2807 | (setq Info-history old-history))) | ||
| 2788 | (recenter -1)) | 2808 | (recenter -1)) |
| 2789 | ((Info-no-error (Info-up t)) | 2809 | ((Info-no-error (Info-up t)) |
| 2790 | (goto-char (point-min)) | 2810 | (goto-char (point-min)) |