]> code.delx.au - gnu-emacs/blobdiff - lisp/info.el
* lisp/minibuffer.el (completion-file-name-table): Complete user names.
[gnu-emacs] / lisp / info.el
index 4f2f33d017c558a135b1980b2a9d3a0c77439f5d..042ff1583620fb149824d5bd3b587a17d8ef849e 100644 (file)
@@ -1,6 +1,6 @@
 ;; info.el --- info package for Emacs
 
-;; Copyright (C) 1985-1986, 1992-2011  Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1992-2012  Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: help
@@ -1165,6 +1165,12 @@ a case-insensitive match is tried."
                       (progn (setq file (expand-file-name "dir.info" truename))
                              (file-attributes file))
                       (progn (setq file (expand-file-name "DIR.INFO" truename))
+                             (file-attributes file))
+                      ;; Shouldn't really happen, but sometimes does,
+                      ;; eg on Debian systems with buggy packages;
+                      ;; so may as well try it.
+                      ;; http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00005.html
+                      (progn (setq file (expand-file-name "dir.gz" truename))
                              (file-attributes file)))))
                (setq dirs-done
                      (cons truename
@@ -1769,12 +1775,14 @@ If DIRECTION is `backward', search in the reverse direction."
       ;; If no subfiles, give error now.
       (if give-up
          (if (null Info-current-subfile)
-             (let ((search-spaces-regexp
-                    (if (or (not isearch-mode) isearch-regexp)
-                        Info-search-whitespace-regexp)))
-               (if backward
-                   (re-search-backward regexp)
-                 (re-search-forward regexp)))
+             (if isearch-mode
+                 (signal 'search-failed (list regexp "end of manual"))
+               (let ((search-spaces-regexp
+                      (if (or (not isearch-mode) isearch-regexp)
+                          Info-search-whitespace-regexp)))
+                 (if backward
+                     (re-search-backward regexp)
+                   (re-search-forward regexp))))
            (setq found nil)))
 
       (if (and bound (not found))
@@ -1845,7 +1853,7 @@ If DIRECTION is `backward', search in the reverse direction."
              (if found
                  (message "")
                (signal 'search-failed (if isearch-mode
-                                          (list regexp "end of the manual")
+                                          (list regexp "end of manual")
                                         (list regexp)))))
          (if (not found)
              (progn (Info-read-subfile osubfile)
@@ -2249,7 +2257,7 @@ Table of contents is created from the tree structure of menus."
                              (match-string-no-properties 1)))
                 (section "Top")
                 menu-items)
-           (when (string-match "(" upnode) (setq upnode nil))
+           (when (and upnode (string-match "(" upnode)) (setq upnode nil))
             (when (and (not (Info-index-node nodename file))
                        (re-search-forward "^\\* Menu:" bound t))
               (forward-line 1)
@@ -2586,7 +2594,9 @@ new buffer."
        (list item current-prefix-arg))))
   ;; there is a problem here in that if several menu items have the same
   ;; name you can only go to the node of the first with this command.
-  (Info-goto-node (Info-extract-menu-item menu-item) (if fork menu-item)))
+  (Info-goto-node (Info-extract-menu-item menu-item)
+                 (and fork
+                      (if (stringp fork) fork menu-item))))
 
 (defun Info-extract-menu-item (menu-item)
   (setq menu-item (regexp-quote menu-item))
@@ -3240,7 +3250,7 @@ search results."
        (Info-index topic)
        (push (cons (cons Info-current-file topic) Info-index-alternatives)
              Info-virtual-index-nodes)
-       ;; Clean up unneccessary side-effects of `Info-index'.
+       ;; Clean up unnecessary side-effects of `Info-index'.
        (setq Info-history-list ohist-list)
        (Info-goto-node orignode)
        (message "")))
@@ -3704,7 +3714,7 @@ If FORK is non-nil, it is passed to `Info-goto-node'."
     (define-key map "b" 'beginning-of-buffer)
     (put 'beginning-of-buffer :advertised-binding "b")
     (define-key map "d" 'Info-directory)
-    (define-key map "e" 'Info-edit)
+    (define-key map "e" 'end-of-buffer)
     (define-key map "f" 'Info-follow-reference)
     (define-key map "g" 'Info-goto-node)
     (define-key map "h" 'Info-help)