diff options
| author | K. Handa | 2016-01-03 17:53:43 +0900 |
|---|---|---|
| committer | K. Handa | 2016-01-03 17:53:43 +0900 |
| commit | fb6d826c69939c2d016c1b824d4e9bcb53d9e643 (patch) | |
| tree | b9ce862d6cbe25e740203421984df21e4cbadbf4 /lib-src | |
| parent | 536f48e9a2251b9e654ea974bd90ff2f40218753 (diff) | |
| parent | 91917dd58ec5278e555b9c693a830749083e8f89 (diff) | |
| download | emacs-fb6d826c69939c2d016c1b824d4e9bcb53d9e643.tar.gz emacs-fb6d826c69939c2d016c1b824d4e9bcb53d9e643.zip | |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/etags.c | 55 | ||||
| -rw-r--r-- | lib-src/pop.c | 4 |
2 files changed, 54 insertions, 5 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c index 8b980d365ef..3cb39689b8d 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c | |||
| @@ -364,6 +364,7 @@ static void PHP_functions (FILE *); | |||
| 364 | static void PS_functions (FILE *); | 364 | static void PS_functions (FILE *); |
| 365 | static void Prolog_functions (FILE *); | 365 | static void Prolog_functions (FILE *); |
| 366 | static void Python_functions (FILE *); | 366 | static void Python_functions (FILE *); |
| 367 | static void Ruby_functions (FILE *); | ||
| 367 | static void Scheme_functions (FILE *); | 368 | static void Scheme_functions (FILE *); |
| 368 | static void TeX_commands (FILE *); | 369 | static void TeX_commands (FILE *); |
| 369 | static void Texinfo_nodes (FILE *); | 370 | static void Texinfo_nodes (FILE *); |
| @@ -722,6 +723,12 @@ static const char Python_help [] = | |||
| 722 | "In Python code, 'def' or 'class' at the beginning of a line\n\ | 723 | "In Python code, 'def' or 'class' at the beginning of a line\n\ |
| 723 | generate a tag."; | 724 | generate a tag."; |
| 724 | 725 | ||
| 726 | static const char *Ruby_suffixes [] = | ||
| 727 | { "rb", "ruby", NULL }; | ||
| 728 | static const char Ruby_help [] = | ||
| 729 | "In Ruby code, 'def' or 'class' or 'module' at the beginning of\n\ | ||
| 730 | a line generate a tag."; | ||
| 731 | |||
| 725 | /* Can't do the `SCM' or `scm' prefix with a version number. */ | 732 | /* Can't do the `SCM' or `scm' prefix with a version number. */ |
| 726 | static const char *Scheme_suffixes [] = | 733 | static const char *Scheme_suffixes [] = |
| 727 | { "oak", "sch", "scheme", "SCM", "scm", "SM", "sm", "ss", "t", NULL }; | 734 | { "oak", "sch", "scheme", "SCM", "scm", "SM", "sm", "ss", "t", NULL }; |
| @@ -800,6 +807,7 @@ static language lang_names [] = | |||
| 800 | { "proc", no_lang_help, plain_C_entries, plain_C_suffixes }, | 807 | { "proc", no_lang_help, plain_C_entries, plain_C_suffixes }, |
| 801 | { "prolog", Prolog_help, Prolog_functions, Prolog_suffixes }, | 808 | { "prolog", Prolog_help, Prolog_functions, Prolog_suffixes }, |
| 802 | { "python", Python_help, Python_functions, Python_suffixes }, | 809 | { "python", Python_help, Python_functions, Python_suffixes }, |
| 810 | { "ruby", Ruby_help, Ruby_functions, Ruby_suffixes }, | ||
| 803 | { "scheme", Scheme_help, Scheme_functions, Scheme_suffixes }, | 811 | { "scheme", Scheme_help, Scheme_functions, Scheme_suffixes }, |
| 804 | { "tex", TeX_help, TeX_commands, TeX_suffixes }, | 812 | { "tex", TeX_help, TeX_commands, TeX_suffixes }, |
| 805 | { "texinfo", Texinfo_help, Texinfo_nodes, Texinfo_suffixes }, | 813 | { "texinfo", Texinfo_help, Texinfo_nodes, Texinfo_suffixes }, |
| @@ -4532,6 +4540,35 @@ Python_functions (FILE *inf) | |||
| 4532 | } | 4540 | } |
| 4533 | } | 4541 | } |
| 4534 | 4542 | ||
| 4543 | /* | ||
| 4544 | * Ruby support | ||
| 4545 | * Original code by Xi Lu <lx@shellcodes.org> (2015) | ||
| 4546 | */ | ||
| 4547 | static void | ||
| 4548 | Ruby_functions (FILE *inf) | ||
| 4549 | { | ||
| 4550 | char *cp = NULL; | ||
| 4551 | |||
| 4552 | LOOP_ON_INPUT_LINES (inf, lb, cp) | ||
| 4553 | { | ||
| 4554 | cp = skip_spaces (cp); | ||
| 4555 | if (LOOKING_AT (cp, "def") | ||
| 4556 | || LOOKING_AT (cp, "class") | ||
| 4557 | || LOOKING_AT (cp, "module")) | ||
| 4558 | { | ||
| 4559 | char *name = cp; | ||
| 4560 | |||
| 4561 | /* Ruby method names can end in a '='. Also, operator overloading can | ||
| 4562 | define operators whose names include '='. */ | ||
| 4563 | while (!notinname (*cp) || *cp == '=') | ||
| 4564 | cp++; | ||
| 4565 | |||
| 4566 | make_tag (name, cp - name, true, | ||
| 4567 | lb.buffer, cp - lb.buffer + 1, lineno, linecharno); | ||
| 4568 | } | ||
| 4569 | } | ||
| 4570 | } | ||
| 4571 | |||
| 4535 | 4572 | ||
| 4536 | /* | 4573 | /* |
| 4537 | * PHP support | 4574 | * PHP support |
| @@ -4948,13 +4985,29 @@ Lua_functions (FILE *inf) | |||
| 4948 | 4985 | ||
| 4949 | LOOP_ON_INPUT_LINES (inf, lb, bp) | 4986 | LOOP_ON_INPUT_LINES (inf, lb, bp) |
| 4950 | { | 4987 | { |
| 4988 | bp = skip_spaces (bp); | ||
| 4951 | if (bp[0] != 'f' && bp[0] != 'l') | 4989 | if (bp[0] != 'f' && bp[0] != 'l') |
| 4952 | continue; | 4990 | continue; |
| 4953 | 4991 | ||
| 4954 | (void)LOOKING_AT (bp, "local"); /* skip possible "local" */ | 4992 | (void)LOOKING_AT (bp, "local"); /* skip possible "local" */ |
| 4955 | 4993 | ||
| 4956 | if (LOOKING_AT (bp, "function")) | 4994 | if (LOOKING_AT (bp, "function")) |
| 4957 | get_tag (bp, NULL); | 4995 | { |
| 4996 | char *tag_name, *tp_dot, *tp_colon; | ||
| 4997 | |||
| 4998 | get_tag (bp, &tag_name); | ||
| 4999 | /* If the tag ends with ".foo" or ":foo", make an additional tag for | ||
| 5000 | "foo". */ | ||
| 5001 | tp_dot = strrchr (tag_name, '.'); | ||
| 5002 | tp_colon = strrchr (tag_name, ':'); | ||
| 5003 | if (tp_dot || tp_colon) | ||
| 5004 | { | ||
| 5005 | char *p = tp_dot > tp_colon ? tp_dot : tp_colon; | ||
| 5006 | int len_add = p - tag_name + 1; | ||
| 5007 | |||
| 5008 | get_tag (bp + len_add, NULL); | ||
| 5009 | } | ||
| 5010 | } | ||
| 4958 | } | 5011 | } |
| 4959 | } | 5012 | } |
| 4960 | 5013 | ||
diff --git a/lib-src/pop.c b/lib-src/pop.c index c6deaf73a2c..42d302026ff 100644 --- a/lib-src/pop.c +++ b/lib-src/pop.c | |||
| @@ -42,10 +42,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 42 | #endif | 42 | #endif |
| 43 | #include <pop.h> | 43 | #include <pop.h> |
| 44 | 44 | ||
| 45 | #ifdef sun | ||
| 46 | #include <malloc.h> | ||
| 47 | #endif /* sun */ | ||
| 48 | |||
| 49 | #ifdef HESIOD | 45 | #ifdef HESIOD |
| 50 | #include <hesiod.h> | 46 | #include <hesiod.h> |
| 51 | /* | 47 | /* |