From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Newsgroups: gmane.emacs.bugs Subject: bug#5624: 23.1; etags elisp and scheme "=" in names Date: Mon, 12 Jun 2017 21:31:57 -0600 Message-ID: <87mv9c36mq.fsf@gmail.com> References: <87eikcrkg8.fsf@blah.blah> <878tkztic2.fsf@gmail.com> <83poea60fz.fsf@gnu.org> <87shj553hu.fsf@gmail.com> <83fuf55m6a.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1497324792 26707 195.159.176.226 (13 Jun 2017 03:33:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 13 Jun 2017 03:33:12 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 5624@debbugs.gnu.org, user42@zip.com.au To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Jun 13 05:33:08 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKcZn-0006WV-UZ for geb-bug-gnu-emacs@m.gmane.org; Tue, 13 Jun 2017 05:33:08 +0200 Original-Received: from localhost ([::1]:40956 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKcZt-0007W7-8P for geb-bug-gnu-emacs@m.gmane.org; Mon, 12 Jun 2017 23:33:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36936) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKcZn-0007Vz-Ob for bug-gnu-emacs@gnu.org; Mon, 12 Jun 2017 23:33:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dKcZi-00043o-R1 for bug-gnu-emacs@gnu.org; Mon, 12 Jun 2017 23:33:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41549) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dKcZi-00043L-NQ for bug-gnu-emacs@gnu.org; Mon, 12 Jun 2017 23:33:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dKcZi-0005BF-Bg for bug-gnu-emacs@gnu.org; Mon, 12 Jun 2017 23:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Jun 2017 03:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5624 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5624-submit@debbugs.gnu.org id=B5624.149732475819871 (code B ref 5624); Tue, 13 Jun 2017 03:33:02 +0000 Original-Received: (at 5624) by debbugs.gnu.org; 13 Jun 2017 03:32:38 +0000 Original-Received: from localhost ([127.0.0.1]:44226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKcZJ-0005AR-SS for submit@debbugs.gnu.org; Mon, 12 Jun 2017 23:32:38 -0400 Original-Received: from mail-it0-f66.google.com ([209.85.214.66]:34454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKcZF-0005A7-W6 for 5624@debbugs.gnu.org; Mon, 12 Jun 2017 23:32:34 -0400 Original-Received: by mail-it0-f66.google.com with SMTP id 201so11223117itu.1 for <5624@debbugs.gnu.org>; Mon, 12 Jun 2017 20:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=xl6lY5DK0bEaZpDnJJjNxD6+qS7546UObZljC4CHWqI=; b=CGUg0ZRJ9jLl4RA3lZNKFfFZveaDhJv/wMRwRL6wIHFzF9NutyaRDrjk3zp/6sg071 Os7/Zb481UKfaCmcEWg1FFU5uAQ3adTBJtmoJH5cVVrvZOqXKZGNQE/CFbnWOCcW/VvG aq0xISZV7kXEgxBgpODrt26tzuD8rzBsLJMdWKI9aygpqmCFsX+O7bz4yHqnohXU+nsB Gl8Zfh7e92nSeZvdcH0u59/EX1wnInUZYL5Jp/iTKAKZbTuMhVq+IlP+iteRxjfTcBzJ TCV7wpB/SB9edBpo3mOJkgm+6AOsnTXrvCjV5GBd+LEc4BS/fbzH6EOl2fOVtiN0Fh51 xr6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=xl6lY5DK0bEaZpDnJJjNxD6+qS7546UObZljC4CHWqI=; b=RN1yBIcbKdN7B9AROAaxvKTBPVIGqS8rktmw1NAAhXgaQOFK73Nn1DhF1gwSD71Mtu J9Odq4Iilu/aqzticP8FNbVLaSdZc0GWE7Mup2YAIO16OO/+AwbVD3Ixo9coM6SxnhUg pksXuHoDB9F5qKIAFm79j5OIlBxFIRqAyRLcDHChGBZFDscvkU0UWEfU7UnzbJSzEbzA l4DTElIaP+aZgpzW5JeRCCFHmNRtkgzWjdEZqCz9M/7aU2rBh8zHRmiUDIbDlOeySd6/ DevDGzn42XnQqfM2blO01hlB71O801Z4zazKATRlsSk5vEwqJGvJUTCeTp2cR4fxL2xs WKeg== X-Gm-Message-State: AODbwcB+ks3/zcBrd6XgOV9BgnNSZcMCfhe5VyzdC6U0xFHVj5DmFJe9 Qg/R7uNmexu6aGk/ X-Received: by 10.36.175.94 with SMTP id l30mr15512859iti.70.1497324748140; Mon, 12 Jun 2017 20:32:28 -0700 (PDT) Original-Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) by smtp.gmail.com with ESMTPSA id c77sm5673340iod.24.2017.06.12.20.32.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Jun 2017 20:32:26 -0700 (PDT) In-Reply-To: <83fuf55m6a.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 12 Jun 2017 17:13:17 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:133543 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Alex >> Cc: user42@zip.com.au, 5624@debbugs.gnu.org >> Date: Sun, 11 Jun 2017 20:44:29 -0600 >> >> One issue is that the Lisp and Scheme functions use get_tag, which uses >> notinname. What do you think about the following diff? It adds a wrapper >> to notinname which get_tag uses. > > I think it would be much cleaner not to use get_tag for these > languages, but instead either call make_tag directly or write a > get_lispy_tag function which will DTRT for Lisp-like languages. > > Thanks. I wanted to reduce duplicated code, but I suppose it is cleaner that way. I've attached a patch below. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Include-in-Scheme-and-Lisp-tags-in-etags.patch Content-Description: etags >From a0a5881f654baefef53128e43ac0fe6791643e15 Mon Sep 17 00:00:00 2001 From: Alexander Gramiak Date: Mon, 12 Jun 2017 21:28:39 -0600 Subject: [PATCH] Include '=' in Scheme and Lisp tags in etags * lib-src/etags.c (get_lispy_tag): New function. (L_getit, Scheme_functions): Use get_lispy_tag (Bug#5624). --- lib-src/etags.c | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/lib-src/etags.c b/lib-src/etags.c index 6f280d8ab4..7e082dd276 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -372,6 +372,7 @@ static void readline (linebuffer *, FILE *); static long readline_internal (linebuffer *, FILE *, char const *); static bool nocase_tail (const char *); static void get_tag (char *, char **); +static void get_lispy_tag (char *, char **); static void analyze_regex (char *); static void free_regexps (void); @@ -5346,7 +5347,7 @@ L_getit (void) /* Ok, then skip "(" before name in (defstruct (foo)) */ dbp = skip_spaces (dbp); } - get_tag (dbp, NULL); + get_lispy_tag (dbp, NULL); } static void @@ -5548,14 +5549,14 @@ Scheme_functions (FILE *inf) if (strneq (bp, "(def", 4) || strneq (bp, "(DEF", 4)) { bp = skip_non_spaces (bp+4); - /* Skip over open parens and white space. Don't continue past - '\0'. */ - while (*bp && notinname (*bp)) + /* Skip over open parens and white space. + Don't continue past '\0' or '='. */ + while (*bp && notinname (*bp) && *bp != '=') bp++; - get_tag (bp, NULL); + get_lispy_tag (bp, NULL); } if (LOOKING_AT (bp, "(SET!") || LOOKING_AT (bp, "(set!")) - get_tag (bp, NULL); + get_lispy_tag (bp, NULL); } } @@ -6590,6 +6591,25 @@ get_tag (register char *bp, char **namepp) *namepp = savenstr (bp, cp - bp); } +/* Similar to get_tag, but include '=' as part of the tag. */ +static void +get_lispy_tag (register char *bp, char **namepp) +{ + register char *cp = bp; + + if (*bp != '\0') + { + /* Go till you get to white space or a syntactic break */ + for (cp = bp + 1; !notinname (*cp) || *cp == '='; cp++) + continue; + make_tag (bp, cp - bp, true, + lb.buffer, cp - lb.buffer + 1, lineno, linecharno); + } + + if (namepp != NULL) + *namepp = savenstr (bp, cp - bp); +} + /* * Read a line of text from `stream' into `lbp', excluding the * newline or CR-NL, if any. Return the number of characters read from -- 2.11.0 --=-=-=--