summaryrefslogtreecommitdiff
path: root/lisp/info-look.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/info-look.el')
-rw-r--r--lisp/info-look.el40
1 files changed, 18 insertions, 22 deletions
diff --git a/lisp/info-look.el b/lisp/info-look.el
index b76150ecf78..cd59fdf17d7 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -1,5 +1,4 @@
;;; info-look.el --- major-mode-sensitive Info index lookup facility -*- lexical-binding: t -*-
-;; An older version of this was known as libc.el.
;; Copyright (C) 1995-1999, 2001-2024 Free Software Foundation, Inc.
@@ -28,11 +27,9 @@
;; Some additional sources of (Tex)info files for non-GNU packages:
;;
-;; Scheme: <URL:http://groups.csail.mit.edu/mac/ftpdir/scm/r5rs.info.tar.gz>
-;; LaTeX:
-;; <URL:http://ctan.tug.org/tex-archive/info/latex2e-help-texinfo/latex2e.texi>
+;; Scheme: https://groups.csail.mit.edu/mac/ftpdir/scm/r5rs.info.tar.gz
+;; LaTeX: https://mirrors.ctan.org/info/latex2e-help-texinfo/latex2e.texi
;; (or CTAN mirrors)
-;; Perl: <URL:http://ftp.cpan.org/pub/CPAN/doc/manual/texinfo/> (or CPAN mirrors)
;; Traditionally, makeinfo quoted `like this', but version 5 and later
;; quotes 'like this' or ‘like this’. Doc specs with patterns
@@ -56,13 +53,13 @@ Automatically becomes buffer local when set in any fashion.")
(make-variable-buffer-local 'info-lookup-mode)
(defcustom info-lookup-other-window-flag t
- "Non-nil means pop up the Info buffer in another window."
- :group 'info-lookup :type 'boolean)
+ "Non-nil means pop up the Info buffer in another window."
+ :type 'boolean)
(defcustom info-lookup-highlight-face 'match
"Face for highlighting looked up help items.
Setting this variable to nil disables highlighting."
- :group 'info-lookup :type 'face)
+ :type 'face)
(defvar info-lookup-highlight-overlay nil
"Overlay object used for highlighting.")
@@ -76,7 +73,7 @@ List elements are cons cells of the form
If a file name matches REGEXP, then use help mode MODE instead of the
buffer's major mode."
- :group 'info-lookup :type '(repeat (cons (regexp :tag "Regexp")
+ :type '(repeat (cons (regexp :tag "Regexp")
(symbol :tag "Mode"))))
(defvar info-lookup-history nil
@@ -170,13 +167,13 @@ the value of `:mode' as HELP-MODE, etc..
If no topic or mode option has been specified, then the help topic defaults
to `symbol', and the help mode defaults to the current major mode."
- (apply 'info-lookup-add-help* nil arg))
+ (apply #'info-lookup-add-help* nil arg))
(defun info-lookup-maybe-add-help (&rest arg)
"Add a help specification if none is defined.
See the documentation of the function `info-lookup-add-help'
for more details."
- (apply 'info-lookup-add-help* t arg))
+ (apply #'info-lookup-add-help* t arg))
(defun info-lookup-add-help* (maybe &rest arg)
(let (topic mode regexp ignore-case doc-spec
@@ -352,18 +349,18 @@ If optional argument QUERY is non-nil, query for the help mode."
(setq file-name-alist (cdr file-name-alist)))))
;; If major-mode has no setups in info-lookup-alist, under any topic, then
- ;; search up through derived-mode-parent to find a parent mode which does
- ;; have some setups. This means that a `define-derived-mode' with no
+ ;; search up through `derived-mode-all-parents' to find a parent mode which
+ ;; does have some setups. This means that a `define-derived-mode' with no
;; setups of its own will select its parent mode for lookups, if one of
;; its parents has some setups. Good for example on `makefile-gmake-mode'
;; and similar derivatives of `makefile-mode'.
;;
- (let ((mode major-mode)) ;; Look for `mode' with some setups.
- (while (and mode (not info-lookup-mode))
+ (let ((modes (derived-mode-all-parents major-mode))) ;; Look for `mode' with some setups.
+ (while (and modes (not info-lookup-mode))
(dolist (topic-cell info-lookup-alist) ;; Usually only two topics here.
- (if (info-lookup->mode-value (car topic-cell) mode)
- (setq info-lookup-mode mode)))
- (setq mode (get mode 'derived-mode-parent))))
+ (if (info-lookup->mode-value (car topic-cell) (car modes))
+ (setq info-lookup-mode (car modes))))
+ (setq modes (cdr modes))))
(or info-lookup-mode (setq info-lookup-mode major-mode)))
@@ -529,7 +526,7 @@ different window."
(nconc (condition-case nil
(info-lookup-make-completions topic mode)
(error nil))
- (apply 'append
+ (apply #'append
(mapcar (lambda (arg)
(info-lookup->completions topic arg))
refer-modes))))
@@ -988,9 +985,8 @@ Return nil if there is nothing appropriate in the buffer near point."
finally return "(python)Index")))))
(info-lookup-maybe-add-help
- :mode 'cperl-mode
- :regexp "[$@%][^a-zA-Z]\\|\\$\\^[A-Z]\\|[$@%]?[a-zA-Z][_a-zA-Z0-9]*"
- :other-modes '(perl-mode))
+ :mode 'perl-mode
+ :regexp "[$@%][^a-zA-Z]\\|\\$\\^[A-Z]\\|[$@%]?[a-zA-Z][_a-zA-Z0-9]*")
(info-lookup-maybe-add-help
:mode 'latex-mode