From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: fabrice nicol Newsgroups: gmane.emacs.bugs Subject: bug#47408: Etags support for Mercury -- fix explicit tags for existentially-quantified procedures Date: Thu, 10 Jun 2021 22:39:29 +0200 Message-ID: References: <70503251-f8ea-9006-b7e7-b13b93bb71de@gmail.com> <838s4gxurw.fsf@gnu.org> <53162dfb-0715-3077-78d1-3a8340943f2f@gmail.com> <838s3y6kaq.fsf@gnu.org> <83k0n7iarj.fsf@gnu.org> <65f059b1-149d-146d-3b8d-36db60ff1044@gmail.com> <87o8cin9fb.fsf@tucano.isti.cnr.it> <39f683d3-65d7-a7d9-18b1-cf6dfa7d254a@gmail.com> <83fsxthnye.fsf@gnu.org> <87lf7kmxuk.fsf@tucano.isti.cnr.it> <83bl8gfuhy.fsf@gnu.org> <87k0n4msku.fsf@tucano.isti.cnr.it> <834ke5ddnb.fsf@gnu.org> <83h7i5bpqq.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27329"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 Cc: 47408@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 10 22:39:09 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lrRSG-0006x2-OK for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Jun 2021 22:39:08 +0200 Original-Received: from localhost ([::1]:49810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lrRSF-0003eK-Py for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Jun 2021 16:39:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lrRSA-0003c4-0t for bug-gnu-emacs@gnu.org; Thu, 10 Jun 2021 16:39:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54461) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lrRS9-00068W-P4 for bug-gnu-emacs@gnu.org; Thu, 10 Jun 2021 16:39:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lrRS9-0002c4-Oj for bug-gnu-emacs@gnu.org; Thu, 10 Jun 2021 16:39:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: fabrice nicol Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Jun 2021 20:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47408 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 47408-submit@debbugs.gnu.org id=B47408.162335751410008 (code B ref 47408); Thu, 10 Jun 2021 20:39:01 +0000 Original-Received: (at 47408) by debbugs.gnu.org; 10 Jun 2021 20:38:34 +0000 Original-Received: from localhost ([127.0.0.1]:37774 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lrRRh-0002bM-T5 for submit@debbugs.gnu.org; Thu, 10 Jun 2021 16:38:34 -0400 Original-Received: from mail-wm1-f45.google.com ([209.85.128.45]:44836) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lrRRg-0002b9-0c for 47408@debbugs.gnu.org; Thu, 10 Jun 2021 16:38:33 -0400 Original-Received: by mail-wm1-f45.google.com with SMTP id m41-20020a05600c3b29b02901b9e5d74f02so4120798wms.3 for <47408@debbugs.gnu.org>; Thu, 10 Jun 2021 13:38:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=zQo1DssVIrS3bkM+zExuApj56cpp8pCQQ2whOl7ONfU=; b=NeT8ljzhyWKlA04iFstKj/EXuKeWAYgq1+AuNVcbwF5E6+hikPyjtvJ4MeJs0Fi8gS ARz99Of+S/50OshoSOQMPQwVHzjBxhm6dgGHunQ0ZnTOz3AmTyUJfctkgkIFxl3bpCri 2/2xMwxcGCfGEg/FDdgnesapsjWaYgvdBjnvk/rlxBUjadiwuSnusAUgFAV1m8AtuurE 2iShYd7137Mr6yxnyHJrWV9TXnfLTYQ0XGx1uCb96jyF5+63obfrYQokh+9qqRwZKwsm x8SRFCHKbQ4oyUzoXW2g/N2DLSaNeWYoDfQLw2cqDwwWgLKUd+gLW7plGz8pi1QT9Df9 pH5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=zQo1DssVIrS3bkM+zExuApj56cpp8pCQQ2whOl7ONfU=; b=MN1jXEU/Mm7cSozqrKR/qdjiLeN8GOCarexJuXY4bPfh8nnyCnvR82bNlMQ863ly4t IysEWKWFV1CvJBWFrJ8Xb342vOogPPGNFMK+XtWuIa3SPugjLJAwU/ywbyFvbu4Pr/Lu m2xHUeOOHDE7cqJtyaXv7/vt+ONdG8liHLcx9LwGODtgh2x11UhZK3I+8/HRX9nPMYL4 cBdY9zEk1Icl1m+jKvL5YyoA0l5nvZJG4ZdpKtFtWYjvyuqv4qouK97Mj7jiUrhWZUCu DlJ7mvdjt+ZmZ+H1AVe96rVwJXc8o9hJZl5NHiWrbxUQzDB8gTuX7PmTwdnm+xFFJaYa SutA== X-Gm-Message-State: AOAM532wWY2wFsB+uIAJ06QU8+QeSA27PEkZVpha90dlGAqR+WQeBXCh 4n3qdVPG/dM5RpofvysVy1PBNCXTlFU= X-Google-Smtp-Source: ABdhPJx/kv766yy/gh0EfUe5RV+TmLmIP4Mh88mQROWOeDPJRiVDAQkYb0NvoreMpO8FA3YIGjj4nw== X-Received: by 2002:a05:600c:358b:: with SMTP id p11mr639713wmq.112.1623357505852; Thu, 10 Jun 2021 13:38:25 -0700 (PDT) Original-Received: from ?IPv6:2a01:cb1d:88b9:5c00:7b73:7901:965e:8523? ([2a01:cb1d:88b9:5c00:7b73:7901:965e:8523]) by smtp.gmail.com with ESMTPSA id l20sm3802957wmq.3.2021.06.10.13.38.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Jun 2021 13:38:25 -0700 (PDT) In-Reply-To: <83h7i5bpqq.fsf@gnu.org> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:208336 Archived-At: Hi Eli, >> your latest fix for Mercury 'etags' support has introduced a regression >> for existentially quantified predicates. > Is it a "regression" in the sense that "M-." no longer finds the > definitions? Exactly. M-.  no longer finds the definition for existentially-quantified predicates (or functions), so this is a regression strictly speaking. Prior code did not abide by pfnote input constraints, but it "just worked" in all cases, at least for 'etags' invocation. >> These predicates have the following (somewhat simplified) syntax (in >> extended regexp  form, \s for white space): >> >> :-[:blank:]+some[:blank:]*\[[:blank:]*T(,[:blank:]*[:upper:]{1})*[:blank:]*\][:blank:]+pred[:blank:]+([:lower:]+([:alnum:]|[:punct:])*)+[:blank:]*\([^()]+\)([:blank:]|[:lower:])*\. >> >> Example: >> >> :- some [T] pred unravel_univ(univ::in, T::out) is det. >> >> Your fix incorrectly outputs such quantified predicates. For example on >> tagging univ.m (attached), your commit version yields: >> >> >> :- some [T] pred unravel_univ(^?[T] pred unravel_univ^A141,4333 >> >> >> whilst my original code yields the correct tag: >> >> >> :- some [T] pred unravel_univ(^?141,4333 > Why do you think the current result is incorrect, while the previous > result was correct? The previous code issued TAGS file that were correctly parsed by 'etags' and so M-. / M-, "just worked" in all cases. The new code introduces such chunks as "[T] pred " at the beginning of explicit tags, which looks wrong and is likely to be the reason why these explicit tags are not parsed, hence useless. > > The original code was incorrect, so it doesn't sound right to me to > revert to it. I will work on fixing the cases you described (unless > you beat me to it). > > Thanks for turning my attention to this issue. I will not be able to spare enough free time to implement explicit tag parsing for existential predicates before a couple of weeks, so in the meantime, it would be safer to revert to original code and just flag/blame it as 'to-be-fixed for ctags by FN.' As I explained in prior mail, this is anyway a use case in which 'ctags' is not useful at all, whilst 'etags' is. Fabrice