GNU bug report logs - #63480
30.0.50; [BUG] unimplemented logic regarding read-symbol-shorthands

Previous Next

Package: emacs;

Reported by: Ruijie Yu <ruijie <at> netyu.xyz>

Date: Sat, 13 May 2023 05:28:01 UTC

Severity: normal

Found in version 30.0.50

Done: Joseph Turner <joseph <at> breatheoutbreathe.in>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 63480 in the body.
You can then email your comments to 63480 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#63480; Package emacs. (Sat, 13 May 2023 05:28:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ruijie Yu <ruijie <at> netyu.xyz>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 13 May 2023 05:28:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ruijie Yu <ruijie <at> netyu.xyz>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; [BUG] unimplemented logic regarding read-symbol-shorthands
Date: Sat, 13 May 2023 13:27:06 +0800
--8<---------------cut here---------------start------------->8---
In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.37, cairo version 1.17.8) of 2023-05-06 built on ruijie
Repository revision: f261226d9be4630572df322b2c4f48713c9c2fce
Repository branch: makepkg
System Description: Arch Linux
--8<---------------cut here---------------end--------------->8---

Hello,

While trying out João's breadcrumb package, I noticed a few issues
regarding `read-symbol-shorthands'.  Searching this variable on debbugs
yields zero results, so I figured maybe I should at least let the
bugtracker know about them.

First, docstrings do not resolve shorthands at the moment.  [Not the
main point of this thread.  If we are interested in changing that
behavior, we can discuss it in a new thread.]

Second, autoload generation, at least the portion responsible for
`package-vc-install', does not seem to translate the shorthands.

What I did:

    ;; ~15-days-old master
    $ emacs -Q -nw

    M-x load-lib package-vc RET

    M-: (package-vc-install '(breadcrumb
        :url "https://github.com/joaotavora/breadcrumb"
        :rev "e508856a59d18a0d006e215497b5190b3b517791")) RET

    M-x find-lib breadcrumb-autoloads.el RET

Note these portions in breadcrumb.el:

--8<---------------cut here---------------start------------->8---
;;;###autoload
(defun bc-imenu-crumbs ()
  "Describe point inside the Imenu tree of current file."
  ...)

...

;; Local Variables:
;; read-symbol-shorthands: (("bc-" . "breadcrumb-"))
;; End:
--8<---------------cut here---------------end--------------->8---

What I noticed from the generated autoloads file,
breadcrumb-autoloads.el:

--8<---------------cut here---------------start------------->8---
;;; Generated autoloads from breadcrumb.el

(autoload 'bc-imenu-crumbs "breadcrumb" "\
Describe point inside the Imenu tree of current file.")
...
--8<---------------cut here---------------end--------------->8---

The first argument to `autoload' here should probably be translated to
the full name `breadcrumb-imenu-crumbs', and likewise elsewhere.

-- 
Best,


RY




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63480; Package emacs. (Sat, 13 May 2023 05:38:01 GMT) Full text and rfc822 format available.

Message #8 received at 63480 <at> debbugs.gnu.org (full text, mbox):

From: Ruijie Yu <ruijie <at> netyu.xyz>
To: 63480 <at> debbugs.gnu.org
Subject: Re: bug#63480: 30.0.50; [BUG] unimplemented logic regarding
 read-symbol-shorthands
Date: Sat, 13 May 2023 13:37:37 +0800
Ruijie Yu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> writes:

> While trying out João's breadcrumb package, I noticed a few issues
> regarding `read-symbol-shorthands'.  Searching this variable on debbugs
> yields zero results, so I figured maybe I should at least let the
> bugtracker know about them.

Sorry, correction: I guess one cannot just search for keywords on
debbugs.  I searched on bug archive just now and found out that there
are 29 threads on this variable.

-- 
Best,


RY




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63480; Package emacs. (Wed, 06 Sep 2023 11:05:01 GMT) Full text and rfc822 format available.

Message #11 received at 63480 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Ruijie Yu <ruijie <at> netyu.xyz>
Cc: 63480 <at> debbugs.gnu.org,
 João Távora <joaotavora <at> gmail.com>
Subject: Re: bug#63480: 30.0.50;
 [BUG] unimplemented logic regarding read-symbol-shorthands
Date: Wed, 6 Sep 2023 04:03:58 -0700
João, could you take a look at the below bug?

It seems to be related to the shorthands feature, and your package
breadcrumb.

Ruijie Yu <ruijie <at> netyu.xyz> writes:

> In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
>  3.24.37, cairo version 1.17.8) of 2023-05-06 built on ruijie
> Repository revision: f261226d9be4630572df322b2c4f48713c9c2fce
> Repository branch: makepkg
> System Description: Arch Linux
>
>
> Hello,
>
> While trying out João's breadcrumb package, I noticed a few issues
> regarding `read-symbol-shorthands'.  Searching this variable on debbugs
> yields zero results, so I figured maybe I should at least let the
> bugtracker know about them.
>
> First, docstrings do not resolve shorthands at the moment.  [Not the
> main point of this thread.  If we are interested in changing that
> behavior, we can discuss it in a new thread.]
>
> Second, autoload generation, at least the portion responsible for
> `package-vc-install', does not seem to translate the shorthands.
>
> What I did:
>
>     ;; ~15-days-old master
>     $ emacs -Q -nw
>
>     M-x load-lib package-vc RET
>
>     M-: (package-vc-install '(breadcrumb
>         :url "https://github.com/joaotavora/breadcrumb"
>         :rev "e508856a59d18a0d006e215497b5190b3b517791")) RET
>
>     M-x find-lib breadcrumb-autoloads.el RET
>
> Note these portions in breadcrumb.el:
>
> ;;;###autoload
> (defun bc-imenu-crumbs ()
>   "Describe point inside the Imenu tree of current file."
>   ...)
>
> ...
>
> ;; Local Variables:
> ;; read-symbol-shorthands: (("bc-" . "breadcrumb-"))
> ;; End:
>
>
> What I noticed from the generated autoloads file,
> breadcrumb-autoloads.el:
>
> ;;; Generated autoloads from breadcrumb.el
>
> (autoload 'bc-imenu-crumbs "breadcrumb" "\
> Describe point inside the Imenu tree of current file.")
> ...
>
> The first argument to `autoload' here should probably be translated to
> the full name `breadcrumb-imenu-crumbs', and likewise elsewhere.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63480; Package emacs. (Wed, 06 Sep 2023 14:03:02 GMT) Full text and rfc822 format available.

Message #14 received at 63480 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: Ruijie Yu <ruijie <at> netyu.xyz>, 63480 <at> debbugs.gnu.org
Subject: Re: bug#63480: 30.0.50;
 [BUG] unimplemented logic regarding read-symbol-shorthands
Date: Wed, 6 Sep 2023 15:02:31 +0100
[Message part 1 (text/plain, inline)]
On Wed, Sep 6, 2023, 12:03 Stefan Kangas <stefankangas <at> gmail.com> wrote:

> João, could you take a look at the below bug?
>
> It seems to be related to the shorthands feature, and your package
> breadcrumb.
>

The bug report for breadcrumb in itself is no longer relevant since that
code isn't there anymore.  This is a duplicate of

   https://github.com/joaotavora/breadcrumb/issues/3

which has already been solved.  I updated the autoloads to use
longhand versions already a couple of months ago.

I'll leave it to you if this issue can be closed or not.

Anyway, the problem with shorthands and autoloads remains.
The GitHub user 'dickmao' proposed a patch there, which I
didn't test, but I attach here.

My idea for an alternative patch would be for the "autoload
extractor" (which I'm not familiar with) to see the shorthand
autoload but place it in longhand form in the generated
autoloads file.  I don't have a patch for that idea,
unfortunately.

João
[Message part 2 (text/html, inline)]
[patch (1).txt (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63480; Package emacs. (Wed, 06 Sep 2023 20:18:01 GMT) Full text and rfc822 format available.

Message #17 received at 63480 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: João Távora <joaotavora <at> gmail.com>
Cc: Ruijie Yu <ruijie <at> netyu.xyz>, 63480 <at> debbugs.gnu.org
Subject: Re: bug#63480: 30.0.50;
 [BUG] unimplemented logic regarding read-symbol-shorthands
Date: Wed, 6 Sep 2023 13:17:29 -0700
João Távora <joaotavora <at> gmail.com> writes:

> This is a duplicate of
>
>    https://github.com/joaotavora/breadcrumb/issues/3
>
> which has already been solved.  I updated the autoloads to use
> longhand versions already a couple of months ago.

OK, thanks.

> I'll leave it to you if this issue can be closed or not.

I guess the issue here is what you describe below?  If so, I guess it
should remain open until it is fixed.

> Anyway, the problem with shorthands and autoloads remains.
> The GitHub user 'dickmao' proposed a patch there, which I
> didn't test, but I attach here.
>
> My idea for an alternative patch would be for the "autoload
> extractor" (which I'm not familiar with) to see the shorthand
> autoload but place it in longhand form in the generated
> autoloads file.  I don't have a patch for that idea,
> unfortunately.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63480; Package emacs. (Thu, 23 Nov 2023 21:42:01 GMT) Full text and rfc822 format available.

Message #20 received at 63480 <at> debbugs.gnu.org (full text, mbox):

From: Joseph Turner <joseph <at> breatheoutbreathe.in>
To: stefankangas <at> gmail.com
Cc: 63480 <at> debbugs.gnu.org, ruijie <at> netyu.xyz, joaotavora <at> gmail.com
Subject: bug#63480: 30.0.50; [BUG] unimplemented logic regarding
 read-symbol-shorthands
Date: Thu, 23 Nov 2023 13:38:52 -0800
Also see https://lists.gnu.org/archive/html/bug-gnu-emacs/2023-11/msg01151.html




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63480; Package emacs. (Wed, 29 Nov 2023 07:46:02 GMT) Full text and rfc822 format available.

Message #23 received at 63480 <at> debbugs.gnu.org (full text, mbox):

From: Joseph Turner <joseph <at> breatheoutbreathe.in>
To: stefankangas <at> gmail.com
Cc: 63480 <at> debbugs.gnu.org, ruijie <at> netyu.xyz, Jonas Bernoulli <jonas <at> bernoul.li>,
 joaotavora <at> gmail.com, Adam Porter <adam <at> alphapapa.net>
Subject: Re: bug#63480: 30.0.50; [BUG] unimplemented logic regarding
 read-symbol-shorthands
Date: Tue, 28 Nov 2023 23:45:18 -0800
From: Stefan Kangas <stefankangas <at> gmail.com>

> João Távora <joaotavora <at> gmail.com> writes:

> > This is a duplicate of
> >
> >    https://github.com/joaotavora/breadcrumb/issues/3
> >
> > which has already been solved.  I updated the autoloads to use
> > longhand versions already a couple of months ago.

> OK, thanks.

> > I'll leave it to you if this issue can be closed or not.

> I guess the issue here is what you describe below?  If so, I guess it
> should remain open until it is fixed.

> > Anyway, the problem with shorthands and autoloads remains.
> > The GitHub user 'dickmao' proposed a patch there, which I
> > didn't test, but I attach here.
> >
> > My idea for an alternative patch would be for the "autoload
> > extractor" (which I'm not familiar with) to see the shorthand
> > autoload but place it in longhand form in the generated
> > autoloads file.  I don't have a patch for that idea,
> > unfortunately.

This bug affects not only autoloaded function definitions, but any
autoloaded form.  For example, the following will not generate the
correct autoloads:

;;;###autoload
(with-eval-after-load 'optional-dependency
  (cl-pushnew 'sns-var optional-dependency-var))

Instead, you must expand the shorthand symbol into its full form:

;;;###autoload
(with-eval-after-load 'optional-dependency
  (cl-pushnew 'some-nice-string-utils-var optional-dependency-var))

For a real-world example, see

https://git.sr.ht/~ushin/hyperdrive.el/commit/48afc51ac22713f2c54f75a7ea3b5c6b0e12b53d

Thank you!

Joseph




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63480; Package emacs. (Wed, 29 Nov 2023 08:14:01 GMT) Full text and rfc822 format available.

Message #26 received at 63480 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Joseph Turner <joseph <at> breatheoutbreathe.in>
Cc: 63480 <at> debbugs.gnu.org, Ruijie Yu <ruijie <at> netyu.xyz>,
 Jonas Bernoulli <jonas <at> bernoul.li>, Stefan Kangas <stefankangas <at> gmail.com>,
 Adam Porter <adam <at> alphapapa.net>
Subject: Re: bug#63480: 30.0.50;
 [BUG] unimplemented logic regarding read-symbol-shorthands
Date: Wed, 29 Nov 2023 08:12:41 +0000
[Message part 1 (text/plain, inline)]
On Wed, Nov 29, 2023, 07:45 Joseph Turner <joseph <at> breatheoutbreathe.in>
wrote:

> :
>
> ;;;###autoload
> (with-eval-after-load 'optional-dependency
>   (cl-pushnew 'sns-var optional-dependency-var))
>
> Instead, you must expand the shorthand symbol into its full form:
>
> ;;;###autoload
> (with-eval-after-load 'optional-dependency
>   (cl-pushnew 'some-nice-string-utils-var optional-dependency-var))
>
> For a real-world example, see
>
>
> https://git.sr.ht/~ushin/hyperdrive.el/commit/48afc51ac22713f2c54f75a7ea3b5c6b0e12b53d


Thanks for the extra case. I think this merits a fix in the autoload
extractor, watch should become autoload aware. I'll try to look at it.

João

>
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63480; Package emacs. (Thu, 18 Apr 2024 20:03:06 GMT) Full text and rfc822 format available.

Message #29 received at 63480 <at> debbugs.gnu.org (full text, mbox):

From: Joseph Turner <joseph <at> breatheoutbreathe.in>
To: João Távora <joaotavora <at> gmail.com>
Cc: 63480 <at> debbugs.gnu.org, Ruijie Yu <ruijie <at> netyu.xyz>,
 Jonas Bernoulli <jonas <at> bernoul.li>, Stefan Kangas <stefankangas <at> gmail.com>,
 Adam Porter <adam <at> alphapapa.net>
Subject: Re: bug#63480: 30.0.50; [BUG] unimplemented logic regarding
 read-symbol-shorthands
Date: Thu, 18 Apr 2024 13:01:31 -0700
João Távora <joaotavora <at> gmail.com> writes:

> On Wed, Nov 29, 2023, 07:45 Joseph Turner <joseph <at> breatheoutbreathe.in> wrote:
>
>  :
>
>  ;;;###autoload
>  (with-eval-after-load 'optional-dependency
>    (cl-pushnew 'sns-var optional-dependency-var))
>
>  Instead, you must expand the shorthand symbol into its full form:
>
>  ;;;###autoload
>  (with-eval-after-load 'optional-dependency
>    (cl-pushnew 'some-nice-string-utils-var optional-dependency-var))
>
>  For a real-world example, see
>
>  https://git.sr.ht/~ushin/hyperdrive.el/commit/48afc51ac22713f2c54f75a7ea3b5c6b0e12b53d
>
> Thanks for the extra case. I think this merits a fix in the autoload extractor, watch should become autoload aware. I'll try to look at it.

I believe this bug was fixed in c52d17d91ad

Can we close this bug?

Thanks,

Joseph




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#63480; Package emacs. (Thu, 18 Apr 2024 20:26:03 GMT) Full text and rfc822 format available.

Message #32 received at 63480 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Joseph Turner <joseph <at> breatheoutbreathe.in>
Cc: 63480 <at> debbugs.gnu.org, Ruijie Yu <ruijie <at> netyu.xyz>,
 Jonas Bernoulli <jonas <at> bernoul.li>, Stefan Kangas <stefankangas <at> gmail.com>,
 Adam Porter <adam <at> alphapapa.net>
Subject: Re: bug#63480: 30.0.50;
 [BUG] unimplemented logic regarding read-symbol-shorthands
Date: Thu, 18 Apr 2024 21:24:48 +0100
On Thu, Apr 18, 2024 at 9:01 PM Joseph Turner
<joseph <at> breatheoutbreathe.in> wrote:
>
> João Távora <joaotavora <at> gmail.com> writes:
>
> > Thanks for the extra case. I think this merits a fix in the autoload extractor, watch should become autoload aware. I'll try to look at it.
>
> I believe this bug was fixed in c52d17d91ad
>
> Can we close this bug?

Fine by me, you're the one originally requesting all these bug fixes,
so if you confirm that everything's working correctly with your
extensive use of shorthands, we should close.

But I've been away from Emacs development for the last months (and
hope to be disconnecting myself more progressively) so I might not be
the best person to ask.

João




Reply sent to Joseph Turner <joseph <at> breatheoutbreathe.in>:
You have taken responsibility. (Thu, 18 Apr 2024 20:53:01 GMT) Full text and rfc822 format available.

Notification sent to Ruijie Yu <ruijie <at> netyu.xyz>:
bug acknowledged by developer. (Thu, 18 Apr 2024 20:53:01 GMT) Full text and rfc822 format available.

Message #37 received at 63480-done <at> debbugs.gnu.org (full text, mbox):

From: Joseph Turner <joseph <at> breatheoutbreathe.in>
To: João Távora <joaotavora <at> gmail.com>
Cc: 63480-done <at> debbugs.gnu.org, Ruijie Yu <ruijie <at> netyu.xyz>,
 Jonas Bernoulli <jonas <at> bernoul.li>, Stefan Kangas <stefankangas <at> gmail.com>,
 Adam Porter <adam <at> alphapapa.net>
Subject: Re: bug#63480: 30.0.50; [BUG] unimplemented logic regarding
 read-symbol-shorthands
Date: Thu, 18 Apr 2024 13:52:07 -0700
João Távora <joaotavora <at> gmail.com> writes:

> On Thu, Apr 18, 2024 at 9:01 PM Joseph Turner
> <joseph <at> breatheoutbreathe.in> wrote:
>>
>> João Távora <joaotavora <at> gmail.com> writes:
>>
>> > Thanks for the extra case. I think this merits a fix in the
>> > autoload extractor, watch should become autoload aware. I'll try
>> > to look at it.
>>
>> I believe this bug was fixed in c52d17d91ad
>>
>> Can we close this bug?
>
> Fine by me, you're the one originally requesting all these bug fixes,
> so if you confirm that everything's working correctly with your
> extensive use of shorthands, we should close.
>
> But I've been away from Emacs development for the last months (and
> hope to be disconnecting myself more progressively) so I might not be
> the best person to ask.

Thank you, João!

Warmly,

Joseph




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 17 May 2024 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified today.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.