aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/info-look.el47
2 files changed, 38 insertions, 19 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 8ddf9ed02ad..9de9f4813d0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
12015-03-13 Kevin Ryde <user42_kevin <at> yahoo.com.au>
2
3 info-look fixes for Texinfo 5
4 * info-look.el (c-mode, bison-mode, makefile-mode)
5 (makefile-automake-mode, texinfo-mode, autoconf-mode, awk-mode)
6 (latex-mode, emacs-lisp-mode, sh-mode, cfengine-mode): Match
7 `foo' and 'foo' and ‘foo’ for @item and similar.
8 (latex-mode): Match multi-arg \frac{num}{den} or \sqrt[root]{n} in
9 suffix regexp.
10
12015-03-12 Juri Linkov <juri@linkov.net> 112015-03-12 Juri Linkov <juri@linkov.net>
2 12
3 * simple.el (next-line-or-history-element) 13 * simple.el (next-line-or-history-element)
diff --git a/lisp/info-look.el b/lisp/info-look.el
index 1baea4619f8..9cf185edf57 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -35,6 +35,11 @@
35;; (or CTAN mirrors) 35;; (or CTAN mirrors)
36;; Perl: <URL:ftp://ftp.cpan.org/pub/CPAN/doc/manual/texinfo/> (or CPAN mirrors) 36;; Perl: <URL:ftp://ftp.cpan.org/pub/CPAN/doc/manual/texinfo/> (or CPAN mirrors)
37 37
38;; Traditionally, makeinfo quoted `like this', but version 5 and later
39;; quotes 'like this' or ‘like this’. Doc specs with patterns
40;; therefore match open and close quotes with ['`‘] and ['’],
41;; respectively.
42
38;;; Code: 43;;; Code:
39 44
40(require 'info) 45(require 'info)
@@ -716,12 +721,12 @@ Return nil if there is nothing appropriate in the buffer near point."
716 ;; suffix "\\>" is not used because that sends DBL_MAX to 721 ;; suffix "\\>" is not used because that sends DBL_MAX to
717 ;; DBL_MAX_EXP ("_" is a non-word char) 722 ;; DBL_MAX_EXP ("_" is a non-word char)
718 ("(libc)Variable Index" nil 723 ("(libc)Variable Index" nil
719 "^\\([ \t]+-+ \\(Variable\\|Macro\\): .*\\<\\|`\\)" 724 "^\\([ \t]+-+ \\(Variable\\|Macro\\): .*\\<\\|['`‘]\\)"
720 "\\( \\|'?$\\)") 725 "\\( \\|['’]?$\\)")
721 ("(libc)Type Index" nil 726 ("(libc)Type Index" nil
722 "^[ \t]+-+ Data Type: \\<" "\\>") 727 "^[ \t]+-+ Data Type: \\<" "\\>")
723 ("(termcap)Var Index" nil 728 ("(termcap)Var Index" nil
724 "^[ \t]*`" "'")) 729 "^[ \t]*['`‘]" "['’]"))
725 :parse-rule 'info-lookup-guess-c-symbol) 730 :parse-rule 'info-lookup-guess-c-symbol)
726 731
727(info-lookup-maybe-add-help 732(info-lookup-maybe-add-help
@@ -733,7 +738,7 @@ Return nil if there is nothing appropriate in the buffer near point."
733 :mode 'bison-mode 738 :mode 'bison-mode
734 :regexp "[:;|]\\|%\\([%{}]\\|[_a-z]+\\)\\|YY[_A-Z]+\\|yy[_a-z]+" 739 :regexp "[:;|]\\|%\\([%{}]\\|[_a-z]+\\)\\|YY[_A-Z]+\\|yy[_a-z]+"
735 :doc-spec '(("(bison)Index" nil 740 :doc-spec '(("(bison)Index" nil
736 "`" "'")) 741 "['`‘]" "['’]"))
737 :parse-rule "[:;|]\\|%\\([%{}]\\|[_a-zA-Z][_a-zA-Z0-9]*\\)" 742 :parse-rule "[:;|]\\|%\\([%{}]\\|[_a-zA-Z][_a-zA-Z0-9]*\\)"
738 :other-modes '(c-mode)) 743 :other-modes '(c-mode))
739 744
@@ -741,7 +746,7 @@ Return nil if there is nothing appropriate in the buffer near point."
741 :mode 'makefile-mode 746 :mode 'makefile-mode
742 :regexp "\\$[^({]\\|\\.[_A-Z]*\\|[_a-zA-Z][_a-zA-Z0-9-]*" 747 :regexp "\\$[^({]\\|\\.[_A-Z]*\\|[_a-zA-Z][_a-zA-Z0-9-]*"
743 :doc-spec '(("(make)Name Index" nil 748 :doc-spec '(("(make)Name Index" nil
744 "^[ \t]*`" "'")) 749 "^[ \t]*['`‘]" "['’]"))
745 :parse-rule "\\$[^({]\\|\\.[_A-Z]*\\|[_a-zA-Z0-9-]+") 750 :parse-rule "\\$[^({]\\|\\.[_A-Z]*\\|[_a-zA-Z0-9-]+")
746 751
747(info-lookup-maybe-add-help 752(info-lookup-maybe-add-help
@@ -756,15 +761,16 @@ Return nil if there is nothing appropriate in the buffer near point."
756 :doc-spec '( 761 :doc-spec '(
757 ;; "(automake)Macro Index" is autoconf macros used in 762 ;; "(automake)Macro Index" is autoconf macros used in
758 ;; configure.ac, not Makefile.am, so don't have that here. 763 ;; configure.ac, not Makefile.am, so don't have that here.
759 ("(automake)Variable Index" nil "^[ \t]*`" "'") 764 ("(automake)Variable Index" nil "^[ \t]*['`‘]" "['’]")
760 ;; In automake 1.4 macros and variables were a combined node. 765 ;; In automake 1.4 macros and variables were a combined node.
761 ("(automake)Macro and Variable Index" nil "^[ \t]*`" "'") 766 ("(automake)Macro and Variable Index" nil "^[ \t]*['`‘]"
767 "['’]")
762 ;; Directives like "if" are in the "General Index". 768 ;; Directives like "if" are in the "General Index".
763 ;; Prefix "`" since the text for say `+=' isn't always an 769 ;; Prefix "`" since the text for say `+=' isn't always an
764 ;; @item etc and so not always at the start of a line. 770 ;; @item etc and so not always at the start of a line.
765 ("(automake)General Index" nil "`" "'") 771 ("(automake)General Index" nil "['`‘]" "['’]")
766 ;; In automake 1.3 there was just a single "Index" node. 772 ;; In automake 1.3 there was just a single "Index" node.
767 ("(automake)Index" nil "`" "'")) 773 ("(automake)Index" nil "['`‘]" "['’]"))
768 :other-modes '(makefile-mode)) 774 :other-modes '(makefile-mode))
769 775
770(info-lookup-maybe-add-help 776(info-lookup-maybe-add-help
@@ -775,7 +781,7 @@ Return nil if there is nothing appropriate in the buffer near point."
775 (lambda (item) 781 (lambda (item)
776 (if (string-match "^\\([a-zA-Z]+\\|[^a-zA-Z]\\)\\( .*\\)?$" item) 782 (if (string-match "^\\([a-zA-Z]+\\|[^a-zA-Z]\\)\\( .*\\)?$" item)
777 (concat "@" (match-string 1 item)))) 783 (concat "@" (match-string 1 item))))
778 "`" "[' ]"))) 784 "['`‘]" "[' ]")))
779 785
780(info-lookup-maybe-add-help 786(info-lookup-maybe-add-help
781 :mode 'm4-mode 787 :mode 'm4-mode
@@ -821,7 +827,7 @@ Return nil if there is nothing appropriate in the buffer near point."
821 ;; macros (eg. AC_PROG_CC). Ensure this is after the autoconf 827 ;; macros (eg. AC_PROG_CC). Ensure this is after the autoconf
822 ;; index, so as to prefer the autoconf docs. 828 ;; index, so as to prefer the autoconf docs.
823 ("(automake)Macro and Variable Index" nil 829 ("(automake)Macro and Variable Index" nil
824 "^[ \t]*`" "'")) 830 "^[ \t]*['`‘]" "['’]"))
825 ;; Autoconf symbols are M4 macros. Thus use M4's parser. 831 ;; Autoconf symbols are M4 macros. Thus use M4's parser.
826 :parse-rule 'ignore 832 :parse-rule 'ignore
827 :other-modes '(m4-mode)) 833 :other-modes '(m4-mode))
@@ -846,7 +852,7 @@ Return nil if there is nothing appropriate in the buffer near point."
846 ;; Built-in functions (matches to many entries). 852 ;; Built-in functions (matches to many entries).
847 ((string-match "^[a-z]+$" item) 853 ((string-match "^[a-z]+$" item)
848 item)))) 854 item))))
849 "`" "\\([ \t]*([^)]*)\\)?'"))) 855 "['`‘]" "\\([ \t]*([^)]*)\\)?['’]")))
850 856
851(info-lookup-maybe-add-help 857(info-lookup-maybe-add-help
852 :mode 'perl-mode 858 :mode 'perl-mode
@@ -885,16 +891,19 @@ Return nil if there is nothing appropriate in the buffer near point."
885 ;; From http://home.gna.org/latexrefman 891 ;; From http://home.gna.org/latexrefman
886 "(latex2e)Command Index" 892 "(latex2e)Command Index"
887 "(latex)Command Index") 893 "(latex)Command Index")
888 nil "`" "\\({[^}]*}\\)?'"))) 894 ;; \frac{NUM}{DEN} etc can have more than one {xx} argument.
895 ;; \sqrt[ROOT]{num} and others can have square brackets.
896 nil "[`'‘]" "\\({[^}]*}|\\[[^]]*\\]\\)*['’]")))
897
889 898
890(info-lookup-maybe-add-help 899(info-lookup-maybe-add-help
891 :mode 'emacs-lisp-mode 900 :mode 'emacs-lisp-mode
892 :regexp "[^][()`',\" \t\n]+" 901 :regexp "[^][()`',\" \t\n]+"
893 :doc-spec '(;; Commands with key sequences appear in nodes as `foo' and 902 :doc-spec '(;; Commands with key sequences appear in nodes as `foo' and
894 ;; those without as `M-x foo'. 903 ;; those without as `M-x foo'.
895 ("(emacs)Command Index" nil "`\\(M-x[ \t\n]+\\)?" "'") 904 ("(emacs)Command Index" nil "['`‘]\\(M-x[ \t\n]+\\)?" "['’]")
896 ;; Variables normally appear in nodes as just `foo'. 905 ;; Variables normally appear in nodes as just `foo'.
897 ("(emacs)Variable Index" nil "`" "'") 906 ("(emacs)Variable Index" nil "['`‘]" "['’]")
898 ;; Almost all functions, variables, etc appear in nodes as 907 ;; Almost all functions, variables, etc appear in nodes as
899 ;; " -- Function: foo" etc. A small number of aliases and 908 ;; " -- Function: foo" etc. A small number of aliases and
900 ;; symbols appear only as `foo', and will miss out on exact 909 ;; symbols appear only as `foo', and will miss out on exact
@@ -976,9 +985,9 @@ Return nil if there is nothing appropriate in the buffer near point."
976 ;; bash has "." and ":" in its index, but those chars will probably never 985 ;; bash has "." and ":" in its index, but those chars will probably never
977 ;; work in info, so don't bother matching them in the regexp. 986 ;; work in info, so don't bother matching them in the regexp.
978 :regexp "\\([a-zA-Z0-9_-]+\\|[!{}@*#?$]\\|\\[\\[?\\|]]?\\)" 987 :regexp "\\([a-zA-Z0-9_-]+\\|[!{}@*#?$]\\|\\[\\[?\\|]]?\\)"
979 :doc-spec '(("(bash)Builtin Index" nil "^`" "[ .']") 988 :doc-spec '(("(bash)Builtin Index" nil "^['`‘]" "[ .']")
980 ("(bash)Reserved Word Index" nil "^`" "[ .']") 989 ("(bash)Reserved Word Index" nil "^['`‘]" "[ .']")
981 ("(bash)Variable Index" nil "^`" "[ .']") 990 ("(bash)Variable Index" nil "^['`‘]" "[ .']")
982 991
983 ;; coreutils (version 4.5.10) doesn't have a separate program 992 ;; coreutils (version 4.5.10) doesn't have a separate program
984 ;; index, so exclude extraneous stuff (most of it) by demanding 993 ;; index, so exclude extraneous stuff (most of it) by demanding
@@ -1026,7 +1035,7 @@ Return nil if there is nothing appropriate in the buffer near point."
1026 item)) 1035 item))
1027 ;; This gets functions in evaluated classes. Other 1036 ;; This gets functions in evaluated classes. Other
1028 ;; possible patterns don't seem to work too well. 1037 ;; possible patterns don't seem to work too well.
1029 "`" "("))) 1038 "['`‘]" "(")))
1030 1039
1031(info-lookup-maybe-add-help 1040(info-lookup-maybe-add-help
1032 :mode 'Custom-mode 1041 :mode 'Custom-mode