aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorEli Zaretskii2016-09-21 18:10:29 +0300
committerEli Zaretskii2016-09-21 18:10:29 +0300
commit73c67dda4f22a4a9736f5dc5086d086f5eb567b3 (patch)
treeb2df082cb020bd33b4fd4ccf098271a952067003 /lib-src
parentea1960bf3ccbceb955002837f17b67071789e863 (diff)
downloademacs-73c67dda4f22a4a9736f5dc5086d086f5eb567b3.tar.gz
emacs-73c67dda4f22a4a9736f5dc5086d086f5eb567b3.zip
Fix tagging of DEFUN by etags
* lib-src/etags.c (C_entries): Tag DEFUN twice: once with its C name, and then again with its Lisp name. This restores the ability to find Lisp primitives by their C name, which was lost when the etags back-end was switched to a more strict search criteria. * test/etags/ETAGS.good_1: * test/etags/ETAGS.good_2: * test/etags/ETAGS.good_3: * test/etags/ETAGS.good_4: * test/etags/ETAGS.good_5: * test/etags/ETAGS.good_6: * test/etags/CTAGS.good: Adapt to the changes in etags.c wrt tagging DEFUN.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/etags.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/lib-src/etags.c b/lib-src/etags.c
index 01e230206ac..1457700fedd 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -3436,13 +3436,27 @@ C_entries (int c_ext, FILE *inf)
3436 int off = tokoff; 3436 int off = tokoff;
3437 int len = toklen; 3437 int len = toklen;
3438 3438
3439 /* Rewrite the tag so that emacs lisp DEFUNs
3440 can be found by their elisp name */
3441 if (defun) 3439 if (defun)
3442 { 3440 {
3443 off += 1; 3441 off += 1;
3444 len -= 1; 3442 len -= 1;
3443
3444 /* First, tag it as its C name */
3445 linebuffer_setlen (&token_name, toklen);
3446 memcpy (token_name.buffer,
3447 newlb.buffer + tokoff, toklen);
3448 token_name.buffer[toklen] = '\0';
3449 token.named = true;
3450 token.lineno = lineno;
3451 token.offset = tokoff;
3452 token.length = toklen;
3453 token.line = newlb.buffer;
3454 token.linepos = newlinepos;
3455 token.valid = true;
3456 make_C_tag (funorvar);
3445 } 3457 }
3458 /* Rewrite the tag so that emacs lisp DEFUNs
3459 can be found also by their elisp name */
3446 linebuffer_setlen (&token_name, len); 3460 linebuffer_setlen (&token_name, len);
3447 memcpy (token_name.buffer, 3461 memcpy (token_name.buffer,
3448 newlb.buffer + off, len); 3462 newlb.buffer + off, len);