From b108eac242e94b396179bc0e58de3952d0abf64f Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Sun, 25 Jul 1999 05:47:46 +0000 Subject: [PATCH] (info-lookup-interactive-arguments): Add optional argument query for new choice of help mode. (info-lookup-symbol): Use it. (info-lookup-file): Ditto. (info-lookup): Don't switch to other window, if already in Info buffer. --- lisp/info-look.el | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/lisp/info-look.el b/lisp/info-look.el index 9b1bdc791f1..9b0a0c2ed11 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -264,9 +264,11 @@ system." When this command is called interactively, it reads SYMBOL from the minibuffer. In the minibuffer, use M-n to yank the default argument value into the minibuffer so you can edit it. -The default symbol is the one found at point." +The default symbol is the one found at point. + +With prefix arg a query for the symbol help mode is offered." (interactive - (info-lookup-interactive-arguments 'symbol)) + (info-lookup-interactive-arguments 'symbol current-prefix-arg)) (info-lookup 'symbol symbol mode)) ;;;###autoload @@ -275,16 +277,21 @@ The default symbol is the one found at point." When this command is called interactively, it reads FILE from the minibuffer. In the minibuffer, use M-n to yank the default file name into the minibuffer so you can edit it. -The default file name is the one found at point." +The default file name is the one found at point. + +With prefix arg a query for the file help mode is offered." (interactive - (info-lookup-interactive-arguments 'file)) + (info-lookup-interactive-arguments 'file current-prefix-arg)) (info-lookup 'file file mode)) -(defun info-lookup-interactive-arguments (topic) - "Read and return argument value (and help mode) for help topic TOPIC." - (let* ((mode (if (info-lookup->mode-value topic (info-lookup-select-mode)) - info-lookup-mode - (info-lookup-change-mode topic))) +(defun info-lookup-interactive-arguments (topic &optional query) + "Read and return argument value (and help mode) for help topic TOPIC. +If optional argument QUERY is non-nil, query for the help mode." + (let* ((mode (cond (query + (info-lookup-change-mode topic)) + ((info-lookup->mode-value topic (info-lookup-select-mode)) + info-lookup-mode) + ((info-lookup-change-mode topic)))) (completions (info-lookup->completions topic mode)) (default (info-lookup-guess-default topic mode)) (completion-ignore-case (info-lookup->ignore-case topic mode)) @@ -331,7 +338,8 @@ The default file name is the one found at point." (modes (info-lookup->all-modes topic mode)) (window (selected-window)) found doc-spec node prefix suffix doc-found) - (if (not info-lookup-other-window-flag) + (if (or (not info-lookup-other-window-flag) + (eq (current-buffer) (get-buffer "*info*"))) (info) (save-window-excursion (info)) (switch-to-buffer-other-window "*info*")) -- 2.39.5