From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 22 17:11:30 2010 Received: (at submit) by debbugs.gnu.org; 22 Feb 2010 22:11:31 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NjgV0-0006rS-Dr for submit@debbugs.gnu.org; Mon, 22 Feb 2010 17:11:30 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NjgUx-0006rN-NQ for submit@debbugs.gnu.org; Mon, 22 Feb 2010 17:11:28 -0500 Received: from mx10.gnu.org ([199.232.76.166]:36012) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NjgUt-0004f8-PS for submit@debbugs.gnu.org; Mon, 22 Feb 2010 17:11:23 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NjgUr-0004vc-3J for submit@debbugs.gnu.org; Mon, 22 Feb 2010 17:11:22 -0500 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on monty-python X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO,UNPARSEABLE_RELAY autolearn=ham version=3.1.0 Received: from lists.gnu.org ([199.232.76.165]:40448) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NjgUq-0004vY-Td for submit@debbugs.gnu.org; Mon, 22 Feb 2010 17:11:20 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NjgUq-0001gW-DM for bug-gnu-emacs@gnu.org; Mon, 22 Feb 2010 17:11:20 -0500 Received: from [140.186.70.92] (port=50109 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NjgUp-0001ev-EX for bug-gnu-emacs@gnu.org; Mon, 22 Feb 2010 17:11:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NjgUn-0007Yu-WC for bug-gnu-emacs@gnu.org; Mon, 22 Feb 2010 17:11:19 -0500 Received: from mailout2-4.pacific.net.au ([61.8.2.227]:45904 helo=mailout2.pacific.net.au) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NjgUn-0007YJ-Le for bug-gnu-emacs@gnu.org; Mon, 22 Feb 2010 17:11:17 -0500 Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout2.pacific.net.au (Postfix) with ESMTP id 46C2E1F90A7 for ; Tue, 23 Feb 2010 09:11:12 +1100 (EST) Received: from blah.blah (ppp248F.dyn.pacific.net.au [61.8.36.143]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 9661C27403 for ; Tue, 23 Feb 2010 09:11:05 +1100 (EST) Received: from gg by blah.blah with local (Exim 4.71) (envelope-from ) id 1NjgTY-0001kh-2x for bug-gnu-emacs@gnu.org; Tue, 23 Feb 2010 09:10:00 +1100 From: Kevin Ryde To: bug-gnu-emacs@gnu.org Subject: 23.1; etags elisp and scheme "=" in names Date: Tue, 23 Feb 2010 09:09:59 +1100 Message-ID: <87eikcrkg8.fsf@blah.blah> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.5 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.5 (-----) If an elisp defun has an "=" char in its name, etags stops at that point and the TAGS file doesn't have the whole name. Eg. a foo.el containing (defun foo==bar () (message "hi")) M-. foo==bar gives No tags containing foo==bar The same seems to be true of scheme, eg. a foo.scm containing a similar (define foo==bar 123) The way the tag line comes out means a single "=" at the end of a name, or any number of them at the start of a name, ends up working, but I believe it's legal (if unusual) to have them in the middle of a name too. In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.16.5) of 2009-09-14 on raven, modified by Debian configured using `configure '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_AU value of $XMODIFIERS: nil locale-coding-system: iso-latin-1-unix default-enable-multibyte-characters: t From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 23 15:56:35 2010 Received: (at control) by debbugs.gnu.org; 23 Feb 2010 20:56:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nk1o3-0007Pw-Ou for submit@debbugs.gnu.org; Tue, 23 Feb 2010 15:56:35 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nk1o2-0007Pq-6j for control@debbugs.gnu.org; Tue, 23 Feb 2010 15:56:34 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1Nk1ny-0004Z5-2k; Tue, 23 Feb 2010 15:56:30 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19332.16638.27086.6555@fencepost.gnu.org> Date: Tue, 23 Feb 2010 15:56:30 -0500 From: Glenn Morris To: control Subject: control X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: green X-Ran: h-wpq,1&S List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) tags 5617 moreinfo severity 5620 wishlist reassign 5624 emacs,etags severity 5625 minor unarchive 798 forcemerge 798 5626 severity 5627 minor tags 5627 notabug wontfix tags 5629 patch reassign 5629 emacs,w32 From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 10 21:38:22 2017 Received: (at 5624) by debbugs.gnu.org; 11 Jun 2017 01:38:22 +0000 Received: from localhost ([127.0.0.1]:39571 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJrpe-0004I7-Eh for submit@debbugs.gnu.org; Sat, 10 Jun 2017 21:38:22 -0400 Received: from mail-it0-f68.google.com ([209.85.214.68]:32808) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dJrpc-0004Hu-VK for 5624@debbugs.gnu.org; Sat, 10 Jun 2017 21:38:21 -0400 Received: by mail-it0-f68.google.com with SMTP id l6so8973898iti.0 for <5624@debbugs.gnu.org>; Sat, 10 Jun 2017 18:38:20 -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=AJZc+jK3/ccg4Sv8tZJjjgar+nvVFQlMzISQlaa1rck=; b=Sa/MWPHEJLTgcgulq4SKSBWKF3Lx4eioyYFqaMenjGGFidn9+6upQ7ALwKlyqsqmV1 iCISFfbPcyBkM3XvJ7mif/NbFpOTWz3jL+nP/s86l7Djjq8gs4Bt5mxnU3UBmS1iz+Jy JG5IbW9MwZSZC6EbuH+PPTfJESy2xAsb7MRUPaTYkFzp4+OqQK/2x2NGTUD3nKpOteIg WULmZLrQth4Un/lmohWatVdztVCCf0h042Q5KPGPMSjF/um/EV5VP2SpW8ZNZAKe0An7 FkO56p1xXb9XKIyzUG3NAgC450J98/OAgsk9CvtdPUJeJHJhHHf1qQ5vmzRKwhILkzta 0Qrw== 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=AJZc+jK3/ccg4Sv8tZJjjgar+nvVFQlMzISQlaa1rck=; b=rB1CKGHwMPsVabkY55Ud9IVv04N/E4yJAYRrWJbX66+vXDfHWwsC3qexC1wiLVTiJl 8uX/2wHRgC+CXTKGtploAhkatZEHXLFN9eKANVMOtmjdQJXLYsWNSoNpiApJc6iLfYq0 VgC3SpvoeJdA2g9R2VP4DkHEsXny2YPhUoDOALrvoeGm+45+2HLhuVE89Q6SukBhjUV/ 4LQ8ocoXbfvySx6LKi0Ck0KJ92QlFuLlfgl1/fZzWNvEY5XhkM00mxC5D1OWFvHsICC1 fo4l5u8XyY/dLsLiXkp2rAewrLQ29U7GPF7AC/JrOph6SHTE/EKtI37Zsm9Sw48Vv4Gx D49Q== X-Gm-Message-State: AODbwcBfhe/qC3QiZ58nNP3FN/sx6qBf+2h9cRu1VzjulCUvlajRmT6a CZvz1ybyjRlFOg7F X-Received: by 10.36.22.137 with SMTP id a131mr6256483ita.115.1497145095274; Sat, 10 Jun 2017 18:38:15 -0700 (PDT) Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) by smtp.gmail.com with ESMTPSA id h76sm2081433ith.24.2017.06.10.18.38.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 10 Jun 2017 18:38:14 -0700 (PDT) From: Alex To: Kevin Ryde Subject: Re: bug#5624: 23.1; etags elisp and scheme "=" in names References: <87eikcrkg8.fsf@blah.blah> Date: Sat, 10 Jun 2017 19:37:49 -0600 In-Reply-To: <87eikcrkg8.fsf@blah.blah> (Kevin Ryde's message of "Tue, 23 Feb 2010 09:09:59 +1100") Message-ID: <878tkztic2.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 5624 Cc: 5624@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Kevin Ryde writes: > If an elisp defun has an "=" char in its name, etags stops at that point > and the TAGS file doesn't have the whole name. Eg. a foo.el containing > > (defun foo==bar () (message "hi")) > > M-. foo==bar gives > > No tags containing foo==bar > > The same seems to be true of scheme, eg. a foo.scm containing a similar > > (define foo==bar 123) > > The way the tag line comes out means a single "=" at the end of a name, > or any number of them at the start of a name, ends up working, but I > believe it's legal (if unusual) to have them in the middle of a name > too. This appears to be because in etags.c, all languages use the same `notinname' procedure to determine a valid identifier. Shouldn't each language (optionally) use a different procedure to determine the bounds of an identifier? Lisp and Scheme, for instance, would not have '=' in their respective `notinname' procedures. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 11 10:53:16 2017 Received: (at 5624) by debbugs.gnu.org; 11 Jun 2017 14:53:16 +0000 Received: from localhost ([127.0.0.1]:41247 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dK4Eu-00015u-12 for submit@debbugs.gnu.org; Sun, 11 Jun 2017 10:53:16 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36607) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dK4Er-00015g-I9 for 5624@debbugs.gnu.org; Sun, 11 Jun 2017 10:53:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dK4Eg-00024G-Qh for 5624@debbugs.gnu.org; Sun, 11 Jun 2017 10:53:07 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dK4Eg-000246-Ms; Sun, 11 Jun 2017 10:53:02 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2173 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dK4Ef-0002nT-O6; Sun, 11 Jun 2017 10:53:02 -0400 Date: Sun, 11 Jun 2017 17:52:48 +0300 Message-Id: <83poea60fz.fsf@gnu.org> From: Eli Zaretskii To: Alex In-reply-to: <878tkztic2.fsf@gmail.com> (message from Alex on Sat, 10 Jun 2017 19:37:49 -0600) Subject: Re: bug#5624: 23.1; etags elisp and scheme "=" in names References: <87eikcrkg8.fsf@blah.blah> <878tkztic2.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 5624 Cc: 5624@debbugs.gnu.org, user42@zip.com.au X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Alex > Date: Sat, 10 Jun 2017 19:37:49 -0600 > Cc: 5624@debbugs.gnu.org > > Kevin Ryde writes: > > > If an elisp defun has an "=" char in its name, etags stops at that point > > and the TAGS file doesn't have the whole name. Eg. a foo.el containing > > > > (defun foo==bar () (message "hi")) > > > > M-. foo==bar gives > > > > No tags containing foo==bar > > > > The same seems to be true of scheme, eg. a foo.scm containing a similar > > > > (define foo==bar 123) > > > > The way the tag line comes out means a single "=" at the end of a name, > > or any number of them at the start of a name, ends up working, but I > > believe it's legal (if unusual) to have them in the middle of a name > > too. > > This appears to be because in etags.c, all languages use the same > `notinname' procedure to determine a valid identifier. Yes. But there are exceptions from this rule, where that is deemed necessary. For example, Ruby_functions has this: /* Ruby method names can end in a '='. Also, operator overloading can define operators whose names include '='. */ while (!notinname (*cp) || *cp == '=') cp++; > Shouldn't each language (optionally) use a different procedure to > determine the bounds of an identifier? Lisp and Scheme, for instance, > would not have '=' in their respective `notinname' procedures. Feel free to work on this, if you want to scratch that particular itch. Alternatively, just augment notinname in language-specific support code, like some of the supported languages already do. TIA. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 11 22:44:43 2017 Received: (at 5624) by debbugs.gnu.org; 12 Jun 2017 02:44:43 +0000 Received: from localhost ([127.0.0.1]:41672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKFLO-0004Xe-Ux for submit@debbugs.gnu.org; Sun, 11 Jun 2017 22:44:43 -0400 Received: from mail-it0-f46.google.com ([209.85.214.46]:36920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKFLN-0004XR-Oy for 5624@debbugs.gnu.org; Sun, 11 Jun 2017 22:44:42 -0400 Received: by mail-it0-f46.google.com with SMTP id m47so15588829iti.0 for <5624@debbugs.gnu.org>; Sun, 11 Jun 2017 19:44:41 -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=+EdbSl0pYMTgNntXrxiioOyVFZ0YQml/IeoZfZCJQOE=; b=g6n3Vo408MND6SwEV8qJ8RIXv0WywvSSpJZzgWfEVv5d0koW+3+gJXlWu5ttldHQLT s3ix+wTAeQMS8KG78SZJdkRIDIWANCZDPfODzLme8yXmKAqqxFJQqlwUSJz2vM5uJin3 w4DJ72bM0kDJaXItAGXQ6qxcTBpNa0hR6LQeuDQFNmf3VQF+8L862S6DIuRsmHpVkEdT iZNFUQVA90Vk2kSxbGN28o8/UXVbZO7cfcWxA6zPfJK0MRb7xO2Ae/d2FcFniXQJp9nt 4v9DAWv1K/pk/VY8gL14pMboKNtgVz+Y46d9ejHwwS99NCz9IyHvchTzMm7Vy5p+A0yO Az6w== 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=+EdbSl0pYMTgNntXrxiioOyVFZ0YQml/IeoZfZCJQOE=; b=DZ6CUSVatB356YP1r5ZTq0sBNJJ3Qav4Grm6dUaXIdf8DlAMwcfRwAeJorCUJ2EXAl NZXVQg5m+sU1F96Wy8IpT5SatclTqVPtDiVeNHvl8hafLEHCfFFhTKicGMsbu88IWHml 9ecA0o9o56FbitktNmrzJjOJ5qbUU5EP8utmc6rwUO7SN/2uRzedjs3avpX5biYDiB2N GNJsOVp4ae9LaVj8IxqU2RUMC9esCgQebhdHQuzfGY+kU9my6CRdBwYNDpHxp/aDONV4 7ouk+D9nEBM+MX7EZvBx/vw4M1mePaIRFtrKojO7VGRWwJtkp0Rrq1cXz1PLpQPsIm5F kksA== X-Gm-Message-State: AODbwcDOKOcPLsbO7EzweVg/O5FdM6DYRaiy70iFUBPcCCsyOJ6a5/2I 2OWYanhlUffeX+iK X-Received: by 10.36.69.19 with SMTP id y19mr9805238ita.26.1497235475745; Sun, 11 Jun 2017 19:44:35 -0700 (PDT) Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) by smtp.gmail.com with ESMTPSA id h76sm3485982ith.24.2017.06.11.19.44.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 11 Jun 2017 19:44:34 -0700 (PDT) From: Alex To: Eli Zaretskii Subject: Re: bug#5624: 23.1; etags elisp and scheme "=" in names References: <87eikcrkg8.fsf@blah.blah> <878tkztic2.fsf@gmail.com> <83poea60fz.fsf@gnu.org> Date: Sun, 11 Jun 2017 20:44:29 -0600 In-Reply-To: <83poea60fz.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 11 Jun 2017 17:52:48 +0300") Message-ID: <87shj553hu.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 5624 Cc: 5624@debbugs.gnu.org, user42@zip.com.au X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Alex >> Date: Sat, 10 Jun 2017 19:37:49 -0600 >> Cc: 5624@debbugs.gnu.org >> This appears to be because in etags.c, all languages use the same >> `notinname' procedure to determine a valid identifier. > > Yes. But there are exceptions from this rule, where that is deemed > necessary. For example, Ruby_functions has this: > > /* Ruby method names can end in a '='. Also, operator overloading can > define operators whose names include '='. */ > while (!notinname (*cp) || *cp == '=') > cp++; > >> Shouldn't each language (optionally) use a different procedure to >> determine the bounds of an identifier? Lisp and Scheme, for instance, >> would not have '=' in their respective `notinname' procedures. > > Feel free to work on this, if you want to scratch that particular > itch. Alternatively, just augment notinname in language-specific > support code, like some of the supported languages already do. > > TIA. 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 had to add an additional parameter to get_tag. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=etags.diff Content-Description: notinname_lang diff --git a/lib-src/etags.c b/lib-src/etags.c index 6f280d8ab4..e354325ad5 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -181,6 +181,20 @@ notinname (unsigned char c) return table[c]; } +/* C is not in a name in language LANG. */ +static bool +notinname_lang (unsigned char c, char const *lang) +{ + if (lang == NULL) + return notinname (c); + + else if (streq ("lisp", lang) || streq ("scheme", lang)) + if (c == '=') + return false; + + return notinname (c); +} + /* C can start a token. */ static bool begtoken (unsigned char c) @@ -371,7 +385,7 @@ static language *get_language_from_langname (const char *); 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_tag (char *, char **, char const *); static void analyze_regex (char *); static void free_regexps (void); @@ -4715,7 +4729,7 @@ Perl_functions (FILE *inf) if (LOOKING_AT (cp, "package")) { free (package); - get_tag (cp, &package); + get_tag (cp, &package, NULL); } else if (LOOKING_AT (cp, "sub")) { @@ -5346,7 +5360,7 @@ L_getit (void) /* Ok, then skip "(" before name in (defstruct (foo)) */ dbp = skip_spaces (dbp); } - get_tag (dbp, NULL); + get_tag (dbp, NULL, "lisp"); } static void @@ -5426,7 +5440,7 @@ Lua_functions (FILE *inf) { char *tag_name, *tp_dot, *tp_colon; - get_tag (bp, &tag_name); + get_tag (bp, &tag_name, NULL); /* If the tag ends with ".foo" or ":foo", make an additional tag for "foo". */ tp_dot = strrchr (tag_name, '.'); @@ -5436,7 +5450,7 @@ Lua_functions (FILE *inf) char *p = tp_dot > tp_colon ? tp_dot : tp_colon; int len_add = p - tag_name + 1; - get_tag (bp + len_add, NULL); + get_tag (bp + len_add, NULL, NULL); } } } @@ -5468,7 +5482,7 @@ PS_functions (FILE *inf) lb.buffer, ep - lb.buffer + 1, lineno, linecharno); } else if (LOOKING_AT (bp, "defineps")) - get_tag (bp, NULL); + get_tag (bp, NULL, NULL); } } @@ -5550,12 +5564,12 @@ Scheme_functions (FILE *inf) bp = skip_non_spaces (bp+4); /* Skip over open parens and white space. Don't continue past '\0'. */ - while (*bp && notinname (*bp)) + while (*bp && notinname_lang (*bp, "scheme")) bp++; - get_tag (bp, NULL); + get_tag (bp, NULL, "scheme"); } if (LOOKING_AT (bp, "(SET!") || LOOKING_AT (bp, "(set!")) - get_tag (bp, NULL); + get_tag (bp, NULL, "scheme"); } } @@ -6573,14 +6587,14 @@ nocase_tail (const char *cp) } static void -get_tag (register char *bp, char **namepp) +get_tag (register char *bp, char **namepp, char const *lang) { 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++) + for (cp = bp + 1; !notinname_lang (*cp, lang); cp++) continue; make_tag (bp, cp - bp, true, lb.buffer, cp - lb.buffer + 1, lineno, linecharno); --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 12 10:13:40 2017 Received: (at 5624) by debbugs.gnu.org; 12 Jun 2017 14:13:40 +0000 Received: from localhost ([127.0.0.1]:43569 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKQ67-0002f3-Sv for submit@debbugs.gnu.org; Mon, 12 Jun 2017 10:13:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54838) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKQ65-0002en-P2 for 5624@debbugs.gnu.org; Mon, 12 Jun 2017 10:13:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dKQ5w-0008R2-NH for 5624@debbugs.gnu.org; Mon, 12 Jun 2017 10:13:32 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46741) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKQ5w-0008Qt-JT; Mon, 12 Jun 2017 10:13:28 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3328 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dKQ5v-0000OV-Pe; Mon, 12 Jun 2017 10:13:28 -0400 Date: Mon, 12 Jun 2017 17:13:17 +0300 Message-Id: <83fuf55m6a.fsf@gnu.org> From: Eli Zaretskii To: Alex In-reply-to: <87shj553hu.fsf@gmail.com> (message from Alex on Sun, 11 Jun 2017 20:44:29 -0600) Subject: Re: bug#5624: 23.1; etags elisp and scheme "=" in names References: <87eikcrkg8.fsf@blah.blah> <878tkztic2.fsf@gmail.com> <83poea60fz.fsf@gnu.org> <87shj553hu.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 5624 Cc: 5624@debbugs.gnu.org, user42@zip.com.au X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > 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. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 12 23:32:38 2017 Received: (at 5624) by debbugs.gnu.org; 13 Jun 2017 03:32:38 +0000 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 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 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) 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) From: Alex To: Eli Zaretskii Subject: Re: bug#5624: 23.1; etags elisp and scheme "=" in names References: <87eikcrkg8.fsf@blah.blah> <878tkztic2.fsf@gmail.com> <83poea60fz.fsf@gnu.org> <87shj553hu.fsf@gmail.com> <83fuf55m6a.fsf@gnu.org> Date: Mon, 12 Jun 2017 21:31:57 -0600 In-Reply-To: <83fuf55m6a.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 12 Jun 2017 17:13:17 +0300") Message-ID: <87mv9c36mq.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 5624 Cc: 5624@debbugs.gnu.org, user42@zip.com.au X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= 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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 13 10:29:21 2017 Received: (at 5624) by debbugs.gnu.org; 13 Jun 2017 14:29:21 +0000 Received: from localhost ([127.0.0.1]:46056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKmoo-0004ZI-4N for submit@debbugs.gnu.org; Tue, 13 Jun 2017 10:29:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49095) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dKmoj-0004Z3-CB for 5624@debbugs.gnu.org; Tue, 13 Jun 2017 10:29:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dKmoa-0006nx-39 for 5624@debbugs.gnu.org; Tue, 13 Jun 2017 10:29:08 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:44361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dKmoa-0006nr-00; Tue, 13 Jun 2017 10:29:04 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4473 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dKmoY-0000Ic-UO; Tue, 13 Jun 2017 10:29:03 -0400 Date: Tue, 13 Jun 2017 17:28:51 +0300 Message-Id: <83lgow3qsc.fsf@gnu.org> From: Eli Zaretskii To: Alex In-reply-to: <87mv9c36mq.fsf@gmail.com> (message from Alex on Mon, 12 Jun 2017 21:31:57 -0600) Subject: Re: bug#5624: 23.1; etags elisp and scheme "=" in names References: <87eikcrkg8.fsf@blah.blah> <878tkztic2.fsf@gmail.com> <83poea60fz.fsf@gnu.org> <87shj553hu.fsf@gmail.com> <83fuf55m6a.fsf@gnu.org> <87mv9c36mq.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 5624 Cc: 5624@debbugs.gnu.org, user42@zip.com.au X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Alex > Cc: user42@zip.com.au, 5624@debbugs.gnu.org > Date: Mon, 12 Jun 2017 21:31:57 -0600 > > > 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. Thanks. This looks OK to me, but please also add a test for this problem, and make sure the previous tests still succeed. (The etags test suite is in test/manual/etags/.) > +/* 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); > +} It looks like none of the callers uses a non-NULL 2nd arg, so perhaps just remove it, and its supporting code. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 14 18:11:01 2017 Received: (at 5624) by debbugs.gnu.org; 14 Jun 2017 22:11:01 +0000 Received: from localhost ([127.0.0.1]:48068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLGV7-0006av-7n for submit@debbugs.gnu.org; Wed, 14 Jun 2017 18:11:00 -0400 Received: from mail-it0-f47.google.com ([209.85.214.47]:36535) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLGV5-0006ai-AX for 5624@debbugs.gnu.org; Wed, 14 Jun 2017 18:10:56 -0400 Received: by mail-it0-f47.google.com with SMTP id m47so8232882iti.1 for <5624@debbugs.gnu.org>; Wed, 14 Jun 2017 15:10:55 -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=WMxWomPCiU0ZV1pljZ/Q95GD6pKvjCa34QTcd9OF2Is=; b=Tz+g33hfYY4Q+rS67O/Zbazsd7PH0+eqPAO4sePEWbix07jP2iC5HsUIVKJ+W8lVIZ j2uHkWoJMRBvRuHMZ++//KcDQf5lFOym8hp/eRrQ7zF+Rps33NiOgsuekkNLC3p7pa9C C2zBysKYoaOAjXekthNWHqJQ4BdxsYIyGsbTPW2Dj2t6B8UYcuYPcrGwhSGVz1MXzi5L v4QCrTDX5fKyjI+3h3gNivvtGNEdRE0m0J6LWtTaabWnWELxkz/JS2vrKtPrgZa6IfIe md3B7fNDWVK1H9wBRB9qjVlCXyYF5Rrabl7MQXFRxJs9QU8jr2B/UAooUHUNsSXhoTfz a32w== 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=WMxWomPCiU0ZV1pljZ/Q95GD6pKvjCa34QTcd9OF2Is=; b=SmSX3Zq1hSykv0W6XiWzViAHXG2PYSkCqdd9sVZPa/JwB/iiZCrt13rylUReQT31Pk +cRZ1S/vPavZUl+9H8jx89EICld6G4r3RfsoZ2+eux6Vlqr1xiPEKaob6j9bkWk/d7Jy IQxPo+YfBypuI3TnRJR2qsKScaJjiM+TYjxCoiRJzy1LJ8Z87hN4TXU+xcf6UWGzBMI2 lyzJAUJAvmdHtUwEDOnvWc0ZUhYFht6B3VMf3h7jZNwPqV7tO3xAcVwOn7RNu3Zv7Q8e 21kwcZd+IxaxYk8UsmUdyShgPYGxBbpnsZo0+A4WTYZKxitzE+elHBfLHB4/yz1h8j24 96JQ== X-Gm-Message-State: AKS2vOxbpIBBopa+WKo7Smgk1aq/907go6WwFiTBAeCEf0q3q1iQiS5h DBloutHeDmTmrGqX X-Received: by 10.36.41.197 with SMTP id p188mr2302215itp.81.1497478248895; Wed, 14 Jun 2017 15:10:48 -0700 (PDT) Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) by smtp.gmail.com with ESMTPSA id r77sm594845ioe.16.2017.06.14.15.10.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Jun 2017 15:10:47 -0700 (PDT) From: Alex To: Eli Zaretskii Subject: Re: bug#5624: 23.1; etags elisp and scheme "=" in names References: <87eikcrkg8.fsf@blah.blah> <878tkztic2.fsf@gmail.com> <83poea60fz.fsf@gnu.org> <87shj553hu.fsf@gmail.com> <83fuf55m6a.fsf@gnu.org> <87mv9c36mq.fsf@gmail.com> <83lgow3qsc.fsf@gnu.org> Date: Wed, 14 Jun 2017 16:10:37 -0600 In-Reply-To: <83lgow3qsc.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 13 Jun 2017 17:28:51 +0300") Message-ID: <877f0erzj6.fsf@lylat> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 5624 Cc: 5624@debbugs.gnu.org, user42@zip.com.au X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Alex >> Cc: user42@zip.com.au, 5624@debbugs.gnu.org >> Date: Mon, 12 Jun 2017 21:31:57 -0600 >> >> > 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. > > Thanks. This looks OK to me, but please also add a test for this > problem, and make sure the previous tests still succeed. (The etags > test suite is in test/manual/etags/.) > >> +/* 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); >> +} > > It looks like none of the callers uses a non-NULL 2nd arg, so perhaps > just remove it, and its supporting code. Alright, I did both. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Include-in-Scheme-and-Lisp-tags-in-etags.patch Content-Transfer-Encoding: 8bit Content-Description: etags >From 0b5ca3f4d395e3894e4e2098ca77af62549b88a5 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). * test/manual/etags/CTAGS.good: * test/manual/etags/ETAGS.good_1: * test/manual/etags/ETAGS.good_2: * test/manual/etags/ETAGS.good_3: * test/manual/etags/ETAGS.good_4: * test/manual/etags/ETAGS.good_5: * test/manual/etags/ETAGS.good_6: * test/manual/etags/Makefile: * test/manual/etags/el-src/TAGTEST.EL: Update tests. * test/manual/etags/scm-src/test.scm: Add tests for Scheme. --- lib-src/etags.c | 29 +++++++++++++++++++++++------ test/manual/etags/CTAGS.good | 8 ++++++++ test/manual/etags/ETAGS.good_1 | 16 +++++++++++++--- test/manual/etags/ETAGS.good_2 | 16 +++++++++++++--- test/manual/etags/ETAGS.good_3 | 16 +++++++++++++--- test/manual/etags/ETAGS.good_4 | 16 +++++++++++++--- test/manual/etags/ETAGS.good_5 | 16 +++++++++++++--- test/manual/etags/ETAGS.good_6 | 16 +++++++++++++--- test/manual/etags/Makefile | 3 ++- test/manual/etags/el-src/TAGTEST.EL | 1 + test/manual/etags/scm-src/test.scm | 20 ++++++++++++++++++++ 11 files changed, 132 insertions(+), 25 deletions(-) create mode 100644 test/manual/etags/scm-src/test.scm diff --git a/lib-src/etags.c b/lib-src/etags.c index 6f280d8ab4..ef377b399d 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 *); 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); } 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); } if (LOOKING_AT (bp, "(SET!") || LOOKING_AT (bp, "(set!")) - get_tag (bp, NULL); + get_lispy_tag (bp); } } @@ -6590,6 +6591,22 @@ 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) +{ + 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); + } +} + /* * Read a line of text from `stream' into `lbp', excluding the * newline or CR-NL, if any. Return the number of characters read from diff --git a/test/manual/etags/CTAGS.good b/test/manual/etags/CTAGS.good index 13bb37c2e6..519315c6fd 100644 --- a/test/manual/etags/CTAGS.good +++ b/test/manual/etags/CTAGS.good @@ -202,6 +202,7 @@ ${CHECKOBJS} make-src/Makefile /^${CHECKOBJS}: CFLAGS=-g3 -DNULLFREECHECK=0$/ =\relax tex-src/texinfo.tex /^\\let\\subsubsection=\\relax$/ =\relax tex-src/texinfo.tex /^\\let\\appendix=\\relax$/ =\smartitalic tex-src/texinfo.tex /^\\let\\cite=\\smartitalic$/ +=starts-with-equals! scm-src/test.scm /^(define =starts-with-equals! #t)$/ > tex-src/texinfo.tex /^\\def>{{\\tt \\gtr}}$/ >field1 forth-src/test-forth.fth /^ 9 field >field1$/ >field2 forth-src/test-forth.fth /^ 5 field >field2$/ @@ -2750,6 +2751,7 @@ current-idle-time c-src/emacs/src/keyboard.c /^DEFUN ("current-idle-time", Fcurr current-input-mode c-src/emacs/src/keyboard.c /^DEFUN ("current-input-mode", Fcurrent_input_mode, / current_kboard c-src/emacs/src/keyboard.c 85 current_lb_is_new c-src/etags.c 2926 +curry-test scm-src/test.scm /^(define (((((curry-test a) b) c) d) e)$/ cursor_position cp-src/screen.cpp /^void cursor_position(void)$/ cursor_x cp-src/screen.cpp 15 cursor_y cp-src/screen.cpp 15 @@ -3037,6 +3039,7 @@ foo ruby-src/test1.ru /^ attr_reader :foo$/ foo! ruby-src/test1.ru /^ def foo!$/ foo1 ruby-src/test1.ru /^ attr_reader(:foo1, :bar1, # comment$/ foo2 ruby-src/test1.ru /^ alias_method ( :foo2, #cmmt$/ +foo==bar el-src/TAGTEST.EL /^(defun foo==bar () (message "hi")) ; Bug#5624$/ foobar c-src/c.c /^int foobar() {;}$/ foobar c.c /^extern void foobar (void) __attribute__ ((section / foobar2 c-src/h.h 20 @@ -3161,6 +3164,9 @@ header c-src/emacs/src/lisp.h 1672 header c-src/emacs/src/lisp.h 1826 header_size c-src/emacs/src/lisp.h 1471 heapsize c-src/emacs/src/gmalloc.c 361 +hello scm-src/test.scm /^(define hello "Hello, Emacs!")$/ +hello scm-src/test.scm /^(set! hello "Hello, world!")$/ +hello-world scm-src/test.scm /^(define (hello-world)$/ help c-src/etags.c 193 helpPanel objcpp-src/SimpleCalc.M /^- helpPanel:sender$/ help_char_p c-src/emacs/src/keyboard.c /^help_char_p (Lisp_Object c)$/ @@ -4317,10 +4323,12 @@ test erl-src/gs_dialog.erl /^test() ->$/ test go-src/test1.go /^func test(p plus) {$/ test make-src/Makefile /^test:$/ test php-src/ptest.php /^test $/ +test-begin scm-src/test.scm /^(define-syntax test-begin$/ test.me22b lua-src/test.lua /^ local function test.me22b (one)$/ test.me_22a lua-src/test.lua /^ function test.me_22a(one, two)$/ test_undefined c-src/emacs/src/keyboard.c /^test_undefined (Lisp_Object binding)$/ texttreelist prol-src/natded.prolog /^texttreelist([]).$/ +there-is-a-=-in-the-middle! scm-src/test.scm /^(define (there-is-a-=-in-the-middle!) #t)$/ this c-src/a/b/b.c 1 this-command-keys c-src/emacs/src/keyboard.c /^DEFUN ("this-command-keys", Fthis_command_keys, St/ this-command-keys-vector c-src/emacs/src/keyboard.c /^DEFUN ("this-command-keys-vector", Fthis_command_k/ diff --git a/test/manual/etags/ETAGS.good_1 b/test/manual/etags/ETAGS.good_1 index 6c4a02ae1c..1dd540cd66 100644 --- a/test/manual/etags/ETAGS.good_1 +++ b/test/manual/etags/ETAGS.good_1 @@ -2143,10 +2143,11 @@ main(37,571 class D 41,622 D(43,659 -el-src/TAGTEST.EL,148 +el-src/TAGTEST.EL,179 (foo::defmumble bletch 1,0 -(defalias 'pending-delete-mode pending-delete-mode5,102 -(defalias (quote explicitly-quoted-pending-delete-mode)8,175 +(defun foo==bar foo==bar2,33 +(defalias 'pending-delete-mode pending-delete-mode6,149 +(defalias (quote explicitly-quoted-pending-delete-mode)9,222 el-src/emacs/lisp/progmodes/etags.el,5069 (defvar tags-file-name 34,1034 @@ -3135,6 +3136,15 @@ module A9,57 alias_method ( :foo2,foo237,586 A::Constant Constant42,655 +scm-src/test.scm,260 +(define hello 1,0 +(set! hello 3,32 +(define (hello-world)5,62 +(define (there-is-a-=-in-the-middle!)there-is-a-=-in-the-middle!10,128 +(define =starts-with-equals! =starts-with-equals!12,171 +(define (((((curry-test 14,205 +(define-syntax test-begin17,265 + tex-src/testenv.tex,52 \newcommand{\nm}\nm4,77 \section{blah}blah8,139 diff --git a/test/manual/etags/ETAGS.good_2 b/test/manual/etags/ETAGS.good_2 index fa784d2e7b..3563f4611a 100644 --- a/test/manual/etags/ETAGS.good_2 +++ b/test/manual/etags/ETAGS.good_2 @@ -2712,10 +2712,11 @@ main(37,571 class D 41,622 D(43,659 -el-src/TAGTEST.EL,148 +el-src/TAGTEST.EL,179 (foo::defmumble bletch 1,0 -(defalias 'pending-delete-mode pending-delete-mode5,102 -(defalias (quote explicitly-quoted-pending-delete-mode)8,175 +(defun foo==bar foo==bar2,33 +(defalias 'pending-delete-mode pending-delete-mode6,149 +(defalias (quote explicitly-quoted-pending-delete-mode)9,222 el-src/emacs/lisp/progmodes/etags.el,5188 (defvar tags-file-name 34,1034 @@ -3708,6 +3709,15 @@ module A9,57 alias_method ( :foo2,foo237,586 A::Constant Constant42,655 +scm-src/test.scm,260 +(define hello 1,0 +(set! hello 3,32 +(define (hello-world)5,62 +(define (there-is-a-=-in-the-middle!)there-is-a-=-in-the-middle!10,128 +(define =starts-with-equals! =starts-with-equals!12,171 +(define (((((curry-test 14,205 +(define-syntax test-begin17,265 + tex-src/testenv.tex,52 \newcommand{\nm}\nm4,77 \section{blah}blah8,139 diff --git a/test/manual/etags/ETAGS.good_3 b/test/manual/etags/ETAGS.good_3 index 547dee2d43..e9356620dc 100644 --- a/test/manual/etags/ETAGS.good_3 +++ b/test/manual/etags/ETAGS.good_3 @@ -2520,10 +2520,11 @@ main(37,571 D(43,659 int x;44,694 -el-src/TAGTEST.EL,148 +el-src/TAGTEST.EL,179 (foo::defmumble bletch 1,0 -(defalias 'pending-delete-mode pending-delete-mode5,102 -(defalias (quote explicitly-quoted-pending-delete-mode)8,175 +(defun foo==bar foo==bar2,33 +(defalias 'pending-delete-mode pending-delete-mode6,149 +(defalias (quote explicitly-quoted-pending-delete-mode)9,222 el-src/emacs/lisp/progmodes/etags.el,5069 (defvar tags-file-name 34,1034 @@ -3542,6 +3543,15 @@ module A9,57 alias_method ( :foo2,foo237,586 A::Constant Constant42,655 +scm-src/test.scm,260 +(define hello 1,0 +(set! hello 3,32 +(define (hello-world)5,62 +(define (there-is-a-=-in-the-middle!)there-is-a-=-in-the-middle!10,128 +(define =starts-with-equals! =starts-with-equals!12,171 +(define (((((curry-test 14,205 +(define-syntax test-begin17,265 + tex-src/testenv.tex,52 \newcommand{\nm}\nm4,77 \section{blah}blah8,139 diff --git a/test/manual/etags/ETAGS.good_4 b/test/manual/etags/ETAGS.good_4 index 2c50ec1a74..318e3614a4 100644 --- a/test/manual/etags/ETAGS.good_4 +++ b/test/manual/etags/ETAGS.good_4 @@ -2307,10 +2307,11 @@ main(37,571 class D 41,622 D(43,659 -el-src/TAGTEST.EL,148 +el-src/TAGTEST.EL,179 (foo::defmumble bletch 1,0 -(defalias 'pending-delete-mode pending-delete-mode5,102 -(defalias (quote explicitly-quoted-pending-delete-mode)8,175 +(defun foo==bar foo==bar2,33 +(defalias 'pending-delete-mode pending-delete-mode6,149 +(defalias (quote explicitly-quoted-pending-delete-mode)9,222 el-src/emacs/lisp/progmodes/etags.el,5069 (defvar tags-file-name 34,1034 @@ -3299,6 +3300,15 @@ module A9,57 alias_method ( :foo2,foo237,586 A::Constant Constant42,655 +scm-src/test.scm,260 +(define hello 1,0 +(set! hello 3,32 +(define (hello-world)5,62 +(define (there-is-a-=-in-the-middle!)there-is-a-=-in-the-middle!10,128 +(define =starts-with-equals! =starts-with-equals!12,171 +(define (((((curry-test 14,205 +(define-syntax test-begin17,265 + tex-src/testenv.tex,52 \newcommand{\nm}\nm4,77 \section{blah}blah8,139 diff --git a/test/manual/etags/ETAGS.good_5 b/test/manual/etags/ETAGS.good_5 index 2b431034f4..04912ecbfb 100644 --- a/test/manual/etags/ETAGS.good_5 +++ b/test/manual/etags/ETAGS.good_5 @@ -3253,10 +3253,11 @@ main(37,571 D(43,659 int x;44,694 -el-src/TAGTEST.EL,148 +el-src/TAGTEST.EL,179 (foo::defmumble bletch 1,0 -(defalias 'pending-delete-mode pending-delete-mode5,102 -(defalias (quote explicitly-quoted-pending-delete-mode)8,175 +(defun foo==bar foo==bar2,33 +(defalias 'pending-delete-mode pending-delete-mode6,149 +(defalias (quote explicitly-quoted-pending-delete-mode)9,222 el-src/emacs/lisp/progmodes/etags.el,5188 (defvar tags-file-name 34,1034 @@ -4279,6 +4280,15 @@ module A9,57 alias_method ( :foo2,foo237,586 A::Constant Constant42,655 +scm-src/test.scm,260 +(define hello 1,0 +(set! hello 3,32 +(define (hello-world)5,62 +(define (there-is-a-=-in-the-middle!)there-is-a-=-in-the-middle!10,128 +(define =starts-with-equals! =starts-with-equals!12,171 +(define (((((curry-test 14,205 +(define-syntax test-begin17,265 + tex-src/testenv.tex,52 \newcommand{\nm}\nm4,77 \section{blah}blah8,139 diff --git a/test/manual/etags/ETAGS.good_6 b/test/manual/etags/ETAGS.good_6 index 2cb0d05e72..b80e1dbb77 100644 --- a/test/manual/etags/ETAGS.good_6 +++ b/test/manual/etags/ETAGS.good_6 @@ -3253,10 +3253,11 @@ main(37,571 D(D::D43,659 int x;D::x44,694 -el-src/TAGTEST.EL,148 +el-src/TAGTEST.EL,179 (foo::defmumble bletch 1,0 -(defalias 'pending-delete-mode pending-delete-mode5,102 -(defalias (quote explicitly-quoted-pending-delete-mode)8,175 +(defun foo==bar foo==bar2,33 +(defalias 'pending-delete-mode pending-delete-mode6,149 +(defalias (quote explicitly-quoted-pending-delete-mode)9,222 el-src/emacs/lisp/progmodes/etags.el,5188 (defvar tags-file-name 34,1034 @@ -4279,6 +4280,15 @@ module A9,57 alias_method ( :foo2,foo237,586 A::Constant Constant42,655 +scm-src/test.scm,260 +(define hello 1,0 +(set! hello 3,32 +(define (hello-world)5,62 +(define (there-is-a-=-in-the-middle!)there-is-a-=-in-the-middle!10,128 +(define =starts-with-equals! =starts-with-equals!12,171 +(define (((((curry-test 14,205 +(define-syntax test-begin17,265 + tex-src/testenv.tex,52 \newcommand{\nm}\nm4,77 \section{blah}blah8,139 diff --git a/test/manual/etags/Makefile b/test/manual/etags/Makefile index 07ad0f4641..c1df703905 100644 --- a/test/manual/etags/Makefile +++ b/test/manual/etags/Makefile @@ -25,12 +25,13 @@ PSSRC= PROLSRC=$(addprefix ./prol-src/,ordsets.prolog natded.prolog) PYTSRC=$(addprefix ./pyt-src/,server.py) RBSRC=$(addprefix ./ruby-src/,test.rb test1.ru) +SCMSRC=$(addprefix ./scm-src/,test.scm) TEXSRC=$(addprefix ./tex-src/,testenv.tex gzip.texi texinfo.tex nonewline.tex) YSRC=$(addprefix ./y-src/,parse.y parse.c atest.y cccp.c cccp.y) SRCS=${ADASRC} ${ASRC} ${CSRC} ${CPSRC} ${ELSRC} ${ERLSRC} ${FSRC}\ ${FORTHSRC} ${GOSRC} ${HTMLSRC} ${JAVASRC} ${LUASRC} ${MAKESRC}\ ${OBJCSRC} ${OBJCPPSRC} ${PASSRC} ${PHPSRC} ${PERLSRC} ${PSSRC}\ - ${PROLSRC} ${PYTSRC} ${RBSRC} ${TEXSRC} ${YSRC} + ${PROLSRC} ${PYTSRC} ${RBSRC} ${SCMSRC} ${TEXSRC} ${YSRC} NONSRCS=./f-src/entry.strange ./erl-src/lists.erl ./cp-src/clheir.hpp.gz ETAGS_PROG=../../../lib-src/etags diff --git a/test/manual/etags/el-src/TAGTEST.EL b/test/manual/etags/el-src/TAGTEST.EL index acf0baf82f..89a6791377 100644 --- a/test/manual/etags/el-src/TAGTEST.EL +++ b/test/manual/etags/el-src/TAGTEST.EL @@ -1,4 +1,5 @@ (foo::defmumble bletch beuarghh) +(defun foo==bar () (message "hi")) ; Bug#5624 ;;; Ctags test file for lisp mode. ;; from emacs/lisp/delsel.el:76: diff --git a/test/manual/etags/scm-src/test.scm b/test/manual/etags/scm-src/test.scm new file mode 100644 index 0000000000..e3921e718f --- /dev/null +++ b/test/manual/etags/scm-src/test.scm @@ -0,0 +1,20 @@ +(define hello "Hello, Emacs!") + +(set! hello "Hello, world!") + +(define (hello-world) + (display hello) + (newline)) + +;; Bug 5624 +(define (there-is-a-=-in-the-middle!) #t) + +(define =starts-with-equals! #t) + +(define (((((curry-test a) b) c) d) e) + (list a b c d e)) + +(define-syntax test-begin + (syntax-rules () + ((test-begin exp ...) + ((lambda () exp ...))))) -- 2.11.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 08 04:28:22 2017 Received: (at 5624-done) by debbugs.gnu.org; 8 Jul 2017 08:28:22 +0000 Received: from localhost ([127.0.0.1]:57281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dTl6E-0004ha-Jn for submit@debbugs.gnu.org; Sat, 08 Jul 2017 04:28:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dTl6C-0004hN-UO for 5624-done@debbugs.gnu.org; Sat, 08 Jul 2017 04:28:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dTl64-00060L-Hh for 5624-done@debbugs.gnu.org; Sat, 08 Jul 2017 04:28:15 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37537) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dTl64-0005zw-Dj; Sat, 08 Jul 2017 04:28:12 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1620 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dTl63-0003TU-Jz; Sat, 08 Jul 2017 04:28:12 -0400 Date: Sat, 08 Jul 2017 11:28:02 +0300 Message-Id: <83fue7l4dp.fsf@gnu.org> From: Eli Zaretskii To: Alex In-reply-to: <877f0erzj6.fsf@lylat> (message from Alex on Wed, 14 Jun 2017 16:10:37 -0600) Subject: Re: bug#5624: 23.1; etags elisp and scheme "=" in names References: <87eikcrkg8.fsf@blah.blah> <878tkztic2.fsf@gmail.com> <83poea60fz.fsf@gnu.org> <87shj553hu.fsf@gmail.com> <83fuf55m6a.fsf@gnu.org> <87mv9c36mq.fsf@gmail.com> <83lgow3qsc.fsf@gnu.org> <877f0erzj6.fsf@lylat> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 5624-done Cc: 5624-done@debbugs.gnu.org, user42@zip.com.au X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Alex > Cc: user42@zip.com.au, 5624@debbugs.gnu.org > Date: Wed, 14 Jun 2017 16:10:37 -0600 > > Eli Zaretskii writes: > > >> From: Alex > >> Cc: user42@zip.com.au, 5624@debbugs.gnu.org > >> Date: Mon, 12 Jun 2017 21:31:57 -0600 > >> > >> > 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. > > > > Thanks. This looks OK to me, but please also add a test for this > > problem, and make sure the previous tests still succeed. (The etags > > test suite is in test/manual/etags/.) > > > >> +/* 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); > >> +} > > > > It looks like none of the callers uses a non-NULL 2nd arg, so perhaps > > just remove it, and its supporting code. > > Alright, I did both. Thanks, pushed to master. Sorry for such a long delay in pushing. From unknown Thu Aug 21 14:11:47 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 05 Aug 2017 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator