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#67325: shorthands: Incorrect autoloaded register-definition-prefixes Date: Fri, 24 Nov 2023 09:24:01 +0000 Message-ID: References: <87zfz8i4ac.fsf@ushin.org> <83a5r3fucu.fsf@gnu.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="35027"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Joseph Turner , 67325@debbugs.gnu.org, jonas@bernoul.li, public@protesilaos.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 24 10:25:21 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 1r6SR7-0008wV-Fq for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Nov 2023 10:25:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r6SQm-0002Bh-Hb; Fri, 24 Nov 2023 04:25:00 -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 1r6SQk-0002BL-CV for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2023 04:24:58 -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 1r6SQk-0007iv-4d for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2023 04:24:58 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r6SQo-0003Qh-Fa for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2023 04:25:02 -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: Fri, 24 Nov 2023 09:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67325 X-GNU-PR-Package: emacs Original-Received: via spool by 67325-submit@debbugs.gnu.org id=B67325.170081786713129 (code B ref 67325); Fri, 24 Nov 2023 09:25:02 +0000 Original-Received: (at 67325) by debbugs.gnu.org; 24 Nov 2023 09:24:27 +0000 Original-Received: from localhost ([127.0.0.1]:35612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6SQF-0003Pg-A0 for submit@debbugs.gnu.org; Fri, 24 Nov 2023 04:24:27 -0500 Original-Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]:57790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r6SQD-0003PS-CK for 67325@debbugs.gnu.org; Fri, 24 Nov 2023 04:24:26 -0500 Original-Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-50aab3bf71fso2208051e87.3 for <67325@debbugs.gnu.org>; Fri, 24 Nov 2023 01:24:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700817854; x=1701422654; 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=WljabbWRFG6p4CXfz0rFs7MHwAWLQoenLmL5IhIIBY0=; b=adKvb2AAA4V8W7HR+5U2t0x1cMhtpy99HWo4sf3d2Xq6y67Mm9ktuugTcmg1Ky+LyW IplIb0F93Sxk/u6aLQ4hVwey8K008rFG0L/U/20XRQUL8IYDHvKMLUretQJFLpQZR1hk /VpAsjBlpLFuicTaPaqLUODR++kUTRnsyd56RN7AdrxeDNvaIIP9ZtlKEcMoPsC6nKFh 8Cv4nsbnyxXDFniuk9NVxi2pvo74jDTtMH0UokhkhgXPqUCiLQD1kwIHSlsMG94BFuRm DAdC/FGgy0VpTA8ObvWzEmhMuuQjiCrPWcKJJSFEWZ3BRC7q+0zQnjdCoj5Wufm5/QmN rHFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700817854; x=1701422654; 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=WljabbWRFG6p4CXfz0rFs7MHwAWLQoenLmL5IhIIBY0=; b=sKmzwyoDbSzHBoDv5ljqPD31ykOqP5z1r5Q0mRkzFtPqngn7IrUPCOuciAwVMUTGx3 QOp4S1Kfz7mZ3HcCPaCwyIbfm0Ww/vrqczKnbPzDfIRE5Q/WvQz+3ALK4JASHg5v4yO5 0MXeElexVsutHZ5ii5bz10P+oHjnswFR+KcQQdT56ykVU0bvBvPViIIy9P+vNqizwabN oS6EyqO5pvcXTdbHjoed6AX6CUYGmAnXCFvvV6Hb/J+2/TpP2O0fOFWhwCOJpHldCUvV f/5OUETbmh3BiH512r69Le+XI/gyQlDbMBj9GAqQYu8WbVD2vk1Rt742PcgcrbXZCNAy EEzg== X-Gm-Message-State: AOJu0YyXrWEo49f5f/NLS7Q1vq6EzOzXih4Q1Mg6QDdihYePGhr0V5MO TLkw6EtUhQ34s8PqKT2ZwSCVxlU9bSn2Mk8KwR8= X-Google-Smtp-Source: AGHT+IGV7FCSSi5i5y06oPH5gZqSvyAULOk4Ov3UgoJQmWsjzuz9PPRaFkRnL2jBW7AHUxQtWwwjl4buiCWiWEcTd4Q= X-Received: by 2002:a05:6512:3694:b0:50a:7640:6a83 with SMTP id d20-20020a056512369400b0050a76406a83mr1291964lfs.32.1700817854335; Fri, 24 Nov 2023 01:24:14 -0800 (PST) In-Reply-To: <83a5r3fucu.fsf@gnu.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:274850 Archived-At: On Fri, Nov 24, 2023 at 8:06=E2=80=AFAM Eli Zaretskii wrote: > > > Cc: Protesilaos Stavrou , > > Jonas Bernoulli , > > Jo=C3=A3o T=C3=A1vora > > Date: Mon, 20 Nov 2023 11:50:50 -0800 > > From: Joseph Turner via "Bug reports for GNU Emacs, > > the Swiss army knife of text editors" > > > > When using shorthands.el, autoload generation inserts a call to > > register-definition-prefixes with the shorthand prefix, instead of the > > translated print name prefix. For example, breadcrumb-autoloads.el > > contains the line: > > > > (register-definition-prefixes "breadcrumb" '("bc-")) > > > > instead of > > > > (register-definition-prefixes "breadcrumb" '("breadcrumb-")) > > > > This PR attempts to resolve this issue in breadcrumb.el by adding the > > correct autoload line at the bottom of the file: > > > > https://github.com/joaotavora/breadcrumb/pull/24 > > > > What needs to be done in core Emacs to fix autoload generation with > > shorthands.el? > > > > Also see bug#63480. > > Jo=C3=A3o, any comments? Yes. Well first, we are talking about an imperfect heuristic here which lives in lisp/emacs-lisp/loaddefs-gen.el. That's where the definition prefixes for a given file are collected and the common prefix is guessed, leading to the generation of the register-definition-prefixes form. The logic seems to have a number of exceptions and corner cases baked into it already, and there seems to be even a specific kill-switch for this particular register-definition-prefixes form: ;; Local Variables: ;; autoload-compute-prefixes: nil ;; End: This form should probably be added to breadcrumb.el so that the autoload mechanism would stop trying to guess the prefix using its current flawed methods. I've already asked the submitters of the pull request to do so at the Breadcrumb upstream. BTW. Grepping for autoload-compute-prefixes seems to indicate it is totally undocumented. It's not even a defvar, just an autoload-specific cookies. This is fine, but I guess it should still be documented somewhere. OK so that solves the problem for breadcrumb.el and other such shorthand-using packages such as beardbolt.el and others I see popping up. But maybe this issue can still be kept open. It shouldn't be terribly hard to add a fix to loaddefs-generate--compute-prefixes or loaddefs-generate--make-prefixes that takes shorthands in consideration. In fact, the presence of a shorthand might be a more reliable indicator of the package's intended "external" prefix than any of the current heuristics. > > Also see bug#63480. What about it? What's the relation to this bug? Jo=C3=A3o