From 73c67dda4f22a4a9736f5dc5086d086f5eb567b3 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 21 Sep 2016 18:10:29 +0300 Subject: 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. --- lib-src/etags.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'lib-src') 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) int off = tokoff; int len = toklen; - /* Rewrite the tag so that emacs lisp DEFUNs - can be found by their elisp name */ if (defun) { off += 1; len -= 1; + + /* First, tag it as its C name */ + linebuffer_setlen (&token_name, toklen); + memcpy (token_name.buffer, + newlb.buffer + tokoff, toklen); + token_name.buffer[toklen] = '\0'; + token.named = true; + token.lineno = lineno; + token.offset = tokoff; + token.length = toklen; + token.line = newlb.buffer; + token.linepos = newlinepos; + token.valid = true; + make_C_tag (funorvar); } + /* Rewrite the tag so that emacs lisp DEFUNs + can be found also by their elisp name */ linebuffer_setlen (&token_name, len); memcpy (token_name.buffer, newlb.buffer + off, len); -- cgit v1.2.1