;; 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
(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))
(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))
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)
Info-current-file-completions nil
buffer-file-name nil)
(erase-buffer)
+ ;; Erase any memory of the previous coding-system, so that
+ ;; info-insert-file-contents sets the buffer's encoding to
+ ;; what the Info file specifies.
+ (set-buffer-file-coding-system 'undecided t)
(info-insert-file-contents filename nil)
(setq default-directory (file-name-directory filename))
(set-buffer-modified-p nil)
(goto-char pos)
(throw 'foo t)))
+ ;; If the Texinfo source had an @ifnottex block of text
+ ;; before the Top node, makeinfo 5.0 and 5.1 mistakenly
+ ;; omitted that block's size from the starting position
+ ;; of the 1st subfile, which makes GUESSPOS overshoot
+ ;; the correct position by the length of that text. So
+ ;; we try again with a larger slop.
+ (goto-char (max (point-min) (- guesspos 10000)))
+ (let ((pos (Info-find-node-in-buffer regexp strict-case)))
+ (when pos
+ (goto-char pos)
+ (throw 'foo t)))
+
(when (string-match "\\([^.]+\\)\\." nodename)
(let (Info-point-loc)
(Info-find-node-2
(if (looking-at "\^_")
(forward-char 1)
(search-forward "\n\^_"))
- ;; Don't add the length of the skipped summary segment to
- ;; the value returned to `Info-find-node-2'. (Bug#14125)
(if (numberp nodepos)
- (- nodepos lastfilepos))))
+ ;; Our caller ('Info-find-node-2') wants the (zero-based) byte
+ ;; offset corresponding to NODEPOS, from the beginning of the
+ ;; subfile. This is especially important if NODEPOS is for an
+ ;; anchor reference, because for those the position is all we
+ ;; have.
+ (+ (- nodepos lastfilepos) (bufferpos-to-filepos (point) 'exact)))))
(defun Info-unescape-quotes (value)
"Unescape double quotes and backslashes in VALUE."
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)))
(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)
(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\\*\\'"
(defun info--prettify-description (desc)
(if (stringp desc)
(with-temp-buffer
- (insert desc)
+ (insert (substitute-command-keys desc))
(if (equal ?. (char-before))
(delete-char -1))
(goto-char (point-min))
;; 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 "Can’t find package description.\n\n")
(insert
(with-temp-buffer
(insert str)
(message (if flag "Type Space to see more"
"Type Space to return to Info"))
(if (not (eq ?\s (setq ch (read-event))))
- (progn (setq unread-command-events (list ch)) nil)
+ (progn (push ch unread-command-events) nil)
flag))
(scroll-up)))
(bury-buffer "*Help*")))
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
"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
;; 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))