GNU bug report logs - #77425
31.0.50; Switching to remote project -> no applicable method

Previous Next

Package: emacs;

Reported by: Gerd Möllmann <gerd.moellmann <at> gmail.com>

Date: Tue, 1 Apr 2025 07:08:01 UTC

Severity: normal

Found in version 31.0.50

Done: Dmitry Gutov <dmitry <at> gutov.dev>

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 77425 in the body.
You can then email your comments to 77425 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#77425; Package emacs. (Tue, 01 Apr 2025 07:08:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gerd Möllmann <gerd.moellmann <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 01 Apr 2025 07:08:02 GMT) Full text and rfc822 format available.

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

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; Switching to remote project -> no applicable method
Date: Tue, 01 Apr 2025 09:07:15 +0200
- emacs -Q -nw

- Eval in *scratch* (or C-x p p equivalent)
  (project-switch-project "/ssh:mini:~/emacs/github/master/")
  where "/ssh:mini:~/emacs/github/master/" is a Git repository on another machien

=>

Debugger entered--Lisp error: (cl-no-applicable-method project-root nil)
  signal(cl-no-applicable-method (project-root nil))
  cl-no-applicable-method(#s(cl--generic :name project-root :dispatches
  (((&context . project--within-roots-fallback)
  #s(cl--generic-generalizer :name cl--generic-eql-generalizer :priority
  100 :tagcode-function #f(compiled-function (name &rest _) #<bytecode
  0x1077d817f9409598>) :specializers-function #f(compiled-function (tag
  &rest _) #<bytecode 0xa38db246bcaffb>)) #s(cl--generic-generalizer
  :name cl--generic-t-generalizer :priority 0 :tagcode-function
  #f(compiled-function (name &rest _) #<bytecode -0xcaf03e2e0e0b800>)
  :specializers-function #f(compiled-function (tag &rest _) #<bytecode
  -0xcaf03e2e0e088e2>))) (0 #s(cl--g eneric-generalizer :name cl--generic-head-generalizer :priority 80 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0xbe4f64f8ef48720>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode -0x175c724d89d63e85>)) #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode -0xcaf03e2e0e0b800>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode -0xcaf03e2e0e088e2>)))) :method-table (#s(cl--generic-method :specializers ((head vc)) :qualifiers nil :call-con nil :function #f(compiled-function (project) #<bytecode 0x4939e1b339236b2>)) #s(cl--generic-method :specializers ((head transient)) :qualifiers nil :call-con nil :function #f(compiled-function (project) #<bytecode 0x49380d3d9f6b40e>)) #s(cl--generic-method :specializers (t ((&context . project--within-roots-fallback) eql nil)) :qualifiers nil :call-con nil :function #f(compiled-function (project) #<bytecode 0x4f0874ce20019b2>))) :options nil) nil)
  apply(cl-no-applicable-method #s(cl--generic :name project-root :dispatches (((&context . project--within-roots-fallback) #s(cl--generic-generalizer :name cl--generic-eql-generalizer :priority 100 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0x1077d817f9409598>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode 0xa38db246bcaffb>)) #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode -0xcaf03e2e0e0b800>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode -0xcaf03e2e0e088e2>))) (0 #s(cl--generic-generalizer :name cl--generic-head-generalizer :priority 80 :tagcode-function #f(compiled-function (name &rest _) #<bytecode 0xbe4f64f8ef48720>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode -0x175c724d89d63e85>)) #s(cl--generic-generalizer :name cl--generic-t-generalizer :priority 0 :tagcode-function #f(compiled-function (name &rest _) #<bytecode -0xcaf03e2e0e0b800>) :specializers-function #f(compiled-function (tag &rest _) #<bytecode -0xcaf03e2e0e088e2>)))) :method-table (#s(cl--generic-method :specializers ((head vc)) :qualifiers nil :call-con nil :function #f(compiled-function (project) #<bytecode 0x4939e1b339236b2>)) #s(cl--generic-method :specializers ((head transient)) :qualifiers nil :call-con nil :function #f(compiled-function (project) #<bytecode 0x49380d3d9f6b40e>)) #s(cl--generic-method :specializers (t ((&context . project--within-roots-fallback) eql nil)) :qualifiers nil :call-con nil :function #f(compiled-function (project) #<bytecode 0x4f0874ce20019b2>))) :options nil) nil)
  #f(compiled-function (&rest args) #<bytecode 0xb8576de120222bf>)(nil)
  apply(#f(compiled-function (&rest args) #<bytecode 0xb8576de120222bf>) nil nil)
  #f(compiled-function (arg &rest args) #<bytecode 0x18eea06f65c4583>)(nil)
  apply(#f(compiled-function (arg &rest args) #<bytecode 0x18eea06f65c4583>) nil)
  project-root(nil)
  project-roots(nil)
  #f(compiled-function (project) #<bytecode 0x4f0874ce20019b2>)(nil)
  apply(#f(compiled-function (project) #<bytecode 0x4f0874ce20019b2>) nil nil)
  #f(compiled-function (arg &rest args) #<bytecode 0x3e454e2766dc583>)(nil)
  apply(#f(compiled-function (arg &rest args) #<bytecode 0x3e454e2766dc583>) nil)
  project-root(nil)
  project-remember-project(nil)
  project-switch-project("/ssh:mini:~/emacs/github/master/")
  (progn (project-switch-project "/ssh:mini:~/emacs/github/master/"))
  eval((progn (project-switch-project "/ssh:mini:~/emacs/github/master/")) t)
  elisp--eval-last-sexp(t)
  #f(compiled-function () #<bytecode 0x1866ec10fb12>)()
  handler-bind-1(#f(compiled-function () #<bytecode 0x1866ec10fb12>) (error) eval-expression--debug)
  eval-last-sexp(t)
  eval-print-last-sexp(nil)
  funcall-interactively(eval-print-last-sexp nil)
  call-interactively(eval-print-last-sexp nil nil)
  command-execute(eval-print-last-sexp)


In GNU Emacs 31.0.50 (build 1, aarch64-apple-darwin24.3.0) of 2025-03-31
 built on pro2
Repository revision: 1ed1cc83491311517ba46dff73fdc4383ffd4102
Repository branch: master
System Description:  macOS 15.3.2




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77425; Package emacs. (Thu, 03 Apr 2025 07:39:02 GMT) Full text and rfc822 format available.

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

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: 77425 <at> debbugs.gnu.org
Cc: Visuwesh <visuweshm <at> gmail.com>
Subject: Re: bug#77425: 31.0.50; Switching to remote project -> no
 applicable method
Date: Thu, 03 Apr 2025 09:38:02 +0200
Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:

> - emacs -Q -nw
>
> - Eval in *scratch* (or C-x p p equivalent)
>   (project-switch-project "/ssh:mini:~/emacs/github/master/")
>   where "/ssh:mini:~/emacs/github/master/" is a Git repository on another machien
>
> =>
>
> Debugger entered--Lisp error: (cl-no-applicable-method project-root nil)

Bisect gives

6aa60038ee999d25184a639ce0ac76b614e3afb6 is the first bad commit
commit 6aa60038ee999d25184a639ce0ac76b614e3afb6
Author: Visuwesh <visuweshm <at> gmail.com>
Date:   Mon Mar 3 13:56:04 2025 +0530
    Add new user option to exclude projects from being remembered
    
    * lisp/progmodes/project.el (project-list-exclude): Add new user
    option to exclude projects from being remembered.
    (project-remember-project): Consider the user option above.
    (project-switch-project): Use 'project-remember-project' instead.
    * doc/emacs/maintaining.texi (Managing Projects): Mention the new user option.
    * etc/NEWS: Announce the change.  (Bug#76587)
 doc/emacs/maintaining.texi |  9 +++++++++
 etc/NEWS                   |  7 +++++++
 lisp/progmodes/project.el  | 21 +++++++++++++++++++--
 3 files changed, 35 insertions(+), 2 deletions(-)

Author in CC.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77425; Package emacs. (Thu, 03 Apr 2025 10:35:01 GMT) Full text and rfc822 format available.

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

From: Visuwesh <visuweshm <at> gmail.com>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, 77425 <at> debbugs.gnu.org
Subject: Re: bug#77425: 31.0.50; Switching to remote project -> no
 applicable method
Date: Thu, 03 Apr 2025 16:04:40 +0530
[வியாழன் ஏப்ரல் 03, 2025] Gerd Möllmann wrote:

> Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:
>
>> - emacs -Q -nw
>>
>> - Eval in *scratch* (or C-x p p equivalent)
>>   (project-switch-project "/ssh:mini:~/emacs/github/master/")
>>   where "/ssh:mini:~/emacs/github/master/" is a Git repository on another machien
>>
>> =>
>>
>> Debugger entered--Lisp error: (cl-no-applicable-method project-root nil)
>
> Bisect gives
>
> 6aa60038ee999d25184a639ce0ac76b614e3afb6 is the first bad commit
> commit 6aa60038ee999d25184a639ce0ac76b614e3afb6
> Author: Visuwesh <visuweshm <at> gmail.com>
> Date:   Mon Mar 3 13:56:04 2025 +0530
>     Add new user option to exclude projects from being remembered
>     
>     * lisp/progmodes/project.el (project-list-exclude): Add new user
>     option to exclude projects from being remembered.
>     (project-remember-project): Consider the user option above.
>     (project-switch-project): Use 'project-remember-project' instead.
>     * doc/emacs/maintaining.texi (Managing Projects): Mention the new user option.
>     * etc/NEWS: Announce the change.  (Bug#76587)
>  doc/emacs/maintaining.texi |  9 +++++++++
>  etc/NEWS                   |  7 +++++++
>  lisp/progmodes/project.el  | 21 +++++++++++++++++++--
>  3 files changed, 35 insertions(+), 2 deletions(-)
>
> Author in CC.

Am I right to assume there's no existing Tramp connection to the mini
host?  The recipe signals an error because we call project-current with
MAYBE-PROMPT=nil in project-switch-project, and project-current binds
non-essential depending on the value of MAYBE-PROMPT:

(defun project-current (&optional maybe-prompt directory)
  ...
  (unless directory (setq directory (or project-current-directory-override
                                        default-directory)))
  (let* ((non-essential (not maybe-prompt))
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         (pr (project--find-in-directory directory)))
  ...

With a non-nil non-essential, no wonder project-current fails to return
the project object.  One possible remedy would to be have

diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index e2cd5bfa231..dfadf67de27 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -2301,7 +2301,7 @@ project-switch-project
 When called in a program, it will use the project corresponding
 to directory DIR."
   (interactive (list (funcall project-prompter)))
-  (project-remember-project (project-current nil dir))
+  (project-remember-project (project-current t dir))
   (let ((command (if (symbolp project-switch-commands)
                      project-switch-commands
                    (project--switch-project-command dir)))

but I don't know if it is the right solution.  I hope Dmitry (CC'd) will
have a better answer.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77425; Package emacs. (Thu, 03 Apr 2025 11:45:02 GMT) Full text and rfc822 format available.

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

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, 77425 <at> debbugs.gnu.org
Subject: Re: bug#77425: 31.0.50; Switching to remote project -> no
 applicable method
Date: Thu, 03 Apr 2025 13:43:59 +0200
Visuwesh <visuweshm <at> gmail.com> writes:

> Am I right to assume there's no existing Tramp connection to the mini
> host?  

Yes, that's right.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77425; Package emacs. (Thu, 03 Apr 2025 12:20:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Visuwesh <visuweshm <at> gmail.com>, Gerd Möllmann
 <gerd.moellmann <at> gmail.com>
Cc: 77425 <at> debbugs.gnu.org
Subject: Re: bug#77425: 31.0.50; Switching to remote project -> no applicable
 method
Date: Thu, 3 Apr 2025 15:19:29 +0300
Hi!

On 03/04/2025 13:34, Visuwesh wrote:
> -  (project-remember-project (project-current nil dir))
> +  (project-remember-project (project-current t dir))

That looks good.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77425; Package emacs. (Thu, 03 Apr 2025 13:19:02 GMT) Full text and rfc822 format available.

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

From: Visuwesh <visuweshm <at> gmail.com>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: Gerd Möllmann <gerd.moellmann <at> gmail.com>,
 77425 <at> debbugs.gnu.org
Subject: Re: bug#77425: 31.0.50; Switching to remote project -> no
 applicable method
Date: Thu, 03 Apr 2025 18:47:54 +0530
[Message part 1 (text/plain, inline)]
[வியாழன் ஏப்ரல் 03, 2025] Dmitry Gutov wrote:

> Hi!
>
> On 03/04/2025 13:34, Visuwesh wrote:
>> -  (project-remember-project (project-current nil dir))
>> +  (project-remember-project (project-current t dir))
>
> That looks good.

Thanks, proper patch attached.

[0001-Fix-C-x-p-p-for-remote-directories-with-no-Tramp-con.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77425; Package emacs. (Thu, 03 Apr 2025 13:39:02 GMT) Full text and rfc822 format available.

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

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, 77425 <at> debbugs.gnu.org
Subject: Re: bug#77425: 31.0.50; Switching to remote project -> no
 applicable method
Date: Thu, 03 Apr 2025 15:38:29 +0200
Visuwesh <visuweshm <at> gmail.com> writes:

> [வியாழன் ஏப்ரல் 03, 2025] Dmitry Gutov wrote:
>
>> Hi!
>>
>> On 03/04/2025 13:34, Visuwesh wrote:
>>> -  (project-remember-project (project-current nil dir))
>>> +  (project-remember-project (project-current t dir))
>>
>> That looks good.
>
> Thanks, proper patch attached.

Fix confirmed.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77425; Package emacs. (Thu, 03 Apr 2025 13:54:02 GMT) Full text and rfc822 format available.

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

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, 77425 <at> debbugs.gnu.org
Subject: Re: bug#77425: 31.0.50; Switching to remote project -> no
 applicable method
Date: Thu, 03 Apr 2025 15:53:38 +0200
Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:

> Visuwesh <visuweshm <at> gmail.com> writes:
>
>> [வியாழன் ஏப்ரல் 03, 2025] Dmitry Gutov wrote:
>>
>>> Hi!
>>>
>>> On 03/04/2025 13:34, Visuwesh wrote:
>>>> -  (project-remember-project (project-current nil dir))
>>>> +  (project-remember-project (project-current t dir))
>>>
>>> That looks good.
>>
>> Thanks, proper patch attached.
>
> Fix confirmed.

Forgot the thanks :-/. So thanks for the quick fix! :-)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77425; Package emacs. (Thu, 03 Apr 2025 15:08:03 GMT) Full text and rfc822 format available.

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

From: Visuwesh <visuweshm <at> gmail.com>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, 77425 <at> debbugs.gnu.org
Subject: Re: bug#77425: 31.0.50; Switching to remote project -> no
 applicable method
Date: Thu, 03 Apr 2025 20:37:49 +0530
[வியாழன் ஏப்ரல் 03, 2025] Gerd Möllmann wrote:

> Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:
>
>> Visuwesh <visuweshm <at> gmail.com> writes:
>>
>>> [வியாழன் ஏப்ரல் 03, 2025] Dmitry Gutov wrote:
>>>
>>>> Hi!
>>>>
>>>> On 03/04/2025 13:34, Visuwesh wrote:
>>>>> -  (project-remember-project (project-current nil dir))
>>>>> +  (project-remember-project (project-current t dir))
>>>>
>>>> That looks good.
>>>
>>> Thanks, proper patch attached.
>>
>> Fix confirmed.
>
> Forgot the thanks :-/. So thanks for the quick fix! :-)

You're welcome!  And thank you for the clear recipe and backtrace; it
helped me understand the bug within minutes, without having to reproduce
the bug on my end.  ;-)




Reply sent to Dmitry Gutov <dmitry <at> gutov.dev>:
You have taken responsibility. (Thu, 03 Apr 2025 23:21:02 GMT) Full text and rfc822 format available.

Notification sent to Gerd Möllmann <gerd.moellmann <at> gmail.com>:
bug acknowledged by developer. (Thu, 03 Apr 2025 23:21:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: Gerd Möllmann <gerd.moellmann <at> gmail.com>,
 77425-done <at> debbugs.gnu.org
Subject: Re: bug#77425: 31.0.50; Switching to remote project -> no applicable
 method
Date: Fri, 4 Apr 2025 02:20:15 +0300
On 03/04/2025 16:17, Visuwesh wrote:
> Thanks, proper patch attached.

Installed, thanks!




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

This bug report was last modified 45 days ago.

Previous Next


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