aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2001-03-06 23:42:00 +0000
committerStefan Monnier2001-03-06 23:42:00 +0000
commit41b1cae76e9ba447f4d77f6db22f572ebed88887 (patch)
tree17b3ac7349e0377c0ca736b4197a74e52c1cadd8
parentc06e9d8bccbed1351d557d1e56dd8e8338edb305 (diff)
downloademacs-41b1cae76e9ba447f4d77f6db22f572ebed88887.tar.gz
emacs-41b1cae76e9ba447f4d77f6db22f572ebed88887.zip
Docstring fixes and dead code eliminated.
(cperl-mode): Add support. (emacs-lisp-mode): List all entries from elisp manual, whether or not they are currently (f)bound or not. Update regexp.
-rw-r--r--lisp/info-look.el42
1 files changed, 18 insertions, 24 deletions
diff --git a/lisp/info-look.el b/lisp/info-look.el
index e39adb36317..d790c3cf178 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -23,6 +23,11 @@
23;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 23;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24;; Boston, MA 02111-1307, USA. 24;; Boston, MA 02111-1307, USA.
25 25
26;;; Commentary:
27
28;; Really cool code to lookup info indexes.
29;; Try especially info-lookup-symbol (aka C-h TAB).
30
26;;; Code: 31;;; Code:
27 32
28(require 'info) 33(require 'info)
@@ -50,10 +55,8 @@ Setting this variable to nil disables highlighting."
50 "Overlay object used for highlighting.") 55 "Overlay object used for highlighting.")
51 56
52(defcustom info-lookup-file-name-alist 57(defcustom info-lookup-file-name-alist
53 '(("\\`configure\\.in\\'" . autoconf-mode) 58 '(("\\`configure\\.in\\'" . autoconf-mode) ;already covered by auto-mode-alist
54 ("\\`aclocal\\.m4\\'" . autoconf-mode) 59 ("\\`ac\\(local\\|site\\|include\\)\\.m4\\'" . autoconf-mode))
55 ("\\`acsite\\.m4\\'" . autoconf-mode)
56 ("\\`acinclude\\.m4\\'" . autoconf-mode))
57 "Alist of file names handled specially. 60 "Alist of file names handled specially.
58List elements are cons cells of the form 61List elements are cons cells of the form
59 62
@@ -124,13 +127,6 @@ OTHER-MODES is a list of cross references to other help modes.")
124(defsubst info-lookup->other-modes (topic mode) 127(defsubst info-lookup->other-modes (topic mode)
125 (nth 5 (info-lookup->mode-value topic mode))) 128 (nth 5 (info-lookup->mode-value topic mode)))
126 129
127(eval-and-compile
128 (mapcar (lambda (keyword)
129 (or (boundp keyword)
130 (set keyword keyword)))
131 '(:topic :mode :regexp :ignore-case
132 :doc-spec :parse-rule :other-modes)))
133
134(defun info-lookup-add-help (&rest arg) 130(defun info-lookup-add-help (&rest arg)
135 "Add or update a help specification. 131 "Add or update a help specification.
136Function arguments are one or more options of the form 132Function arguments are one or more options of the form
@@ -147,7 +143,7 @@ to `symbol', and the help mode defaults to the current major mode."
147 (apply 'info-lookup-add-help* nil arg)) 143 (apply 'info-lookup-add-help* nil arg))
148 144
149(defun info-lookup-maybe-add-help (&rest arg) 145(defun info-lookup-maybe-add-help (&rest arg)
150 "Add a help specification iff no one is defined. 146 "Add a help specification iff none is defined.
151See the documentation of the function `info-lookup-add-help' 147See the documentation of the function `info-lookup-add-help'
152for more details." 148for more details."
153 (apply 'info-lookup-add-help* t arg)) 149 (apply 'info-lookup-add-help* t arg))
@@ -728,6 +724,11 @@ Return nil if there is nothing appropriate in the buffer near point."
728 :parse-rule "[$@%]?\\([_a-zA-Z0-9]+\\|[^a-zA-Z]\\)") 724 :parse-rule "[$@%]?\\([_a-zA-Z0-9]+\\|[^a-zA-Z]\\)")
729 725
730(info-lookup-maybe-add-help 726(info-lookup-maybe-add-help
727 :mode 'cperl-mode
728 :regexp "[$@%][^a-zA-Z]\\|\\$\\^[A-Z]\\|[$@%]?[a-zA-Z][_a-zA-Z0-9]*"
729 :other-modes '(perl-mode))
730
731(info-lookup-maybe-add-help
731 :mode 'latex-mode 732 :mode 'latex-mode
732 :regexp "\\\\\\([a-zA-Z]+\\|[^a-zA-Z]\\)" 733 :regexp "\\\\\\([a-zA-Z]+\\|[^a-zA-Z]\\)"
733 :doc-spec '(("(latex)Command Index" nil 734 :doc-spec '(("(latex)Command Index" nil
@@ -735,33 +736,26 @@ Return nil if there is nothing appropriate in the buffer near point."
735 736
736(info-lookup-maybe-add-help 737(info-lookup-maybe-add-help
737 :mode 'emacs-lisp-mode 738 :mode 'emacs-lisp-mode
738 :regexp "[^()' \t\n]+" 739 :regexp "[^][()'\" \t\n]+"
739 :doc-spec '(("(emacs)Command Index") 740 :doc-spec '(("(emacs)Command Index")
740 ("(emacs)Variable Index") 741 ("(emacs)Variable Index")
741 ("(elisp)Index" 742 ("(elisp)Index")))
742 (lambda (item)
743 (let ((sym (intern-soft item)))
744 (cond ((null sym)
745 (if (string-equal item "nil") item))
746 ((or (boundp sym) (fboundp sym))
747 item))))
748 "^[ \t]+- [^:]+:[ \t]*" "\\b")))
749 743
750(info-lookup-maybe-add-help 744(info-lookup-maybe-add-help
751 :mode 'lisp-interaction-mode 745 :mode 'lisp-interaction-mode
752 :regexp "[^()' \t\n]+" 746 :regexp "[^][()'\" \t\n]+"
753 :parse-rule 'ignore 747 :parse-rule 'ignore
754 :other-modes '(emacs-lisp-mode)) 748 :other-modes '(emacs-lisp-mode))
755 749
756(info-lookup-maybe-add-help 750(info-lookup-maybe-add-help
757 :mode 'lisp-mode 751 :mode 'lisp-mode
758 :regexp "[^()' \t\n]+" 752 :regexp "[^()'\" \t\n]+"
759 :parse-rule 'ignore 753 :parse-rule 'ignore
760 :other-modes '(emacs-lisp-mode)) 754 :other-modes '(emacs-lisp-mode))
761 755
762(info-lookup-maybe-add-help 756(info-lookup-maybe-add-help
763 :mode 'scheme-mode 757 :mode 'scheme-mode
764 :regexp "[^()' \t\n]+" 758 :regexp "[^()'\" \t\n]+"
765 :ignore-case t 759 :ignore-case t
766 ;; Aubrey Jaffer's rendition from <URL:ftp://ftp-swiss.ai.mit.edu/pub/scm> 760 ;; Aubrey Jaffer's rendition from <URL:ftp://ftp-swiss.ai.mit.edu/pub/scm>
767 :doc-spec '(("(r5rs)Index" nil 761 :doc-spec '(("(r5rs)Index" nil