From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#67523: check-declare doesn't account for shorthands Date: Wed, 29 Nov 2023 09:56:32 +0000 Message-ID: References: <87o7fcgbyx.fsf@ushin.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37818"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67523@debbugs.gnu.org, Adam Porter , Jonas Bernoulli To: Joseph Turner Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 29 10:58:11 2023 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 1r8HKb-0009dw-5A for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Nov 2023 10:58:09 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r8HKQ-0004vs-UA; Wed, 29 Nov 2023 04:57:58 -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 1r8HKN-0004ue-Jd for bug-gnu-emacs@gnu.org; Wed, 29 Nov 2023 04:57:55 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r8HKM-0001SU-6z for bug-gnu-emacs@gnu.org; Wed, 29 Nov 2023 04:57:54 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r8HKT-0001Fe-J2 for bug-gnu-emacs@gnu.org; Wed, 29 Nov 2023 04:58:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Nov 2023 09:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67523 X-GNU-PR-Package: emacs Original-Received: via spool by 67523-submit@debbugs.gnu.org id=B67523.17012518224726 (code B ref 67523); Wed, 29 Nov 2023 09:58:01 +0000 Original-Received: (at 67523) by debbugs.gnu.org; 29 Nov 2023 09:57:02 +0000 Original-Received: from localhost ([127.0.0.1]:48923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r8HJV-0001E2-Qw for submit@debbugs.gnu.org; Wed, 29 Nov 2023 04:57:02 -0500 Original-Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]:54522) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r8HJS-0001Di-N9 for 67523@debbugs.gnu.org; Wed, 29 Nov 2023 04:56:59 -0500 Original-Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-50bc21821a1so1473947e87.0 for <67523@debbugs.gnu.org>; Wed, 29 Nov 2023 01:56:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701251805; x=1701856605; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=5paSbJE2YwDBrWUB2qbqeni5mVihNnbcgiLgzX3udsc=; b=h+6Wr11vtldTzixVM8hzFevQWIh44jaxKplLR43dqR1WcKFWX5f3pYz1IjeB2zZegI HXc1oo++zQEP+w8XTCkbt8OWkj/PgkldelcLbAM9ghTLOkltTSGpWrYdZ5q3GLTXAcWj Uw9O/ME1itBWCFjRDaQW/sOoqwJtDs7l+of46/1A1hkZTKILcfPMXx+ghtPq0RYHFVkn A788884hbEd1miBxCEptpoawfzxBiju1EJAMySkzi4EvLms4p/IeHMdwb1n6vjYru85L J9awPtale50XdqUCT0p8gZTpQWq3TRIQdusOdv6VZpaL3ygL8ZQlsimXF1Ne8FPc0PI1 UH7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701251805; x=1701856605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5paSbJE2YwDBrWUB2qbqeni5mVihNnbcgiLgzX3udsc=; b=FSY0qtOuwPS356zMDbEDdeIRlecZGH6WgcqVDXMIi1klWhA5XLk1WZ5KVP7TCB/rIK 1tkHLNOQUC7Edw6JS5uPlcOcEbSw7lGJmzVLD+OU9I0/H3uzOHwQ9Kqnx+ZbtAUpDFfk FuaHsCwJ+2T5xTDU9DEZHnJC6xkOvjDqk8hXyjHWPrR2rvWhwgF8QAfXNAUvZArA89VY ZeeSKb2hIjfDJ3PCaQZTROxxIuNnsUZnfV84oNNiLbwlc/6QOhDdG5iFndva5kt0MxJP KpUyZekz7ESswnzSVUGeGrL7RrZCPfNzeTB6NIuP41d+Yik/UNeSTPb4+VGp6RJRaCJm xELA== X-Gm-Message-State: AOJu0YymLJ5rIt47dZg6Wx9JwiEQs9/wGoz3jMwAXECkufJN3yVS++Yb SNMcbjBooVvQ8Onb+SgW8/ffiWAUakNKOLdDBZg= X-Google-Smtp-Source: AGHT+IF2NU3SIhttUhzx/C98Ho6CC2UUdtpjcKgK28UHsFGPW1U0B5oCg0PS01FigbweAHTmkG6FOxCD5GiWNkKZTmk= X-Received: by 2002:a05:6512:280d:b0:500:ac10:1641 with SMTP id cf13-20020a056512280d00b00500ac101641mr10650970lfb.46.1701251805072; Wed, 29 Nov 2023 01:56:45 -0800 (PST) In-Reply-To: <87o7fcgbyx.fsf@ushin.org> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275208 Archived-At: On Wed, Nov 29, 2023 at 9:12=E2=80=AFAM Joseph Turner wr= ote: > A potential solution could be to convert the longhand symbol into its > shorthand form and pass that into re-search-forward. This is tricky > since there may be multiple different shorthands which could yield the > same longhand form. It might be more feasible to run re-search-forward > on a known common suffix portion of the symbol name, then with point on > the suspected definition, run `intern-soft' to get the full symbol name. No, this is brittle. Check-declare, if it's to be useful (is it?) is probably meant to be as precise as possible. > A workaround is to not use shorthands in function definitions. That's letting the bad guys win :-) > Thoughts? As usual, my thoughts are that tools that read Lisp code should use the Lisp reader, not regular expressions. Here, check-declare should just walk the whole file. When it finds a a symbol atom that matches a definition form, look in the next atom and check if it matches the probe. If you don't want to intern all the symbols in the you can read to a separate obarray I think. Jo=C3=A3o