]> code.delx.au - gnu-emacs/blobdiff - lisp/info.el
* lisp/mouse.el (minor-mode-menu-from-indicator):
[gnu-emacs] / lisp / info.el
index 7c4d7f3323155ef51ce2f29ca2ed7c2c951e0cca..057bd77ba164ae8f36241577d2ad2315258cdd7b 100644 (file)
@@ -1,6 +1,6 @@
 ;; info.el --- Info package for Emacs  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1985-1986, 1992-2014 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1992-2015 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: help
@@ -2577,7 +2577,9 @@ new buffer."
     (save-excursion
       ;; Move point to the beginning of reference if point is on reference
       (or (looking-at "\\*note[ \n\t]+")
-          (and (looking-back "\\*note[ \n\t]+")
+          (and (looking-back "\\*note[ \n\t]+"
+                             (save-excursion (skip-chars-backward " \n\t")
+                                             (line-beginning-position)))
                (goto-char (match-beginning 0)))
           (if (and (save-excursion
                      (goto-char (+ (point) 5)) ; skip a possible *note
@@ -4738,9 +4740,11 @@ first line or header line, and for breadcrumb links.")
                    ;; an end of sentence
                    (skip-syntax-backward " ("))
                   (setq other-tag
-                       (cond ((save-match-data (looking-back "\\<see"))
+                       (cond ((save-match-data (looking-back "\\<see"
+                                                              (- (point) 3)))
                               "")
-                             ((save-match-data (looking-back "\\<in"))
+                             ((save-match-data (looking-back "\\<in"
+                                                              (- (point) 2)))
                               "")
                              ((memq (char-before) '(nil ?\. ?! ??))
                                "See ")
@@ -5277,13 +5281,15 @@ type returned by `Info-bookmark-make-record', which see."
 (defun info-display-manual (manual)
   "Display an Info buffer displaying MANUAL.
 If there is an existing Info buffer for MANUAL, display it.
-Otherwise, visit the manual in a new Info buffer."
+Otherwise, visit the manual in a new Info buffer.  In interactive
+use, a prefix argument directs this command to limit the
+completion alternatives to currently visited manuals."
   (interactive
    (list
     (progn
       (info-initialize)
       (completing-read "Manual name: "
-                      (info--manual-names)
+                      (info--manual-names current-prefix-arg)
                       nil t))))
   (let ((blist (buffer-list))
        (manual-re (concat "\\(/\\|\\`\\)" manual "\\(\\.\\|\\'\\)"))
@@ -5302,7 +5308,7 @@ Otherwise, visit the manual in a new Info buffer."
       (info (Info-find-file manual)
            (generate-new-buffer-name "*info*")))))
 
-(defun info--manual-names ()
+(defun info--manual-names (visited-only)
   (let (names)
     (dolist (buffer (buffer-list))
       (with-current-buffer buffer
@@ -5313,11 +5319,12 @@ Otherwise, visit the manual in a new Info buffer."
                    (file-name-nondirectory Info-current-file))
                   names))))
     (delete-dups (append (nreverse names)
-                        (all-completions
-                         ""
-                         (apply-partially 'Info-read-node-name-2
-                                          Info-directory-list
-                                          (mapcar 'car Info-suffix-list)))))))
+                        (when (not visited-only)
+                          (all-completions
+                           ""
+                           (apply-partially 'Info-read-node-name-2
+                                            Info-directory-list
+                                            (mapcar 'car Info-suffix-list))))))))
 
 (provide 'info)