Subject: [PATCH] executable-interpret: Handle remote file names
From: Zhengyi Fu <[email-masked]>
To: [email-masked]
Cc: Zhengyi Fu <[email-masked]>
Date: Thu, 14 Aug 2025 14:18:55 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

* lisp/progmodes/executable.el (executable-interpret): Use
`file-local-name' to get the local file name component from
`buffer-file-name'.
---
 lisp/progmodes/executable.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/executable.el b/lisp/progmodes/executable.el
index b003b75b0e4..aa3a74d30fa 100644
--- a/lisp/progmodes/executable.el
+++ b/lisp/progmodes/executable.el
@@ -180,7 +180,7 @@ executable-interpret
 `compilation-shell-minor-mode', so that you can answer any prompts."
   (interactive (list (read-string "Run script: "
 				  (or executable-command
-				      buffer-file-name))))
+				      (file-local-name buffer-file-name)))))
   (require 'compile)
   (save-some-buffers (not compilation-ask-about-save))
   (setq-local executable-command command)