diff options
| -rw-r--r-- | lisp/info-look.el | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/lisp/info-look.el b/lisp/info-look.el index 920a9afc977..f8b56bc55e7 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el | |||
| @@ -318,13 +318,14 @@ If optional argument QUERY is non-nil, query for the help mode." | |||
| 318 | (or mode (setq mode (info-lookup-select-mode))) | 318 | (or mode (setq mode (info-lookup-select-mode))) |
| 319 | (or (info-lookup->mode-value topic mode) | 319 | (or (info-lookup->mode-value topic mode) |
| 320 | (error "No %s help available for `%s'" topic mode)) | 320 | (error "No %s help available for `%s'" topic mode)) |
| 321 | (let ((entry (or (assoc (if (info-lookup->ignore-case topic mode) | 321 | (let* ((completions (info-lookup->completions topic mode)) |
| 322 | (downcase item) item) | 322 | (ignore-case (info-lookup->ignore-case topic mode)) |
| 323 | (info-lookup->completions topic mode)) | 323 | (entry (or (assoc (if ignore-case (downcase item) item) completions) |
| 324 | (error "Not documented as a %s: %s" topic (or item "")))) | 324 | (assoc-ignore-case item completions) |
| 325 | (modes (info-lookup->all-modes topic mode)) | 325 | (error "Not documented as a %s: %s" topic (or item "")))) |
| 326 | (window (selected-window)) | 326 | (modes (info-lookup->all-modes topic mode)) |
| 327 | found doc-spec node prefix suffix doc-found) | 327 | (window (selected-window)) |
| 328 | found doc-spec node prefix suffix doc-found) | ||
| 328 | (if (or (not info-lookup-other-window-flag) | 329 | (if (or (not info-lookup-other-window-flag) |
| 329 | (eq (current-buffer) (get-buffer "*info*"))) | 330 | (eq (current-buffer) (get-buffer "*info*"))) |
| 330 | (info) | 331 | (info) |
| @@ -356,7 +357,12 @@ If optional argument QUERY is non-nil, query for the help mode." | |||
| 356 | nil)) | 357 | nil)) |
| 357 | (condition-case nil | 358 | (condition-case nil |
| 358 | (progn | 359 | (progn |
| 359 | (Info-menu (or (cdr entry) item)) | 360 | ;; Don't use Info-menu, it forces case-fold-search to t |
| 361 | (let ((case-fold-search nil)) | ||
| 362 | (re-search-forward | ||
| 363 | (concat "^\\* " (regexp-quote (or (cdr entry) (car entry))) | ||
| 364 | ":"))) | ||
| 365 | (Info-follow-nearest-node) | ||
| 360 | (setq found t) | 366 | (setq found t) |
| 361 | (if (or prefix suffix) | 367 | (if (or prefix suffix) |
| 362 | (let ((case-fold-search | 368 | (let ((case-fold-search |
| @@ -364,12 +370,12 @@ If optional argument QUERY is non-nil, query for the help mode." | |||
| 364 | (buffer-read-only nil)) | 370 | (buffer-read-only nil)) |
| 365 | (goto-char (point-min)) | 371 | (goto-char (point-min)) |
| 366 | (re-search-forward | 372 | (re-search-forward |
| 367 | (concat prefix (regexp-quote item) suffix)) | 373 | (concat prefix (regexp-quote (car entry)) suffix)) |
| 368 | (goto-char (match-beginning 0)) | 374 | (goto-char (match-beginning 0)) |
| 369 | (and (display-color-p) info-lookup-highlight-face | 375 | (and (display-color-p) info-lookup-highlight-face |
| 370 | ;; Search again for ITEM so that the first | 376 | ;; Search again for ITEM so that the first |
| 371 | ;; occurrence of ITEM will be highlighted. | 377 | ;; occurrence of ITEM will be highlighted. |
| 372 | (re-search-forward (regexp-quote item)) | 378 | (re-search-forward (regexp-quote (car entry))) |
| 373 | (let ((start (match-beginning 0)) | 379 | (let ((start (match-beginning 0)) |
| 374 | (end (match-end 0))) | 380 | (end (match-end 0))) |
| 375 | (if (overlayp info-lookup-highlight-overlay) | 381 | (if (overlayp info-lookup-highlight-overlay) |
| @@ -382,6 +388,11 @@ If optional argument QUERY is non-nil, query for the help mode." | |||
| 382 | (error nil))) | 388 | (error nil))) |
| 383 | (setq doc-spec (cdr doc-spec))) | 389 | (setq doc-spec (cdr doc-spec))) |
| 384 | (setq modes (cdr modes))) | 390 | (setq modes (cdr modes))) |
| 391 | ;; Alert the user if case was munged, and do this after bringing up the | ||
| 392 | ;; info buffer since that can print messages | ||
| 393 | (unless (or ignore-case | ||
| 394 | (string-equal item (car entry))) | ||
| 395 | (message "Found in differnt case: %s" (car entry))) | ||
| 385 | (or doc-found | 396 | (or doc-found |
| 386 | (error "Info documentation for lookup was not found")) | 397 | (error "Info documentation for lookup was not found")) |
| 387 | ;; Don't leave the Info buffer if the help item couldn't be looked up. | 398 | ;; Don't leave the Info buffer if the help item couldn't be looked up. |