GNU bug report logs - #79163
30.1; [PATCH] Handle remote file names in cmuscheme.el

Previous Next

Package: emacs;

Reported by: Vinícius Moraes <vinicius.moraes <at> eternodevir.com>

Date: Sun, 3 Aug 2025 06:41:02 UTC

Severity: normal

Tags: patch

Found in version 30.1

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

To reply to this bug, email your comments to 79163 AT debbugs.gnu.org.
There is no need to reopen the bug first.

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#79163; Package emacs. (Sun, 03 Aug 2025 06:41:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Vinícius Moraes <vinicius.moraes <at> eternodevir.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 03 Aug 2025 06:41:03 GMT) Full text and rfc822 format available.

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

From: Vinícius Moraes <vinicius.moraes <at> eternodevir.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.1; [PATCH] Handle remote file names in cmuscheme.el
Date: Sun, 03 Aug 2025 00:48:59 +0000
[Message part 1 (text/plain, inline)]
Hello,

I came across a minor problem while using `scheme-load-file' from
`cmuscheme.el' via TRAMP.[tldr-recipe]

As I understand it, currently, `scheme-load-file' sends the file-name
directly to the Scheme interpreter (through `comint-send-string')
without removing TRAMP's remote file name syntax. This seems to make the
interpreter on a remote system (or, in this case, a container) attempt
to load an incorrect file name.

For example:
#;1>
Error: (load) cannot open file: "/podman:demo:/home/t/example.scm"
[...]
<eval> (load "/podman:demo:/home/t/example.scm") <--

(See [tldr-recipe] for the non-simplified/real values and recipe. I was
able to reproduce it with a VM and the `ssh' method as well).

Expected outcome: (load "/home/t/example.scm")

Since `file-local-name' returns the string/argument unaltered for
non-remote file names[1], I _think_ this change should not affect the
current/correct behavior for non-remote scenarios. (`shell' seems to use
a similar approach with `file-local-name' and `expand-file-name' on
remote hosts; I decided to not include `expand-file-name' here because,
in my understanding, `comint-get-source' is already handling the
expansion[2]).

For consistency, I applied the same fix to the `scheme-compile-file'
function as well---since the logic is almost the same.

I have been using this patch downstream without problems, but tackling
it upstream (for multiple Scheme implementations and workflows) could be
a different story. In any case, I hope this report helps. Let me know if
you have any questions or suggestions.

P.S.: This is my first time contributing back here. I consider myself a
Lisp apprentice and I'm still getting familiar with Emacs internals and
conventions.

[tldr-recipe]: Recipe used to reproduce the behavior. 1. \emacs -Q
2. (require 'cmuscheme) 3. (setq scheme-program-name "csi")
4. (find-file "/podman:mkdev-test:/home/ttybitnik/workspace/
test.scm"). 5. (scheme-load-file)
Outcome: '#;1> [...] Error: (load) cannot open file [...]
<eval> (load "/podman:mkdev-test:/home/ttybitnik/workspace/test.scm")
Expected: (load "/home/ttybitnik/workspace/test.scm")

[1]: "[...] (or (file-remote-p file 'localname) file)"

[2]: "[...] (list (expand-file-name (substitute-in-file-name ans)))"

Thanks for all the work on GNU Emacs.

Kind regards,
Vinícius Moraes

[0001-Handle-remote-file-names-in-cmuscheme.el.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79163; Package emacs. (Mon, 04 Aug 2025 11:56:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Vinícius Moraes <vinicius.moraes <at> eternodevir.com>,
 Michael Albinus <michael.albinus <at> gmx.de>
Cc: 79163 <at> debbugs.gnu.org
Subject: Re: bug#79163: 30.1; [PATCH] Handle remote file names in cmuscheme.el
Date: Mon, 04 Aug 2025 14:55:25 +0300
> Date: Sun, 03 Aug 2025 00:48:59 +0000
> From:  Vinícius Moraes via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> I came across a minor problem while using `scheme-load-file' from
> `cmuscheme.el' via TRAMP.[tldr-recipe]
> 
> As I understand it, currently, `scheme-load-file' sends the file-name
> directly to the Scheme interpreter (through `comint-send-string')
> without removing TRAMP's remote file name syntax. This seems to make the
> interpreter on a remote system (or, in this case, a container) attempt
> to load an incorrect file name.
> 
> For example:
> #;1>
> Error: (load) cannot open file: "/podman:demo:/home/t/example.scm"
> [...]
> <eval> (load "/podman:demo:/home/t/example.scm") <--
> 
> (See [tldr-recipe] for the non-simplified/real values and recipe. I was
> able to reproduce it with a VM and the `ssh' method as well).
> 
> Expected outcome: (load "/home/t/example.scm")
> 
> Since `file-local-name' returns the string/argument unaltered for
> non-remote file names[1], I _think_ this change should not affect the
> current/correct behavior for non-remote scenarios. (`shell' seems to use
> a similar approach with `file-local-name' and `expand-file-name' on
> remote hosts; I decided to not include `expand-file-name' here because,
> in my understanding, `comint-get-source' is already handling the
> expansion[2]).
> 
> For consistency, I applied the same fix to the `scheme-compile-file'
> function as well---since the logic is almost the same.
> 
> I have been using this patch downstream without problems, but tackling
> it upstream (for multiple Scheme implementations and workflows) could be
> a different story. In any case, I hope this report helps. Let me know if
> you have any questions or suggestions.

Thanks.

Michael, any comments or suggestions?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#79163; Package emacs. (Mon, 04 Aug 2025 11:59:02 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Vinícius Moraes <vinicius.moraes <at> eternodevir.com>,
 79163 <at> debbugs.gnu.org
Subject: Re: bug#79163: 30.1; [PATCH] Handle remote file names in cmuscheme.el
Date: Mon, 04 Aug 2025 13:57:59 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

Hi Eli,

>> I have been using this patch downstream without problems, but tackling
>> it upstream (for multiple Scheme implementations and workflows) could be
>> a different story. In any case, I hope this report helps. Let me know if
>> you have any questions or suggestions.
>
> Thanks.
>
> Michael, any comments or suggestions?

The patch looks proper to me.

Best regards, Michael.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 07 Aug 2025 13:23:01 GMT) Full text and rfc822 format available.

Notification sent to Vinícius Moraes <vinicius.moraes <at> eternodevir.com>:
bug acknowledged by developer. (Thu, 07 Aug 2025 13:23:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: 79163-done <at> debbugs.gnu.org, vinicius.moraes <at> eternodevir.com
Subject: Re: bug#79163: 30.1; [PATCH] Handle remote file names in cmuscheme.el
Date: Thu, 07 Aug 2025 16:22:16 +0300
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Cc: Vinícius Moraes <vinicius.moraes <at> eternodevir.com>,
>   79163 <at> debbugs.gnu.org
> Date: Mon, 04 Aug 2025 13:57:59 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> Hi Eli,
> 
> >> I have been using this patch downstream without problems, but tackling
> >> it upstream (for multiple Scheme implementations and workflows) could be
> >> a different story. In any case, I hope this report helps. Let me know if
> >> you have any questions or suggestions.
> >
> > Thanks.
> >
> > Michael, any comments or suggestions?
> 
> The patch looks proper to me.

Thanks, I've now installed this on the emacs-30 release branch, and
I'm closing the bug.




This bug report was last modified 10 days ago.

Previous Next


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