From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Adding support for xref jumping to headers/interfaces Date: Wed, 8 Mar 2023 20:23:21 +0200 Message-ID: <4639d7ca-2109-864c-33c0-38e65f26f262@yandex.ru> References: <83bklin83z.fsf@gnu.org> <865ybmu2ha.fsf@stephe-leake.org> <39e25c9a-b4cc-a0ce-3f2a-1d2a1fc243d0@yandex.ru> <83pm9sfxfa.fsf@gnu.org> <861qm4tkih.fsf@stephe-leake.org> <71ea5e83-183f-2ae3-8146-6a31045a0309@yandex.ru> <834jqzafse.fsf@gnu.org> <83h6uv47e8.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="1651"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Cc: stephen_leake@stephe-leake.org, john@yates-sheets.org, rms@gnu.org, fgunbin@fastmail.fm, casouri@gmail.com, sbaugh@janestreet.com, emacs-devel@gnu.org, azeng@janestreet.com To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Mar 08 19:24:20 2023 Return-path: Envelope-to: ged-emacs-devel@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 1pZySZ-0000BY-Al for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Mar 2023 19:24:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZyRn-0007kp-0h; Wed, 08 Mar 2023 13:23:31 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZyRl-0007kh-CG for emacs-devel@gnu.org; Wed, 08 Mar 2023 13:23:29 -0500 Original-Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZyRj-0002ZC-6Y; Wed, 08 Mar 2023 13:23:29 -0500 Original-Received: by mail-ed1-x532.google.com with SMTP id u9so69477099edd.2; Wed, 08 Mar 2023 10:23:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678299805; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=rDmf8H/V8H4xY+zO/p7NwRc5AT2Wr1hzWGWrPtb4J0s=; b=A4AmyAxci4Oc+TFQQy9tk+yvjhEdEVjULbqkB3m7qq9iD2LBjEN4HwOkLFf9qDkUu1 0Zjtuc4ZQIRYFoL5QCU0LmNpaqY0aGBuCCTB/sxSvvqIFpiTi/jebOcAoQtLErSBItqP Cul7eiBSZSnS8DPoUq8lVnpwGXJG4QHXioyBWvxQ0aM5q3Ob4rZHDfNWME6J+JFuDwHM BLq/920uH1JvyVMRJDyHccQmXZFb9CMEeYVCzlkrb6Rk9Lca9/OsScDqyrsxkplFlg0d LvTIXDdINJ/w8teAheE5kkuHdNd7erbEkrPytRWHPuyO9E5JjPaeXPWPcWqaQ6J1DE93 qMXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678299805; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=rDmf8H/V8H4xY+zO/p7NwRc5AT2Wr1hzWGWrPtb4J0s=; b=wqwn7xFyHm4VRjfnJ+82Tj6a1M+dbG3yWIVSKUBRAwvCS0iCvysVg6fFCyC8wN03or Ov2rWWsTQ+7gWtQBQ6kVSOpu3F1V21+QoVqBkw26RLpQ3mMhAewfdMCzF8KSkTIF+Z27 Q0QUN8E9WgokqbOZ28VOPJvGyUNV2ueQk36wnoE2Vp9KaVYnSCrcBlqIlamumYlktfcc 1HCk/Jd5LVKkfqBdQzlkNFu3BxpL0CsQicni4Nf4imsae5SmMD+hD+59oW3b3SaWnCPp JPfYwbkJXU/7OGQOv/FAtblH9Ib7nzyBNTtE9xBQErvQxLaW7iOSv1/OLxm6GVTVI/fV Dang== X-Gm-Message-State: AO0yUKV26yb8dzW13uHCwxQYjgN0s4Mt0cBrhlfzBchaOmny91OKuB8D gbFhJ6dVBXvMW881CJ25M36ZdjWjji0= X-Google-Smtp-Source: AK7set9iqdICwT8gNLd1xdlMdlUDEpYwM8pWJHCO/4ulDWNedVZBRQS2axtXnjTR7E72fsrCGodb/A== X-Received: by 2002:a05:6402:7d7:b0:4de:51b7:4a59 with SMTP id u23-20020a05640207d700b004de51b74a59mr13376009edy.0.1678299804915; Wed, 08 Mar 2023 10:23:24 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id q10-20020a50c34a000000b004bda465da32sm8587127edb.1.2023.03.08.10.23.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Mar 2023 10:23:24 -0800 (PST) Content-Language: en-US In-Reply-To: <83h6uv47e8.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=raaahh@gmail.com; helo=mail-ed1-x532.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304149 Archived-At: On 08/03/2023 16:58, Eli Zaretskii wrote: >> Date: Wed, 8 Mar 2023 00:41:49 +0200 >> From: Dmitry Gutov >> Cc:stephen_leake@stephe-leake.org,john@yates-sheets.org,rms@gnu.org, >> fgunbin@fastmail.fm,casouri@gmail.com,sbaugh@janestreet.com, >> emacs-devel@gnu.org,azeng@janestreet.com >> >> After 'sudo apt install universal-ctags', I can see this: >> >> $ ctags --list-kinds=c >> d macro definitions >> e enumerators (values inside an enumeration) >> f function definitions >> g enumeration names >> h included header files >> l local variables [off] >> m struct, and union members >> p function prototypes [off] >> s structure names >> t typedefs >> u union names >> v variable definitions >> x external and forward variable declarations [off] >> z function parameters inside function or prototype definitions [off] >> L goto labels [off] >> D parameters inside macro definitions [off] >> >> That seems to mean that it can distinguish "function prototypes" and >> "forward variable declarations", although their scanning seems to be >> disabled by default (can be toggled via --kinds-c=+p+x). >> >> So I suppose the question here is how hard it would be to add to >> existing etags parsers something like that, and whether we can extend >> the TAGS format in a backward compatible way with this info. > How do you envision a backward-compatible extension of TAGS format to > support such flags? AFAIK, TAGS doesn't distinguish between the tags > by their kind, it just records all of them, and leaves the semantics > to the program which reads them. The current format of TAGS is > described in etc/ETAGS.EBNF, in case you didn't know. etags-snarf-tag doesn't seem to call (line-end-position), at least not in the latest version. So we can probably add DEL kind to the end of both directtag and patterntag. At least, if I just add "^?f" to the end of a random line, (etags-snarf-tag) still returns the same value right now.