GNU bug report logs - #71537
30.0.50; [PATCH] missing autoload cookies

Previous Next

Package: emacs;

Reported by: Gerard Vermeulen <gerard.vermeulen <at> posteo.net>

Date: Thu, 13 Jun 2024 15:00:02 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

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 71537 in the body.
You can then email your comments to 71537 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#71537; Package emacs. (Thu, 13 Jun 2024 15:00:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gerard Vermeulen <gerard.vermeulen <at> posteo.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 13 Jun 2024 15:00:03 GMT) Full text and rfc822 format available.

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

From: Gerard Vermeulen <gerard.vermeulen <at> posteo.net>
To: Bug gnu emacs <bug-gnu-emacs <at> gnu.org>
Subject: 30.0.50; [PATCH] missing autoload cookies
Date: Thu, 13 Jun 2024 14:59:06 +0000
[Message part 1 (text/plain, inline)]
Hello,

I propose the attached patch adding three missing autoload cookies
to eliminate two require forms from two sections in my init.el.

To eliminate (require 'shortdoc) from the first section:
(with-eval-after-load 'help-fns
  ;; ChatGPT recommends to require `shortdoc' contrary to the
  ;; `shortdoc-help-fns-examples-function' documentation string.
  (require 'shortdoc)
  (add-hook 'help-fns-describe-function-functions
            #'shortdoc-help-fns-examples-function)
  (setopt help-enable-symbol-autoload t))

And to eliminate (require 'pulse) from the second section:
(require 'pulse) ; since `pulse' does not autoload `pulse-delay' and
                 ; `pulse-iterations'.

(defun flash-line-around-point (&rest _)
  "Flash the line around point."
  (let ((pulse-iterations 16)
        (pulse-delay 0.1))
    (pulse-momentary-highlight-one-line (point))))

(dolist (command '(scroll-up-command
                   scroll-down-command
                   recenter-top-bottom
                   other-window))
  (advice-add command :after #'flash-line-around-point))

Regards -- Gerard
[missing-autoload-cookies.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71537; Package emacs. (Thu, 13 Jun 2024 15:36:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Gerard Vermeulen <gerard.vermeulen <at> posteo.net>
Cc: 71537 <at> debbugs.gnu.org
Subject: Re: bug#71537: 30.0.50; [PATCH] missing autoload cookies
Date: Thu, 13 Jun 2024 18:33:37 +0300
> Date: Thu, 13 Jun 2024 14:59:06 +0000
> From: Gerard Vermeulen <gerard.vermeulen <at> posteo.net>
> 
> I propose the attached patch adding three missing autoload cookies
> to eliminate two require forms from two sections in my init.el.
> 
> To eliminate (require 'shortdoc) from the first section:
> (with-eval-after-load 'help-fns
>    ;; ChatGPT recommends to require `shortdoc' contrary to the
>    ;; `shortdoc-help-fns-examples-function' documentation string.
>    (require 'shortdoc)
>    (add-hook 'help-fns-describe-function-functions
>              #'shortdoc-help-fns-examples-function)
>    (setopt help-enable-symbol-autoload t))
> 
> And to eliminate (require 'pulse) from the second section:
> (require 'pulse) ; since `pulse' does not autoload `pulse-delay' and
>                   ; `pulse-iterations'.
> 
> (defun flash-line-around-point (&rest _)
>    "Flash the line around point."
>    (let ((pulse-iterations 16)
>          (pulse-delay 0.1))
>      (pulse-momentary-highlight-one-line (point))))
> 
> (dolist (command '(scroll-up-command
>                     scroll-down-command
>                     recenter-top-bottom
>                     other-window))
>    (advice-add command :after #'flash-line-around-point))

Thanks, but I don't understand why what we have now constitutes a
problem.  help-fns loads shortdoc when it needs it, and
pulse-momentary-highlight-one-line is autoloaded already (you don't
need to auto-load variables to assign values to them).

Can you describe the problems you have if you delete those 'require's
from your init file, and explain why manually requiring them is a
problem?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71537; Package emacs. (Thu, 13 Jun 2024 20:58:02 GMT) Full text and rfc822 format available.

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

From: Gerard Vermeulen <gerard.vermeulen <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 71537 <at> debbugs.gnu.org
Subject: Re: bug#71537: 30.0.50; [PATCH] missing autoload cookies
Date: Thu, 13 Jun 2024 20:57:50 +0000

On 13.06.2024 17:33, Eli Zaretskii wrote:
>> Date: Thu, 13 Jun 2024 14:59:06 +0000
>> From: Gerard Vermeulen <gerard.vermeulen <at> posteo.net>
>> 
>> I propose the attached patch adding three missing autoload cookies
>> to eliminate two require forms from two sections in my init.el.
>> 
>> To eliminate (require 'shortdoc) from the first section:
>> (with-eval-after-load 'help-fns
>>    ;; ChatGPT recommends to require `shortdoc' contrary to the
>>    ;; `shortdoc-help-fns-examples-function' documentation string.
>>    (require 'shortdoc)
>>    (add-hook 'help-fns-describe-function-functions
>>              #'shortdoc-help-fns-examples-function)
>>    (setopt help-enable-symbol-autoload t))
>> 
>> And to eliminate (require 'pulse) from the second section:
>> (require 'pulse) ; since `pulse' does not autoload `pulse-delay' and
>>                   ; `pulse-iterations'.
>> 
>> (defun flash-line-around-point (&rest _)
>>    "Flash the line around point."
>>    (let ((pulse-iterations 16)
>>          (pulse-delay 0.1))
>>      (pulse-momentary-highlight-one-line (point))))
>> 
>> (dolist (command '(scroll-up-command
>>                     scroll-down-command
>>                     recenter-top-bottom
>>                     other-window))
>>    (advice-add command :after #'flash-line-around-point))
> 
> Thanks, but I don't understand why what we have now constitutes a
> problem.  help-fns loads shortdoc when it needs it, and
> pulse-momentary-highlight-one-line is autoloaded already (you don't
> need to auto-load variables to assign values to them).
> 
> Can you describe the problems you have if you delete those 'require's
> from your init file, and explain why manually requiring them is a
> problem?

I try: after deleting those require's:

1. and after doing "M-x describe-function shortdoc" before shortdoc has 
been
    (auto)loaded by something else, I get in my message window:

    help-fns--run-describe-functions: Symbol’s function definition is 
void: shortdoc-help-fns-examples-function

    and the help window does not show (is not created).

    Addition of an autoload cookie to 
shortdoc-help-fns-examples-function
    fixes this.

2. and after calling "other-window" flash-line-around-point gets called,
    but I get in my message window:

    byte-code: Defining as dynamic an already lexical var: 
pulse-iterations

    and the expected visual effect (a slow - about 2 seconds - flashing 
of
    the line containing point) does not show itself.  Addition of the 
two
    autoload cookies to the two defcustoms pulse-iterations and 
pulse-delay
    fixes this.

Manually requiring the two requires is not a real problem, but just 
somewhat
inconvenient and surprising in my point of view (FWIW).







Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71537; Package emacs. (Fri, 14 Jun 2024 06:46:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Gerard Vermeulen <gerard.vermeulen <at> posteo.net>
Cc: 71537 <at> debbugs.gnu.org
Subject: Re: bug#71537: 30.0.50; [PATCH] missing autoload cookies
Date: Fri, 14 Jun 2024 09:43:15 +0300
> Date: Thu, 13 Jun 2024 20:57:50 +0000
> From: Gerard Vermeulen <gerard.vermeulen <at> posteo.net>
> Cc: 71537 <at> debbugs.gnu.org
> 
> > Thanks, but I don't understand why what we have now constitutes a
> > problem.  help-fns loads shortdoc when it needs it, and
> > pulse-momentary-highlight-one-line is autoloaded already (you don't
> > need to auto-load variables to assign values to them).
> > 
> > Can you describe the problems you have if you delete those 'require's
> > from your init file, and explain why manually requiring them is a
> > problem?
> 
> I try: after deleting those require's:
> 
> 1. and after doing "M-x describe-function shortdoc" before shortdoc has 
> been
>      (auto)loaded by something else, I get in my message window:
> 
>      help-fns--run-describe-functions: Symbol’s function definition is 
> void: shortdoc-help-fns-examples-function
> 
>      and the help window does not show (is not created).

I cannot reproduce this.  For me, the *Help* buffer is displayed
without any error message.  Are you using the latest master branch of
the Emacs Git repository?  Is this in "emacs -Q"?

> 2. and after calling "other-window" flash-line-around-point gets called,
>      but I get in my message window:
> 
>      byte-code: Defining as dynamic an already lexical var: 
> pulse-iterations

You should use setq (or setopt) instead of let-binding.  These two
variables are user options, so let-binding them is not appropriate.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#71537; Package emacs. (Fri, 14 Jun 2024 08:30:02 GMT) Full text and rfc822 format available.

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

From: Gerard Vermeulen <gerard.vermeulen <at> posteo.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 71537 <at> debbugs.gnu.org
Subject: Re: bug#71537: 30.0.50; [PATCH] missing autoload cookies
Date: Fri, 14 Jun 2024 08:29:01 +0000

On 14.06.2024 08:43, Eli Zaretskii wrote:
>> Date: Thu, 13 Jun 2024 20:57:50 +0000
>> From: Gerard Vermeulen <gerard.vermeulen <at> posteo.net>
>> Cc: 71537 <at> debbugs.gnu.org
>> 
>> > Thanks, but I don't understand why what we have now constitutes a
>> > problem.  help-fns loads shortdoc when it needs it, and
>> > pulse-momentary-highlight-one-line is autoloaded already (you don't
>> > need to auto-load variables to assign values to them).
>> >
>> > Can you describe the problems you have if you delete those 'require's
>> > from your init file, and explain why manually requiring them is a
>> > problem?
>> 
>> I try: after deleting those require's:
>> 
>> 1. and after doing "M-x describe-function shortdoc" before shortdoc 
>> has
>> been
>>      (auto)loaded by something else, I get in my message window:
>> 
>>      help-fns--run-describe-functions: Symbol’s function definition is
>> void: shortdoc-help-fns-examples-function
>> 
>>      and the help window does not show (is not created).
> 
> I cannot reproduce this.  For me, the *Help* buffer is displayed
> without any error message.  Are you using the latest master branch of
> the Emacs Git repository?  Is this in "emacs -Q"?

It works in "emacs -Q" in yesterday's master branch.

In the process, I figured out what was the issue in my init.el:

shortdoc-help-fns-examples-function was the first item in
the help-fns-describe-function-functions list and this needs the 
require.

After moving shortdoc-help-fns-examples-function after all 
help-fns--XXXX
functions in the list, everything works fine without the require.

> 
>> 2. and after calling "other-window" flash-line-around-point gets 
>> called,
>>      but I get in my message window:
>> 
>>      byte-code: Defining as dynamic an already lexical var:
>> pulse-iterations
> 
> You should use setq (or setopt) instead of let-binding.  These two
> variables are user options, so let-binding them is not appropriate.

Indeed, it works with setq.

Thanks a lot. You can close the bug, as far as I am concerned.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 14 Jun 2024 11:01:02 GMT) Full text and rfc822 format available.

Notification sent to Gerard Vermeulen <gerard.vermeulen <at> posteo.net>:
bug acknowledged by developer. (Fri, 14 Jun 2024 11:01:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Gerard Vermeulen <gerard.vermeulen <at> posteo.net>
Cc: 71537-done <at> debbugs.gnu.org
Subject: Re: bug#71537: 30.0.50; [PATCH] missing autoload cookies
Date: Fri, 14 Jun 2024 14:00:11 +0300
> Date: Fri, 14 Jun 2024 08:29:01 +0000
> From: Gerard Vermeulen <gerard.vermeulen <at> posteo.net>
> Cc: 71537 <at> debbugs.gnu.org
> 
> 
> 
> On 14.06.2024 08:43, Eli Zaretskii wrote:
> >> Date: Thu, 13 Jun 2024 20:57:50 +0000
> >> From: Gerard Vermeulen <gerard.vermeulen <at> posteo.net>
> >> Cc: 71537 <at> debbugs.gnu.org
> >> 
> >> > Thanks, but I don't understand why what we have now constitutes a
> >> > problem.  help-fns loads shortdoc when it needs it, and
> >> > pulse-momentary-highlight-one-line is autoloaded already (you don't
> >> > need to auto-load variables to assign values to them).
> >> >
> >> > Can you describe the problems you have if you delete those 'require's
> >> > from your init file, and explain why manually requiring them is a
> >> > problem?
> >> 
> >> I try: after deleting those require's:
> >> 
> >> 1. and after doing "M-x describe-function shortdoc" before shortdoc 
> >> has
> >> been
> >>      (auto)loaded by something else, I get in my message window:
> >> 
> >>      help-fns--run-describe-functions: Symbol’s function definition is
> >> void: shortdoc-help-fns-examples-function
> >> 
> >>      and the help window does not show (is not created).
> > 
> > I cannot reproduce this.  For me, the *Help* buffer is displayed
> > without any error message.  Are you using the latest master branch of
> > the Emacs Git repository?  Is this in "emacs -Q"?
> 
> It works in "emacs -Q" in yesterday's master branch.
> 
> In the process, I figured out what was the issue in my init.el:
> 
> shortdoc-help-fns-examples-function was the first item in
> the help-fns-describe-function-functions list and this needs the 
> require.
> 
> After moving shortdoc-help-fns-examples-function after all 
> help-fns--XXXX
> functions in the list, everything works fine without the require.
> 
> > 
> >> 2. and after calling "other-window" flash-line-around-point gets 
> >> called,
> >>      but I get in my message window:
> >> 
> >>      byte-code: Defining as dynamic an already lexical var:
> >> pulse-iterations
> > 
> > You should use setq (or setopt) instead of let-binding.  These two
> > variables are user options, so let-binding them is not appropriate.
> 
> Indeed, it works with setq.
> 
> Thanks a lot. You can close the bug, as far as I am concerned.

Done, thanks.




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

This bug report was last modified 1 year and 33 days ago.

Previous Next


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