Subject: Re: bug#71537: 30.0.50; [PATCH] missing autoload cookies

From: Eli Zaretskii <[email-masked]>
Date: Thu, 13 Jun 2024 18:33:37 +0300

> Date: Thu, 13 Jun 2024 14:59:06 +0000
> From: Gerard Vermeulen <[email-masked]>
> 
> 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?