Function: Info-index-next

Info-index-next is an interactive and byte-compiled function defined in info.el.gz.

Signature

(Info-index-next NUM)

Documentation

Go to the next matching index item from the last i (Info-index) command.

If given a numeric prefix, skip that many index items forward (or backward).

Also see the Info-warn-on-index-alternatives-wrap user option.

Probably introduced at or before Emacs version 24.4.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/info.el.gz
(defun Info-index-next (num)
  "Go to the next matching index item from the last \\<Info-mode-map>\\[Info-index] command.
If given a numeric prefix, skip that many index items forward (or
backward).

Also see the `Info-warn-on-index-alternatives-wrap' user option."
  (interactive "p" Info-mode)
  (unless Info-index-alternatives
    (user-error "No previous `i' command"))
  (let ((index (+ Info--current-index-alternative num))
        (total (length Info-index-alternatives))
        (next-key (key-description (where-is-internal
				    'Info-index-next overriding-local-map t))))
    (if (and Info-warn-on-index-alternatives-wrap
             (> total 1)
             (cond
              ((< index 0)
               (setq Info--current-index-alternative (- total 2))
               (message
                "No previous matches, use `%s' to continue from end of list"
                next-key)
               t)
              ((>= index total)
               (setq Info--current-index-alternative -1)
               (message
                "No previous matches, use `%s' to continue from start of list"
                next-key)
               t)))
        ()                              ; Do nothing
      (setq index (mod index total)
            Info--current-index-alternative index)
      (let ((entry (nth index Info-index-alternatives)))
        (Info-goto-node (nth 1 entry))
        (if (> (nth 3 entry) 0)
            ;; Forward 2 lines less because `Info-find-node-2' initially
            ;; puts point to the 2nd line.
            (forward-line (- (nth 3 entry) 2))
          (forward-line 3)              ; don't search in headers
          (Info-find-index-name (car entry)))
        (message "Found `%s' in %s.  %s"
                 (car entry)
                 (nth 2 entry)
                 (if (> total 1)
                     (format-message
                      "(%s total; use `%s' for next)" total next-key)
                   "(Only match)"))))))