diff options
| -rw-r--r-- | lisp/info.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/info.el b/lisp/info.el index 8860a664bd7..7d44a1cec1d 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -3329,6 +3329,12 @@ If FILE is nil, check the current Info file." | |||
| 3329 | (or node (error "No index")) | 3329 | (or node (error "No index")) |
| 3330 | (Info-goto-node node))) | 3330 | (Info-goto-node node))) |
| 3331 | 3331 | ||
| 3332 | (defun info--ensure-not-in-directory-node () | ||
| 3333 | (if (equal Info-current-file "dir") | ||
| 3334 | (error (substitute-command-keys | ||
| 3335 | (concat "The Info directory node has no index; " | ||
| 3336 | "type \\[Info-menu] to select a manual"))))) | ||
| 3337 | |||
| 3332 | ;;;###autoload | 3338 | ;;;###autoload |
| 3333 | (defun Info-index (topic) | 3339 | (defun Info-index (topic) |
| 3334 | "Look up a string TOPIC in the index for this manual and go to that entry. | 3340 | "Look up a string TOPIC in the index for this manual and go to that entry. |
| @@ -3342,15 +3348,13 @@ Give an empty topic name to go to the Index node itself." | |||
| 3342 | (Info-complete-menu-buffer (clone-buffer)) | 3348 | (Info-complete-menu-buffer (clone-buffer)) |
| 3343 | (Info-complete-nodes (Info-index-nodes)) | 3349 | (Info-complete-nodes (Info-index-nodes)) |
| 3344 | (Info-history-list nil)) | 3350 | (Info-history-list nil)) |
| 3345 | (if (equal Info-current-file "dir") | 3351 | (info--ensure-not-in-directory-node) |
| 3346 | (error "The Info directory node has no index; use m to select a manual")) | ||
| 3347 | (unwind-protect | 3352 | (unwind-protect |
| 3348 | (with-current-buffer Info-complete-menu-buffer | 3353 | (with-current-buffer Info-complete-menu-buffer |
| 3349 | (Info-goto-index) | 3354 | (Info-goto-index) |
| 3350 | (completing-read "Index topic: " #'Info-complete-menu-item)) | 3355 | (completing-read "Index topic: " #'Info-complete-menu-item)) |
| 3351 | (kill-buffer Info-complete-menu-buffer))))) | 3356 | (kill-buffer Info-complete-menu-buffer))))) |
| 3352 | (if (equal Info-current-file "dir") | 3357 | (info--ensure-not-in-directory-node) |
| 3353 | (error "The Info directory node has no index; use m to select a manual")) | ||
| 3354 | ;; Strip leading colon in topic; index format does not allow them. | 3358 | ;; Strip leading colon in topic; index format does not allow them. |
| 3355 | (if (and (stringp topic) | 3359 | (if (and (stringp topic) |
| 3356 | (> (length topic) 0) | 3360 | (> (length topic) 0) |
| @@ -3533,8 +3537,7 @@ search results." | |||
| 3533 | (Info-complete-menu-buffer (clone-buffer)) | 3537 | (Info-complete-menu-buffer (clone-buffer)) |
| 3534 | (Info-complete-nodes (Info-index-nodes)) | 3538 | (Info-complete-nodes (Info-index-nodes)) |
| 3535 | (Info-history-list nil)) | 3539 | (Info-history-list nil)) |
| 3536 | (if (equal Info-current-file "dir") | 3540 | (info--ensure-not-in-directory-node) |
| 3537 | (error "The Info directory node has no index; use m to select a manual")) | ||
| 3538 | (unwind-protect | 3541 | (unwind-protect |
| 3539 | (with-current-buffer Info-complete-menu-buffer | 3542 | (with-current-buffer Info-complete-menu-buffer |
| 3540 | (Info-goto-index) | 3543 | (Info-goto-index) |