# HG changeset patch # User Stefan Monnier # Date 983922120 0 # Node ID d29b9968e84ff9dcbb20293dd9e09d98fc0d371f # Parent 9a50e930a703c65bf219119665792d6cb8c04209 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. diff -r 9a50e930a703 -r d29b9968e84f lisp/info-look.el --- a/lisp/info-look.el Tue Mar 06 23:33:15 2001 +0000 +++ b/lisp/info-look.el Tue Mar 06 23:42:00 2001 +0000 @@ -23,6 +23,11 @@ ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. +;;; Commentary: + +;; Really cool code to lookup info indexes. +;; Try especially info-lookup-symbol (aka C-h TAB). + ;;; Code: (require 'info) @@ -50,10 +55,8 @@ "Overlay object used for highlighting.") (defcustom info-lookup-file-name-alist - '(("\\`configure\\.in\\'" . autoconf-mode) - ("\\`aclocal\\.m4\\'" . autoconf-mode) - ("\\`acsite\\.m4\\'" . autoconf-mode) - ("\\`acinclude\\.m4\\'" . autoconf-mode)) + '(("\\`configure\\.in\\'" . autoconf-mode) ;already covered by auto-mode-alist + ("\\`ac\\(local\\|site\\|include\\)\\.m4\\'" . autoconf-mode)) "Alist of file names handled specially. List elements are cons cells of the form @@ -124,13 +127,6 @@ (defsubst info-lookup->other-modes (topic mode) (nth 5 (info-lookup->mode-value topic mode))) -(eval-and-compile - (mapcar (lambda (keyword) - (or (boundp keyword) - (set keyword keyword))) - '(:topic :mode :regexp :ignore-case - :doc-spec :parse-rule :other-modes))) - (defun info-lookup-add-help (&rest arg) "Add or update a help specification. Function arguments are one or more options of the form @@ -147,7 +143,7 @@ (apply 'info-lookup-add-help* nil arg)) (defun info-lookup-maybe-add-help (&rest arg) - "Add a help specification iff no one is defined. + "Add a help specification iff none is defined. See the documentation of the function `info-lookup-add-help' for more details." (apply 'info-lookup-add-help* t arg)) @@ -728,6 +724,11 @@ :parse-rule "[$@%]?\\([_a-zA-Z0-9]+\\|[^a-zA-Z]\\)") (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)) + +(info-lookup-maybe-add-help :mode 'latex-mode :regexp "\\\\\\([a-zA-Z]+\\|[^a-zA-Z]\\)" :doc-spec '(("(latex)Command Index" nil @@ -735,33 +736,26 @@ (info-lookup-maybe-add-help :mode 'emacs-lisp-mode - :regexp "[^()' \t\n]+" + :regexp "[^][()'\" \t\n]+" :doc-spec '(("(emacs)Command Index") ("(emacs)Variable Index") - ("(elisp)Index" - (lambda (item) - (let ((sym (intern-soft item))) - (cond ((null sym) - (if (string-equal item "nil") item)) - ((or (boundp sym) (fboundp sym)) - item)))) - "^[ \t]+- [^:]+:[ \t]*" "\\b"))) + ("(elisp)Index"))) (info-lookup-maybe-add-help :mode 'lisp-interaction-mode - :regexp "[^()' \t\n]+" + :regexp "[^][()'\" \t\n]+" :parse-rule 'ignore :other-modes '(emacs-lisp-mode)) (info-lookup-maybe-add-help :mode 'lisp-mode - :regexp "[^()' \t\n]+" + :regexp "[^()'\" \t\n]+" :parse-rule 'ignore :other-modes '(emacs-lisp-mode)) (info-lookup-maybe-add-help :mode 'scheme-mode - :regexp "[^()' \t\n]+" + :regexp "[^()'\" \t\n]+" :ignore-case t ;; Aubrey Jaffer's rendition from :doc-spec '(("(r5rs)Index" nil