1 |
;;; info-look.el --- major-mode-sensitive Info index lookup facility |
;;; info-look.el --- major-mode-sensitive Info index lookup facility |
2 |
;; An older version of this was known as libc.el. |
;; An older version of this was known as libc.el. |
3 |
|
|
4 |
;; Copyright (C) 1995,96,97,98,99,2001 Free Software Foundation, Inc. |
;; Copyright (C) 1995,96,97,98,99,2001,2003 Free Software Foundation, Inc. |
5 |
|
|
6 |
;; Author: Ralph Schleicher <rs@nunatak.allgaeu.org> |
;; Author: Ralph Schleicher <rs@nunatak.allgaeu.org> |
7 |
;; (did not show signs of life (Nov 2001) -stef) |
;; (did not show signs of life (Nov 2001) -stef) |
468 |
(progn |
(progn |
469 |
(goto-char (point-min)) |
(goto-char (point-min)) |
470 |
(and (search-forward "\n* Menu:" nil t) |
(and (search-forward "\n* Menu:" nil t) |
471 |
(while (re-search-forward "\n\\* \\([^:\t\n]*\\):" nil t) |
(while (re-search-forward "\n\\* \\(.*\\): " nil t) |
472 |
(setq entry (match-string 1) |
(setq entry (match-string 1) |
473 |
item (funcall trans entry)) |
item (funcall trans entry)) |
474 |
;; `trans' can return nil if the regexp doesn't match. |
;; `trans' can return nil if the regexp doesn't match. |
682 |
(info-lookup-maybe-add-help |
(info-lookup-maybe-add-help |
683 |
:mode 'autoconf-mode |
:mode 'autoconf-mode |
684 |
:regexp "A[CM]_[_A-Z0-9]+" |
:regexp "A[CM]_[_A-Z0-9]+" |
685 |
:doc-spec '(("(autoconf)Autoconf Macro Index" "AC_" |
:doc-spec '(;; Autoconf Macro Index entries are without an "AC_" prefix, |
686 |
|
;; but with "AH_" or "AU_" for those. So add "AC_" if there |
687 |
|
;; isn't already an "A._". |
688 |
|
("(autoconf)Autoconf Macro Index" |
689 |
|
(lambda (item) |
690 |
|
(if (string-match "^A._" item) item (concat "AC_" item))) |
691 |
"^[ \t]+- \\(Macro\\|Variable\\): .*\\<" "\\>") |
"^[ \t]+- \\(Macro\\|Variable\\): .*\\<" "\\>") |
692 |
("(automake)Macro and Variable Index" nil |
;; M4 Macro Index entries are without "AS_" prefixes, and |
693 |
"^[ \t]*`" "'") |
;; mostly without "m4_" prefixes. "dnl" is an exception, not |
694 |
;; These are for older versions (probably pre autoconf 2.5x): |
;; wanting any prefix. So AS_ is added back to upper-case |
695 |
|
;; names, m4_ to others which don't already an m4_. |
696 |
|
("(autoconf)M4 Macro Index" |
697 |
|
(lambda (item) |
698 |
|
(let ((case-fold-search nil)) |
699 |
|
(cond ((or (string-equal item "dnl") |
700 |
|
(string-match "^m4_" item)) |
701 |
|
item) |
702 |
|
((string-match "^[A-Z0-9_]+$" item) |
703 |
|
(concat "AS_" item)) |
704 |
|
(t |
705 |
|
(concat "m4_" item))))) |
706 |
|
"^[ \t]+- Macro: .*\\<" "\\>") |
707 |
|
;; Autotest Macro Index entries are without "AT_". |
708 |
|
("(autoconf)Autotest Macro Index" "AT_" |
709 |
|
"^[ \t]+- Macro: .*\\<" "\\>") |
710 |
|
;; This is for older versions (probably pre autoconf 2.5x): |
711 |
("(autoconf)Macro Index" "AC_" |
("(autoconf)Macro Index" "AC_" |
712 |
"^[ \t]+- \\(Macro\\|Variable\\): .*\\<" "\\>") |
"^[ \t]+- \\(Macro\\|Variable\\): .*\\<" "\\>") |
713 |
|
;; Automake has index entries for its notes on various autoconf |
714 |
|
;; macros (eg. AC_PROG_CC). Ensure this is after the autoconf |
715 |
|
;; index, so as to prefer the autoconf docs. |
716 |
("(automake)Macro and Variable Index" nil |
("(automake)Macro and Variable Index" nil |
717 |
"^[ \t]*`" "'")) |
"^[ \t]*`" "'")) |
718 |
;; Autoconf symbols are M4 macros. Thus use M4's parser. |
;; Autoconf symbols are M4 macros. Thus use M4's parser. |
780 |
(info-lookup-maybe-add-help |
(info-lookup-maybe-add-help |
781 |
:mode 'emacs-lisp-mode |
:mode 'emacs-lisp-mode |
782 |
:regexp "[^][()'\" \t\n]+" |
:regexp "[^][()'\" \t\n]+" |
783 |
:doc-spec '(("(emacs)Command Index") |
:doc-spec '(;; Commands with key sequences appear in nodes as `foo' and |
784 |
("(emacs)Variable Index") |
;; those without as `M-x foo'. |
785 |
("(elisp)Index"))) |
("(emacs)Command Index" nil "`\\(M-x[ \t\n]+\\)?" "'") |
786 |
|
;; Variables normally appear in nodes as just `foo'. |
787 |
|
("(emacs)Variable Index" nil "`" "'") |
788 |
|
;; Almost all functions, variables, etc appear in nodes as |
789 |
|
;; " - Function: foo" etc. A small number of aliases and |
790 |
|
;; symbols appear only as `foo', and will miss out on exact |
791 |
|
;; positions. Allowing `foo' would hit too many false matches |
792 |
|
;; for things that should go to Function: etc, and those latter |
793 |
|
;; are much more important. Perhaps this could change if some |
794 |
|
;; sort of fallback match scheme existed. |
795 |
|
("(elisp)Index" nil "^ - .*: " "\\( \\|$\\)"))) |
796 |
|
|
797 |
(info-lookup-maybe-add-help |
(info-lookup-maybe-add-help |
798 |
:mode 'lisp-interaction-mode |
:mode 'lisp-interaction-mode |
878 |
|
|
879 |
(provide 'info-look) |
(provide 'info-look) |
880 |
|
|
881 |
|
;;; arch-tag: 0f1e3ea3-32a2-4461-bbab-3cff93539a74 |
882 |
;;; info-look.el ends here |
;;; info-look.el ends here |