(format "*info*<%s>" current-prefix-arg))))
(info-pop-to-buffer file-or-node buffer t))
+(put 'info-other-window 'minibuffer-action 'info)
+
(defun info-pop-to-buffer (&optional file-or-node buffer-or-name other-window)
"Put Info node FILE-OR-NODE in specified buffer and display it.
Optional argument FILE-OR-NODE is as for `info'.
(info-pop-to-buffer file-or-node buffer))
+(put 'info 'minibuffer-action
+ (cons (lambda (f) (save-selected-window (info f))) "info"))
+
(defun info-setup (file-or-node buffer)
"Display Info node FILE-OR-NODE in BUFFER."
(if (and buffer (not (derived-mode-p 'Info-mode)))
Info-history))
(Info-find-node-2 filename nodename no-going-back strict-case))
-;;;###autoload
-(defun Info-on-current-buffer (&optional nodename)
- "Use Info mode to browse the current Info buffer.
-With a prefix arg, this queries for the node name to visit first;
-otherwise, that defaults to `Top'."
- (interactive
- (list (if current-prefix-arg
- (completing-read "Node name: " (Info-build-node-completions)
- nil t "Top"))))
- (unless nodename (setq nodename "Top"))
- (info-initialize)
- (Info-mode)
- (setq Info-current-file
- (or buffer-file-name
- ;; If called on a non-file buffer, make a fake file name.
- (concat default-directory (buffer-name))))
- (Info-find-node-2 nil nodename))
-
(defun Info-revert-find-node (filename nodename)
"Go to an Info node FILENAME and NODENAME, re-reading disk contents.
When *info* is already displaying FILENAME and NODENAME, the window position
;; Go to an Info node specified with a filename-and-nodename string
;; of the sort that is found in pointers in nodes.
-;; Don't autoload this function: the correct entry point for other packages
-;; to use is `info'. --Stef
-;; ;;;###autoload
(defun Info-goto-node (nodename &optional fork strict-case)
"Go to Info node named NODENAME. Give just NODENAME or (FILENAME)NODENAME.
If NODENAME is of the form (FILENAME)NODENAME, the node is in the Info file
This function first looks for a case-sensitive match for the node part
of NODENAME; if none is found it then tries a case-insensitive match
\(unless STRICT-CASE is non-nil)."
- (interactive (list (Info-read-node-name "Go to node: ") current-prefix-arg))
+ (interactive (list (Info-read-node-name "Go to node: ") current-prefix-arg)
+ Info-mode)
(info-initialize)
(if fork
(set-buffer
(Info-find-node (if (equal filename "") nil filename)
(if (equal nodename "") "Top" nodename) nil strict-case)))
+(put 'Info-goto-node 'minibuffer-action
+ (cons (lambda (n) (save-selected-window
+ (with-current-buffer minibuffer--original-buffer
+ (Info-goto-node n t))))
+ "goto"))
+
(defun Info-goto-node-web (node)
"Use `browse-url' to go to the gnu.org web server's version of NODE.
By default, go to the current Info node."
(browse-url-button-open-url
(Info-url-for-node (format "(%s)%s" filename node)))))
+(put 'Info-goto-node-web 'minibuffer-action
+ (cons (lambda (n)
+ (save-selected-window
+ (with-current-buffer minibuffer--original-buffer
+ (Info-goto-node-web n))))
+ "surf"))
+
(defun Info-url-for-node (node)
"Return the URL corresponding to NODE.
(setq Info-history (cons (list ofile onode opoint)
Info-history))))))
+(put 'Info-search 'minibuffer-action
+ (cons (lambda (r)
+ (with-selected-window (minibuffer-selected-window)
+ (Info-search r)))
+ "search"))
+
(defun Info-search-case-sensitively ()
"Search for a regexp case-sensitively."
(interactive nil Info-mode)
(let ((case-fold-search nil))
(call-interactively 'Info-search)))
+(put 'Info-search-case-sensitively 'minibuffer-action 'Info-search)
+
(defun Info-search-next ()
"Search for next regexp from a previous `Info-search' command."
(interactive nil Info-mode)
Info-mode)
(Info-search regexp bound noerror count 'backward))
+(put 'Info-search-backward 'minibuffer-action 'Info-search)
+
(defun Info-isearch-search ()
(if Info-isearch-search
(lambda (string &optional bound noerror count)
(setq i (+ i 1)))
(Info-goto-node target fork)))
+(put 'Info-follow-reference 'minibuffer-action
+ (cons (lambda (f)
+ (save-selected-window
+ (with-current-buffer minibuffer--original-buffer
+ (Info-follow-reference f t))))
+ "follow"))
+
(defconst Info-menu-entry-name-re "\\(?:[^:]\\|:[^:,.;() \t\n]\\)*"
;; We allow newline because this is also used in Info-follow-reference,
;; where the xref name might be wrapped over two lines.
(and fork
(if (stringp fork) fork menu-item))))
+(put 'Info-menu 'minibuffer-action
+ (cons (lambda (m)
+ (save-selected-window
+ (with-current-buffer minibuffer--original-buffer
+ (Info-menu m t))))
+ "goto"))
+
(defun Info-extract-menu-item (menu-item)
(setq menu-item (regexp-quote menu-item))
(let ((case-fold-search t))
Info--current-index-alternative 0)
(Info-index-next 0)))))
+(put 'Info-index 'minibuffer-action
+ (cons (lambda (i)
+ (save-selected-window
+ (with-selected-window (minibuffer-selected-window)
+ (Info-index i))))
+ "goto"))
+
(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
(message "")))
(Info-find-node Info-current-file
(format "*Index for ā%sā*" topic))))
-\f
+
+(put 'Info-virtual-index 'minibuffer-action
+ (cons (lambda (i)
+ (save-selected-window
+ (with-selected-window (minibuffer-selected-window)
+ (Info-virtual-index i))))
+ "goto"))
+
(add-to-list 'Info-virtual-files
'("\\`\\*Apropos\\*\\'"
(toc-nodes . Info-apropos-toc-nodes)
(slow . t)
))
+\f
(defvar Info-apropos-file "*Apropos*"
"Info file name of the virtual manual for matches of `info-apropos'.")
(Info-find-node Info-finder-file "Top")))
\f
-(defun Info-undefined ()
- "Make command be undefined in Info."
- (interactive nil Info-mode)
- (ding))
-
(defun Info-help ()
"Enter the Info tutorial."
(interactive)
(info (Info-find-file manual)
(generate-new-buffer-name "*info*")))))
+(put 'info-display-manual 'minibuffer-action
+ (cons (lambda (m) (save-selected-window (info-display-manual m)))
+ "display"))
+
(defun info--filter-manual-names (names)
(cl-flet ((strip (name)
(replace-regexp-in-string "\\([-.]info\\)?\\(\\.gz\\)?\\'"