]> code.delx.au - gnu-emacs/blobdiff - lisp/info.el
* test/lisp/help-fns-tests.el: Add several tests for 'describe-function'.
[gnu-emacs] / lisp / info.el
index 454fadaca0347c29f6e7db7ade51387877e1cf4b..bb259bd59eb345b814678abf059268db8ca63327 100644 (file)
@@ -1,6 +1,6 @@
 ;; info.el --- Info package for Emacs  -*- lexical-binding:t -*-
 
-;; Copyright (C) 1985-1986, 1992-2015 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1992-2016 Free Software Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
 ;; Keywords: help
@@ -81,28 +81,24 @@ The Lisp code is executed when the node is selected.")
     (t :height 1.2 :inherit info-title-2))
   "Face for info titles at level 1."
   :group 'info)
-(define-obsolete-face-alias 'Info-title-1-face 'info-title-1 "22.1")
 
 (defface info-title-2
   '((((type tty pc) (class color)) :foreground "lightblue" :weight bold)
     (t :height 1.2 :inherit info-title-3))
   "Face for info titles at level 2."
   :group 'info)
-(define-obsolete-face-alias 'Info-title-2-face 'info-title-2 "22.1")
 
 (defface info-title-3
   '((((type tty pc) (class color)) :weight bold)
     (t :height 1.2 :inherit info-title-4))
   "Face for info titles at level 3."
   :group 'info)
-(define-obsolete-face-alias 'Info-title-3-face 'info-title-3 "22.1")
 
 (defface info-title-4
   '((((type tty pc) (class color)) :weight bold)
     (t :weight bold :inherit variable-pitch))
   "Face for info titles at level 4."
   :group 'info)
-(define-obsolete-face-alias 'Info-title-4-face 'info-title-4 "22.1")
 
 (defface info-menu-header
   '((((type tty pc))
@@ -119,7 +115,6 @@ The Lisp code is executed when the node is selected.")
     (t :underline t))
   "Face for every third `*' in an Info menu."
   :group 'info)
-(define-obsolete-face-alias 'info-menu-5 'info-menu-star "22.1")
 
 (defface info-xref
   '((t :inherit link))
@@ -189,15 +184,11 @@ A header-line does not scroll with the rest of the buffer."
               configure-info-directory)))
         (prefixes
          ;; Directory trees in which to look for info subdirectories
-         (prune-directory-list '("/usr/local/" "/usr/" "/opt/" "/")))
+         (prune-directory-list '("/usr/local/" "/usr/" "/opt/")))
         (suffixes
          ;; Subdirectories in each directory tree that may contain info
-         ;; directories.  Most of these are rather outdated.
-         ;; It ought to be fine to stop checking the "emacs" ones now,
-         ;; since this is Emacs and we have not installed info files
-         ;; into such directories for a looong time...
-         '("share/" "" "gnu/" "gnu/lib/" "gnu/lib/emacs/"
-           "emacs/" "lib/" "lib/emacs/"))
+         ;; directories.
+         '("share/" ""))
         (standard-info-dirs
          (apply #'nconc
                 (mapcar (lambda (pfx)
@@ -2114,14 +2105,14 @@ If DIRECTION is `backward', search in the reverse direction."
                   search-whitespace-regexp)))
          (Info-search
           (cond
-           (isearch-word
+           (isearch-regexp-function
             ;; Lax version of word search
             (let ((lax (not (or isearch-nonincremental
                                 (eq (length string)
                                     (length (isearch--state-string
                                              (car isearch-cmds))))))))
-              (if (functionp isearch-word)
-                  (funcall isearch-word string lax)
+              (if (functionp isearch-regexp-function)
+                  (funcall isearch-regexp-function string lax)
                 (word-search-regexp string lax))))
            (isearch-regexp string)
            (t (regexp-quote string)))
@@ -3381,11 +3372,11 @@ Give an empty topic name to go to the Index node itself."
           (car (car Info-index-alternatives))
           (nth 2 (car Info-index-alternatives))
           (if (cdr Info-index-alternatives)
-              (format "(%s total; use `%s' for next)"
-                      (length Info-index-alternatives)
-                      (key-description (where-is-internal
-                                        'Info-index-next overriding-local-map
-                                        t)))
+              (format-message
+               "(%s total; use `%s' for next)"
+               (length Info-index-alternatives)
+               (key-description (where-is-internal
+                                 'Info-index-next overriding-local-map t)))
             "(Only match)")))
 
 (defun Info-find-index-name (name)
@@ -3495,7 +3486,8 @@ search results."
        (setq Info-history-list ohist-list)
        (Info-goto-node orignode)
        (message "")))
-    (Info-find-node Info-current-file (format "*Index for ‘%s’*" topic))))
+    (Info-find-node Info-current-file
+                    (format "*Index for ‘%s’*" topic))))
 \f
 (add-to-list 'Info-virtual-files
             '("\\`\\*Apropos\\*\\'"
@@ -3762,7 +3754,7 @@ Build a menu of the possible matches."
     ;; I think nxml is the only exception - maybe it should be just be renamed.
     (let ((str (ignore-errors (lm-commentary (find-library-name nodename)))))
       (if (null str)
-         (insert "Can't find package description.\n\n")
+         (insert "Cant find package description.\n\n")
        (insert
         (with-temp-buffer
           (insert str)
@@ -3837,7 +3829,7 @@ START is a regular expression which will match the
     beginning of the tokens delimited string.
 ALL is a regular expression with a single
     parenthesized subpattern which is the token to be
-    returned.  E.g. '{\(.*\)}' would return any string
+    returned.  E.g. `{(.*)}' would return any string
     enclosed in braces around POS.
 ERRORSTRING optional fourth argument, controls action on no match:
     nil: return nil
@@ -4235,7 +4227,7 @@ With a zero prefix arg, put the name inside a function call to `info'."
   "Syntax table used in `Info-mode'.")
 
 (defface Info-quoted
-  '((t :family "courier"))
+  '((t :inherit fixed-pitch-serif))
   "Face used for quoted elements.")
 
 (defvar Info-mode-font-lock-keywords
@@ -4719,28 +4711,28 @@ first line or header line, and for breadcrumb links.")
       ;; Fontify titles
       (goto-char (point-min))
       (when (and font-lock-mode not-fontified-p)
-        (while (and (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*\\*+\\|==+\\|--+\\|\\.\\.+\\)$"
-                                       nil t)
-                    ;; Only consider it as an underlined title if the ASCII
-                    ;; underline has the same size as the text.  A typical
-                    ;; counter example is when a continuation "..." is alone
-                    ;; on a line.
-                    (= (string-width (match-string 1))
-                       (string-width (match-string 2))))
-          (let* ((c (preceding-char))
-                 (face
-                  (cond ((= c ?*) 'info-title-1)
-                        ((= c ?=) 'info-title-2)
-                        ((= c ?-) 'info-title-3)
-                        (t        'info-title-4))))
-            (put-text-property (match-beginning 1) (match-end 1)
-                               'font-lock-face face))
-          ;; This is a serious problem for trying to handle multiple
-          ;; frame types at once.  We want this text to be invisible
-          ;; on frames that can display the font above.
-          (when (memq (framep (selected-frame)) '(x pc w32 ns))
-            (add-text-properties (1- (match-beginning 2)) (match-end 2)
-                                 '(invisible t front-sticky nil rear-nonsticky t)))))
+        (while (re-search-forward "\n\\([^ \t\n].+\\)\n\\(\\*\\*+\\|==+\\|--+\\|\\.\\.+\\)$"
+                                  nil t)
+          ;; Only consider it as an underlined title if the ASCII
+          ;; underline has the same size as the text.  A typical
+          ;; counter example is when a continuation "..." is alone
+          ;; on a line.
+          (when (= (string-width (match-string 1))
+                   (string-width (match-string 2)))
+            (let* ((c (preceding-char))
+                   (face
+                    (cond ((= c ?*) 'info-title-1)
+                          ((= c ?=) 'info-title-2)
+                          ((= c ?-) 'info-title-3)
+                          (t        'info-title-4))))
+              (put-text-property (match-beginning 1) (match-end 1)
+                                 'font-lock-face face))
+            ;; This is a serious problem for trying to handle multiple
+            ;; frame types at once.  We want this text to be invisible
+            ;; on frames that can display the font above.
+            (when (memq (framep (selected-frame)) '(x pc w32 ns))
+              (add-text-properties (1- (match-beginning 2)) (match-end 2)
+                                   '(invisible t front-sticky nil rear-nonsticky t))))))
 
       ;; Fontify cross references
       (goto-char (point-min))