GNU bug report logs - #78851
30.1.50; fileloop-continue should have autoload cookie

Previous Next

Package: emacs;

Reported by: Howard Melman <hmelman <at> gmail.com>

Date: Fri, 20 Jun 2025 21:28:02 UTC

Severity: normal

Found in version 30.1.50

To reply to this bug, email your comments to 78851 AT debbugs.gnu.org.

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#78851; Package emacs. (Fri, 20 Jun 2025 21:28:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Howard Melman <hmelman <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 20 Jun 2025 21:28:03 GMT) Full text and rfc822 format available.

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

From: Howard Melman <hmelman <at> gmail.com>
To: GNU Emacs <bug-gnu-emacs <at> gnu.org>
Subject: 30.1.50; fileloop-continue should have autoload cookie
Date: Fri, 20 Jun 2025 17:26:44 -0400

fileloop-continue is now the recommended way to continue a
few different kinds of searches (tags-search,
project-search, dired-do-search, flavors of query-replace,
etc. 

I understand that it will be available when called because
some other (autoloaded) fileloop command would have been
called and would load the file, but I think it should be
autoloaded because I think it will be easier for people to
bind it and IIUC could remove 4 declare-function calls in
emacs source.

This came up because I made a transient for project commands
and included project-search and wanted to include a way to
continue the search, but when running it I got the following error.

    transient-setup: Suffix command fileloop-continue is not
    defined or autoloaded

So I could add my own autoload for it but I don't think I
should have to.

In GNU Emacs 30.1.50 (build 1, aarch64-apple-darwin24.5.0,
Carbon Version 170 AppKit 2575.6) of 2025-06-01 built on
Calvin
Windowing system distributor 'Apple Inc.', version 15.5.0
System Description:  macOS 15.5

-- 

Howard




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78851; Package emacs. (Sat, 21 Jun 2025 07:17:03 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Howard Melman <hmelman <at> gmail.com>
Cc: 78851 <at> debbugs.gnu.org
Subject: Re: bug#78851: 30.1.50; fileloop-continue should have autoload cookie
Date: Sat, 21 Jun 2025 10:16:31 +0300
> From: Howard Melman <hmelman <at> gmail.com>
> Date: Fri, 20 Jun 2025 17:26:44 -0400
> 
> 
> 
> fileloop-continue is now the recommended way to continue a
> few different kinds of searches (tags-search,
> project-search, dired-do-search, flavors of query-replace,
> etc. 
> 
> I understand that it will be available when called because
> some other (autoloaded) fileloop command would have been
> called and would load the file, but I think it should be
> autoloaded because I think it will be easier for people to
> bind it and IIUC could remove 4 declare-function calls in
> emacs source.
> 
> This came up because I made a transient for project commands
> and included project-search and wanted to include a way to
> continue the search, but when running it I got the following error.
> 
>     transient-setup: Suffix command fileloop-continue is not
>     defined or autoloaded
> 
> So I could add my own autoload for it but I don't think I
> should have to.

Why not?  We will definitely not autoload every possible command in
Emacs, so some of them will sometimes need a 'require' or an
'autoload'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78851; Package emacs. (Sat, 21 Jun 2025 13:59:05 GMT) Full text and rfc822 format available.

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

From: Howard Melman <hmelman <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 78851 <at> debbugs.gnu.org
Subject: Re: bug#78851: 30.1.50; fileloop-continue should have autoload cookie
Date: Sat, 21 Jun 2025 09:57:41 -0400

> On Jun 21, 2025, at 3:16 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> From: Howard Melman <hmelman <at> gmail.com>
>> Date: Fri, 20 Jun 2025 17:26:44 -0400
>> 
>> 
>> 
>> fileloop-continue is now the recommended way to continue a
>> few different kinds of searches (tags-search,
>> project-search, dired-do-search, flavors of query-replace,
>> etc. 
>> 
>> I understand that it will be available when called because
>> some other (autoloaded) fileloop command would have been
>> called and would load the file, but I think it should be
>> autoloaded because I think it will be easier for people to
>> bind it and IIUC could remove 4 declare-function calls in
>> emacs source.
>> 
>> This came up because I made a transient for project commands
>> and included project-search and wanted to include a way to
>> continue the search, but when running it I got the following error.
>> 
>>    transient-setup: Suffix command fileloop-continue is not
>>    defined or autoloaded
>> 
>> So I could add my own autoload for it but I don't think I
>> should have to.
> 
> Why not?  We will definitely not autoload every possible command in
> Emacs, so some of them will sometimes need a 'require' or an
> 'autoload'.

I thought I had given enough reasons above, but here's another:
tags-loop-continue was and still is autoloaded. I would expect
it's replacement to be treated the same way, particularly since it
has more uses.

Howard



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78851; Package emacs. (Sat, 21 Jun 2025 14:23:03 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Howard Melman <hmelman <at> gmail.com>
Cc: 78851 <at> debbugs.gnu.org
Subject: Re: bug#78851: 30.1.50; fileloop-continue should have autoload cookie
Date: Sat, 21 Jun 2025 17:22:40 +0300
> From: Howard Melman <hmelman <at> gmail.com>
> Date: Sat, 21 Jun 2025 09:57:41 -0400
> Cc: 78851 <at> debbugs.gnu.org
> 
> 
> 
> > On Jun 21, 2025, at 3:16 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> > 
> >> From: Howard Melman <hmelman <at> gmail.com>
> >> Date: Fri, 20 Jun 2025 17:26:44 -0400
> >> 
> >> 
> >> 
> >> fileloop-continue is now the recommended way to continue a
> >> few different kinds of searches (tags-search,
> >> project-search, dired-do-search, flavors of query-replace,
> >> etc. 
> >> 
> >> I understand that it will be available when called because
> >> some other (autoloaded) fileloop command would have been
> >> called and would load the file, but I think it should be
> >> autoloaded because I think it will be easier for people to
> >> bind it and IIUC could remove 4 declare-function calls in
> >> emacs source.
> >> 
> >> This came up because I made a transient for project commands
> >> and included project-search and wanted to include a way to
> >> continue the search, but when running it I got the following error.
> >> 
> >>    transient-setup: Suffix command fileloop-continue is not
> >>    defined or autoloaded
> >> 
> >> So I could add my own autoload for it but I don't think I
> >> should have to.
> > 
> > Why not?  We will definitely not autoload every possible command in
> > Emacs, so some of them will sometimes need a 'require' or an
> > 'autoload'.
> 
> I thought I had given enough reasons above, but here's another:
> tags-loop-continue was and still is autoloaded. I would expect
> it's replacement to be treated the same way, particularly since it
> has more uses.

Sorry, I'm not convinced.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78851; Package emacs. (Sat, 21 Jun 2025 14:29:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: hmelman <at> gmail.com
Cc: 78851 <at> debbugs.gnu.org
Subject: Re: bug#78851: 30.1.50; fileloop-continue should have autoload cookie
Date: Sat, 21 Jun 2025 17:28:08 +0300
> Cc: 78851 <at> debbugs.gnu.org
> Date: Sat, 21 Jun 2025 17:22:40 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > >> This came up because I made a transient for project commands
> > >> and included project-search and wanted to include a way to
> > >> continue the search, but when running it I got the following error.
> > >> 
> > >>    transient-setup: Suffix command fileloop-continue is not
> > >>    defined or autoloaded
> > >> 
> > >> So I could add my own autoload for it but I don't think I
> > >> should have to.
> > > 
> > > Why not?  We will definitely not autoload every possible command in
> > > Emacs, so some of them will sometimes need a 'require' or an
> > > 'autoload'.
> > 
> > I thought I had given enough reasons above, but here's another:
> > tags-loop-continue was and still is autoloaded. I would expect
> > it's replacement to be treated the same way, particularly since it
> > has more uses.
> 
> Sorry, I'm not convinced.

Btw, I don't think I even understand your original situation, since
project-search does this:

  (defun project-search (regexp)
    "Search for REGEXP in all the files of the project.
  Stops when a match is found.
  To continue searching for the next match, use the
  command \\[fileloop-continue]."
    (interactive "sSearch (regexp): ")
    (fileloop-initialize-search
     regexp
     (project-files (project-current t))
     'default)
    (fileloop-continue))

and fileloop-initialize-search is autoloaded, so it ought to load
fileloop.el.  Thus, I cannot understand how come the following call to
fileloop-continue signaled an error.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78851; Package emacs. (Sat, 21 Jun 2025 15:51:02 GMT) Full text and rfc822 format available.

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

From: Howard Melman <hmelman <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 78851 <at> debbugs.gnu.org
Subject: Re: bug#78851: 30.1.50; fileloop-continue should have autoload cookie
Date: Sat, 21 Jun 2025 11:50:24 -0400

> On Jun 21, 2025, at 10:28 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> Cc: 78851 <at> debbugs.gnu.org
>> Date: Sat, 21 Jun 2025 17:22:40 +0300
>> From: Eli Zaretskii <eliz <at> gnu.org>
>> 
>>>>> This came up because I made a transient for project commands
>>>>> and included project-search and wanted to include a way to
>>>>> continue the search, but when running it I got the following error.
>>>>> 
>>>>>   transient-setup: Suffix command fileloop-continue is not
>>>>>   defined or autoloaded
>>>>> 
>>>>> So I could add my own autoload for it but I don't think I
>>>>> should have to.
>>>> 
>>>> Why not?  We will definitely not autoload every possible command in
>>>> Emacs, so some of them will sometimes need a 'require' or an
>>>> 'autoload'.
>>> 
>>> I thought I had given enough reasons above, but here's another:
>>> tags-loop-continue was and still is autoloaded. I would expect
>>> it's replacement to be treated the same way, particularly since it
>>> has more uses.
>> 
>> Sorry, I'm not convinced.
> 
> Btw, I don't think I even understand your original situation, since
> project-search does this:
> 
>  (defun project-search (regexp)
>    "Search for REGEXP in all the files of the project.
>  Stops when a match is found.
>  To continue searching for the next match, use the
>  command \\[fileloop-continue]."
>    (interactive "sSearch (regexp): ")
>    (fileloop-initialize-search
>     regexp
>     (project-files (project-current t))
>     'default)
>    (fileloop-continue))
> 
> and fileloop-initialize-search is autoloaded, so it ought to load
> fileloop.el.  Thus, I cannot understand how come the following call to
> fileloop-continue signaled an error.

As I said, it was when running my transient, not the command.
I have a transient like this (some stuff elided) bound to s-j:

(transient-define-prefix hrm-project-transient ()
  "Project commands from project-prefix-map"
  ["Project Commands"
   ["Search"
     ("g"   "Grep"          project-find-regexp)
     ("G"   "Grep Ext"      project-or-external-find-regexp)
     ("r"   "Query Replace" project-query-replace-regexp)
     ("M-g" "Search"        project-search)	; an unbound sequential find-regexp
     ("M-n" "Search Next"   fileloop-continue)
    ]
  ])

After startup, typing s-j causes the error previously reported.

Could you say why you are not convinced?

Howard



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78851; Package emacs. (Sat, 21 Jun 2025 15:51:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78851; Package emacs. (Sat, 21 Jun 2025 18:54:04 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Howard Melman <hmelman <at> gmail.com>
Cc: 78851 <at> debbugs.gnu.org
Subject: Re: bug#78851: 30.1.50; fileloop-continue should have autoload cookie
Date: Sat, 21 Jun 2025 21:53:24 +0300
> From: Howard Melman <hmelman <at> gmail.com>
> Date: Sat, 21 Jun 2025 11:50:24 -0400
> Cc: 78851 <at> debbugs.gnu.org
> 
> > Btw, I don't think I even understand your original situation, since
> > project-search does this:
> > 
> >  (defun project-search (regexp)
> >    "Search for REGEXP in all the files of the project.
> >  Stops when a match is found.
> >  To continue searching for the next match, use the
> >  command \\[fileloop-continue]."
> >    (interactive "sSearch (regexp): ")
> >    (fileloop-initialize-search
> >     regexp
> >     (project-files (project-current t))
> >     'default)
> >    (fileloop-continue))
> > 
> > and fileloop-initialize-search is autoloaded, so it ought to load
> > fileloop.el.  Thus, I cannot understand how come the following call to
> > fileloop-continue signaled an error.
> 
> As I said, it was when running my transient, not the command.
> I have a transient like this (some stuff elided) bound to s-j:
> 
> (transient-define-prefix hrm-project-transient ()
>   "Project commands from project-prefix-map"
>   ["Project Commands"
>    ["Search"
>      ("g"   "Grep"          project-find-regexp)
>      ("G"   "Grep Ext"      project-or-external-find-regexp)
>      ("r"   "Query Replace" project-query-replace-regexp)
>      ("M-g" "Search"        project-search)	; an unbound sequential find-regexp
>      ("M-n" "Search Next"   fileloop-continue)
>     ]
>   ])
> 
> After startup, typing s-j causes the error previously reported.

Isn't that a bug in transient.el?  Binding a key to a command doesn't
require that the command be loaded:

  $ emacs -Q

  M-: (define-key global-map [f8] 'fileloop-continue) RET
    => fileloop-continue
  C-h c F8
    => <f8> runs the command fileloop-continue
  M-: (fboundp 'fileloop-continue) RET
    => nil

Why does transient signal an error in this case?

> Could you say why you are not convinced?

Because by that logic we will be asked to autoload every single
command, and that's definitely wrong.  Some customizations rightfully
need you to autoload or 'require' the corresponding package, and
that's alright.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78851; Package emacs. (Sun, 22 Jun 2025 01:53:01 GMT) Full text and rfc822 format available.

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

From: Howard Melman <hmelman <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 78851 <at> debbugs.gnu.org
Subject: Re: bug#78851: 30.1.50; fileloop-continue should have autoload cookie
Date: Sat, 21 Jun 2025 21:52:06 -0400
On Jun 21, 2025, at 2:53 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> From: Howard Melman <hmelman <at> gmail.com>
>> Date: Sat, 21 Jun 2025 11:50:24 -0400
>> Cc: 78851 <at> debbugs.gnu.org
>> 
>> As I said, it was when running my transient, not the command.
>> I have a transient like this (some stuff elided) bound to s-j:
>> 
>> (transient-define-prefix hrm-project-transient ()
>> "Project commands from project-prefix-map"
>> ["Project Commands"
>>  ["Search"
>>    ("g"   "Grep"          project-find-regexp)
>>    ("G"   "Grep Ext"      project-or-external-find-regexp)
>>    ("r"   "Query Replace" project-query-replace-regexp)
>>    ("M-g" "Search"        project-search) ; an unbound sequential find-regexp
>>    ("M-n" "Search Next"   fileloop-continue)
>>   ]
>> ])
>> 
>> After startup, typing s-j causes the error previously reported.
> 
> Isn't that a bug in transient.el?  Binding a key to a command doesn't
> require that the command be loaded:
> 
> $ emacs -Q
> 
> M-: (define-key global-map [f8] 'fileloop-continue) RET
>   => fileloop-continue
> C-h c F8
>   => <f8> runs the command fileloop-continue
> M-: (fboundp 'fileloop-continue) RET
>   => nil
> 
> Why does transient signal an error in this case?

Could be, I don't know.

>> Could you say why you are not convinced?
> 
> Because by that logic we will be asked to autoload every single
> command, and that's definitely wrong.  Some customizations rightfully
> need you to autoload or 'require' the corresponding package, and
> that's alright.

I get the slippery slope argument, but I don't have an understanding of 
which customizations can get an autoload vs which don't deserve one.
My argument for why this does isn't because they all should, it's because
it's the approved replacement for a command that does, and in fact
for more (similar) commands, and because it would save 4 declare-function
calls currently in emacs source which seems like it meets some threshold.

I admit I'd care less if transient didn't signal an error.

Howard



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#78851; Package emacs. (Sun, 22 Jun 2025 05:46:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Howard Melman <hmelman <at> gmail.com>,
 Jonas Bernoulli <jonas <at> bernoul.li>
Cc: 78851 <at> debbugs.gnu.org
Subject: Re: bug#78851: 30.1.50; fileloop-continue should have autoload cookie
Date: Sun, 22 Jun 2025 08:44:53 +0300
> From: Howard Melman <hmelman <at> gmail.com>
> Date: Sat, 21 Jun 2025 21:52:06 -0400
> Cc: 78851 <at> debbugs.gnu.org
> 
> On Jun 21, 2025, at 2:53 PM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> > 
> >> After startup, typing s-j causes the error previously reported.
> > 
> > Isn't that a bug in transient.el?  Binding a key to a command doesn't
> > require that the command be loaded:
> > 
> > $ emacs -Q
> > 
> > M-: (define-key global-map [f8] 'fileloop-continue) RET
> >   => fileloop-continue
> > C-h c F8
> >   => <f8> runs the command fileloop-continue
> > M-: (fboundp 'fileloop-continue) RET
> >   => nil
> > 
> > Why does transient signal an error in this case?
> 
> Could be, I don't know.

Jonas, any comments?

> >> Could you say why you are not convinced?
> > 
> > Because by that logic we will be asked to autoload every single
> > command, and that's definitely wrong.  Some customizations rightfully
> > need you to autoload or 'require' the corresponding package, and
> > that's alright.
> 
> I get the slippery slope argument, but I don't have an understanding of 
> which customizations can get an autoload vs which don't deserve one.

It's very simple: if the naïve customization signals an error about a
symbol that is unbound, you need to either autoload the offending
symbol or 'require' its package.  This has been always this way in
Emacs, nothing new here.

> My argument for why this does isn't because they all should, it's because
> it's the approved replacement for a command that does, and in fact
> for more (similar) commands, and because it would save 4 declare-function
> calls currently in emacs source which seems like it meets some threshold.

tags-loop-continue and tags-search in general were implemented
differently, so arguments like this are not convincing enough, sorry.

> I admit I'd care less if transient didn't signal an error.

Agreed.  Let's see what Jonas thinks about this.




This bug report was last modified 2 days ago.

Previous Next


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