aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorJohn Wiegley2016-02-03 23:56:08 -0800
committerJohn Wiegley2016-02-03 23:56:08 -0800
commit0608bf1c3d91196bcf06a6da96243f0fac119089 (patch)
treed79a6c43cd10c681445b75f859545c9f88e41899 /lib-src
parent91ab66201cedbcd2e4e8533a7152f6736ad08731 (diff)
parentee7399792f865905d393df05c3d4e5ec309aa06c (diff)
downloademacs-0608bf1c3d91196bcf06a6da96243f0fac119089.tar.gz
emacs-0608bf1c3d91196bcf06a6da96243f0fac119089.zip
Merge from origin/emacs-25
ee73997 Make erc work better when encountering unknown prefix chars b99141d Make erc completion case-insensitive again 66c4620 Make complection in erc use consistent casing 8c562b2 Make /QUIT in erc more robust d93d2c5 Make tracking faces in Emacs work more reliably af6ab7e Make shr not bug out on images on non-graphical displays 3311f40 Fix bookmark display widths d90ab1e Fix typo in eww-make-unique-file-name 7f81825 Make it possible to TAB to input fields a43a1dc Insert complete alt texts when images are disabled 56ed4e1 Allow eww text fields to grow 66b315c Make erc work when subword-mode is switched on 255b68f Fix IMAP doc example 91557f5 Quoting fixes in doc strings and diagnostics 2c0dc9f Fix warning message in hack-local-variables 504696d Etags: yet another improvement in Ruby tags 8784ebf Fix x-popup-menu on TTYs without a mouse 8b87ecb * lisp/emacs-lisp/map.el: Improvements to the docstring of the pcase macro 6191003 Use pop-to-buffer-same-window in eww fe321fd * autogen.sh: Revert all recent changes. 74ebd4a * make-dist: Updates related to nt/. 737193a * make-dist: Add modules/. 3696bf2 * make-dist: Update for super-special file that can't live in etc/. a4278e2 Fix failure to compile ns-win.el in parallel builds 860da4d Fix names of tags generated for Ruby accessors f6213ce Fix file-name recognition in 'etags' e42e662 Change Ruby file names and extensions recognized by 'etags' 58bfb6a More improvements for Ruby support in 'etags' c04e911 Add --git-config option to autogen.sh 5713466 Fix editing undo changes in eww fields 51362d6 Allow the user more control of popping up the eww window ee0fbd8 Make eww-browse-url with new-window parameter work again 9c3142d Clean up eww code slightly cb035f3 Don't insert nil faces in shr 4c3fae3 ; * lisp/progmodes/prolog.el: Remove some obsolete commentary. 93f2153 Improve the custom type of some user options. 9f60d7e Mark some risky calendar variables. 1d07dcd Highlight two additional SCSS keywords ee8b466 Recommend enabling integrity-checking in git e639e10 Some corrections in Elisp manual d766ca8 Chatter when autogen.sh changes Git configuration 3b734e1 * org/org-compat.el (org-font-lock-ensure): Fix bogus test (bug#22399) 43cb9f8 Omit unnecessary history from Lisp intro 2fbd1da * etc/HISTORY: Add some more history, plus git tags. c90e1b4 Improve elisp “Security Considerations” doc cedd7ca autogen.sh now arranges for git to check hashes 86ce76b ; Fix ChangeLog.2 commit ID. 7b1d2b1 Fix (c & 040) typo in emergency escapes a8273da Fix display of overlay strings with 'display' and 'box' property fc48106 Fix imap-starttls-open cdecbed Fix return value of imap-starttls-open 20c7e34 ; * etc/NEWS: Fix renamed command name 98bdbdb Correct reference to DARWIN_OS preprocessor symbol b250d29 Spelling fix b920a0e Spelling fixes 93b144b Pacify GCC on C library without glibc API
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/etags.c111
1 files changed, 103 insertions, 8 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c
index ff75de45659..ca50f35f80b 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -729,7 +729,9 @@ static const char Python_help [] =
729generate a tag."; 729generate a tag.";
730 730
731static const char *Ruby_suffixes [] = 731static const char *Ruby_suffixes [] =
732 { "rb", "ruby", NULL }; 732 { "rb", "ru", "rbw", NULL };
733static const char *Ruby_filenames [] =
734 { "Rakefile", "Thorfile", NULL };
733static const char Ruby_help [] = 735static const char Ruby_help [] =
734 "In Ruby code, 'def' or 'class' or 'module' at the beginning of\n\ 736 "In Ruby code, 'def' or 'class' or 'module' at the beginning of\n\
735a line generate a tag. Constants also generate a tag."; 737a line generate a tag. Constants also generate a tag.";
@@ -813,7 +815,7 @@ static language lang_names [] =
813 { "proc", no_lang_help, plain_C_entries, plain_C_suffixes }, 815 { "proc", no_lang_help, plain_C_entries, plain_C_suffixes },
814 { "prolog", Prolog_help, Prolog_functions, Prolog_suffixes }, 816 { "prolog", Prolog_help, Prolog_functions, Prolog_suffixes },
815 { "python", Python_help, Python_functions, Python_suffixes }, 817 { "python", Python_help, Python_functions, Python_suffixes },
816 { "ruby", Ruby_help, Ruby_functions, Ruby_suffixes }, 818 { "ruby", Ruby_help,Ruby_functions,Ruby_suffixes,Ruby_filenames },
817 { "scheme", Scheme_help, Scheme_functions, Scheme_suffixes }, 819 { "scheme", Scheme_help, Scheme_functions, Scheme_suffixes },
818 { "tex", TeX_help, TeX_commands, TeX_suffixes }, 820 { "tex", TeX_help, TeX_commands, TeX_suffixes },
819 { "texinfo", Texinfo_help, Texinfo_nodes, Texinfo_suffixes }, 821 { "texinfo", Texinfo_help, Texinfo_nodes, Texinfo_suffixes },
@@ -1484,8 +1486,16 @@ get_language_from_filename (char *file, int case_sensitive)
1484{ 1486{
1485 language *lang; 1487 language *lang;
1486 const char **name, **ext, *suffix; 1488 const char **name, **ext, *suffix;
1489 char *slash;
1487 1490
1488 /* Try whole file name first. */ 1491 /* Try whole file name first. */
1492 slash = strrchr (file, '/');
1493 if (slash != NULL)
1494 file = slash + 1;
1495#ifdef DOS_NT
1496 else if (file[0] && file[1] == ':')
1497 file += 2;
1498#endif
1489 for (lang = lang_names; lang->name != NULL; lang++) 1499 for (lang = lang_names; lang->name != NULL; lang++)
1490 if (lang->filenames != NULL) 1500 if (lang->filenames != NULL)
1491 for (name = lang->filenames; *name != NULL; name++) 1501 for (name = lang->filenames; *name != NULL; name++)
@@ -4621,6 +4631,7 @@ static void
4621Ruby_functions (FILE *inf) 4631Ruby_functions (FILE *inf)
4622{ 4632{
4623 char *cp = NULL; 4633 char *cp = NULL;
4634 bool reader = false, writer = false, alias = false, continuation = false;
4624 4635
4625 LOOP_ON_INPUT_LINES (inf, lb, cp) 4636 LOOP_ON_INPUT_LINES (inf, lb, cp)
4626 { 4637 {
@@ -4629,7 +4640,9 @@ Ruby_functions (FILE *inf)
4629 char *name; 4640 char *name;
4630 4641
4631 cp = skip_spaces (cp); 4642 cp = skip_spaces (cp);
4632 if (c_isalpha (*cp) && c_isupper (*cp)) /* constants */ 4643 if (!continuation
4644 /* Constants. */
4645 && c_isalpha (*cp) && c_isupper (*cp))
4633 { 4646 {
4634 char *bp, *colon = NULL; 4647 char *bp, *colon = NULL;
4635 4648
@@ -4643,7 +4656,7 @@ Ruby_functions (FILE *inf)
4643 if (cp > name + 1) 4656 if (cp > name + 1)
4644 { 4657 {
4645 bp = skip_spaces (cp); 4658 bp = skip_spaces (cp);
4646 if (*bp == '=' && c_isspace (bp[1])) 4659 if (*bp == '=' && !(bp[1] == '=' || bp[1] == '>'))
4647 { 4660 {
4648 if (colon && !c_isspace (colon[1])) 4661 if (colon && !c_isspace (colon[1]))
4649 name = colon + 1; 4662 name = colon + 1;
@@ -4652,12 +4665,14 @@ Ruby_functions (FILE *inf)
4652 } 4665 }
4653 } 4666 }
4654 } 4667 }
4655 else if ((is_method = LOOKING_AT (cp, "def")) /* module/class/method */ 4668 else if (!continuation
4656 || (is_class = LOOKING_AT (cp, "class")) 4669 /* Modules, classes, methods. */
4657 || LOOKING_AT (cp, "module")) 4670 && ((is_method = LOOKING_AT (cp, "def"))
4671 || (is_class = LOOKING_AT (cp, "class"))
4672 || LOOKING_AT (cp, "module")))
4658 { 4673 {
4659 const char self_name[] = "self."; 4674 const char self_name[] = "self.";
4660 const size_t self_size1 = sizeof ("self.") - 1; 4675 const size_t self_size1 = sizeof (self_name) - 1;
4661 4676
4662 name = cp; 4677 name = cp;
4663 4678
@@ -4689,6 +4704,86 @@ Ruby_functions (FILE *inf)
4689 make_tag (name, cp - name, true, 4704 make_tag (name, cp - name, true,
4690 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 4705 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
4691 } 4706 }
4707 else
4708 {
4709 /* Tag accessors and aliases. */
4710
4711 if (!continuation)
4712 reader = writer = alias = false;
4713
4714 while (*cp && *cp != '#')
4715 {
4716 if (!continuation)
4717 {
4718 reader = writer = alias = false;
4719 if (LOOKING_AT (cp, "attr_reader"))
4720 reader = true;
4721 else if (LOOKING_AT (cp, "attr_writer"))
4722 writer = true;
4723 else if (LOOKING_AT (cp, "attr_accessor"))
4724 {
4725 reader = true;
4726 writer = true;
4727 }
4728 else if (LOOKING_AT (cp, "alias_method"))
4729 alias = true;
4730 }
4731 if (reader || writer || alias)
4732 {
4733 do {
4734 char *np = cp;
4735
4736 if (*np == ':')
4737 np++;
4738 cp = skip_name (cp);
4739 if (reader)
4740 {
4741 make_tag (np, cp - np, true,
4742 lb.buffer, cp - lb.buffer + 1,
4743 lineno, linecharno);
4744 continuation = false;
4745 }
4746 if (writer)
4747 {
4748 size_t name_len = cp - np + 1;
4749 char *wr_name = xnew (name_len + 1, char);
4750
4751 memcpy (wr_name, np, name_len - 1);
4752 memcpy (wr_name + name_len - 1, "=", 2);
4753 pfnote (wr_name, true, lb.buffer, cp - lb.buffer + 1,
4754 lineno, linecharno);
4755 continuation = false;
4756 }
4757 if (alias)
4758 {
4759 if (!continuation)
4760 make_tag (np, cp - np, true,
4761 lb.buffer, cp - lb.buffer + 1,
4762 lineno, linecharno);
4763 continuation = false;
4764 while (*cp && *cp != '#' && *cp != ';')
4765 {
4766 if (*cp == ',')
4767 continuation = true;
4768 else if (!c_isspace (*cp))
4769 continuation = false;
4770 cp++;
4771 }
4772 if (*cp == ';')
4773 continuation = false;
4774 }
4775 cp = skip_spaces (cp);
4776 } while ((alias
4777 ? (*cp == ',')
4778 : (continuation = (*cp == ',')))
4779 && (cp = skip_spaces (cp + 1), *cp && *cp != '#'));
4780 }
4781 if (*cp != '#')
4782 cp = skip_name (cp);
4783 while (*cp && *cp != '#' && notinname (*cp))
4784 cp++;
4785 }
4786 }
4692 } 4787 }
4693} 4788}
4694 4789