aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorJohn Wiegley2016-01-02 23:31:52 -0800
committerJohn Wiegley2016-01-02 23:31:52 -0800
commit91917dd58ec5278e555b9c693a830749083e8f89 (patch)
tree3b0c8104106f6dec7873378bccc1273e587f6051 /lib-src
parentc988877f436bbbb285a0b34f5e037f7758dd6349 (diff)
parent9f2f14a0725211b13a744573344636b57b9c98b9 (diff)
downloademacs-91917dd58ec5278e555b9c693a830749083e8f89.tar.gz
emacs-91917dd58ec5278e555b9c693a830749083e8f89.zip
Merge branch 'emacs-25-merge'
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/etags.c55
-rw-r--r--lib-src/pop.c4
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 *);
364static void PS_functions (FILE *); 364static void PS_functions (FILE *);
365static void Prolog_functions (FILE *); 365static void Prolog_functions (FILE *);
366static void Python_functions (FILE *); 366static void Python_functions (FILE *);
367static void Ruby_functions (FILE *);
367static void Scheme_functions (FILE *); 368static void Scheme_functions (FILE *);
368static void TeX_commands (FILE *); 369static void TeX_commands (FILE *);
369static void Texinfo_nodes (FILE *); 370static 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\
723generate a tag."; 724generate a tag.";
724 725
726static const char *Ruby_suffixes [] =
727 { "rb", "ruby", NULL };
728static const char Ruby_help [] =
729 "In Ruby code, 'def' or 'class' or 'module' at the beginning of\n\
730a 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. */
726static const char *Scheme_suffixes [] = 733static 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 */
4547static void
4548Ruby_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/*