GNU bug report logs - #79036
[PATCH] Fix pdb tracking for remote filenames

Previous Next

Package: emacs;

Reported by: Liu Hui <liuhui1610 <at> gmail.com>

Date: Thu, 17 Jul 2025 04:59:01 UTC

Severity: normal

Tags: patch

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

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: liuhui1610 <at> gmail.com, kobarity <at> gmail.com, 79036 <at> debbugs.gnu.org
Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames
Date: Thu, 17 Jul 2025 18:00:34 +0300
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Cc: Liu Hui <liuhui1610 <at> gmail.com>,  kobarity <at> gmail.com,  79036 <at> debbugs.gnu.org
> Date: Thu, 17 Jul 2025 16:46:13 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > So we need a function called, say, remote-file-name, which, when given
> > a file name, even an absolute one, will consider it to be on the
> > remote host indicated by default-directory, and will be equivalent to
> > expand-file-name if default-directory is a local one, is that right?
> >
> > Michael, don't we already have such a function?
> 
> No, we haven't IIRC. Something like this? (untested)
> 
> --8<---------------cut here---------------start------------->8---
> (defun file-remote-name (file)
>   "Return the remote file name of FILE.
> If FILE is already remote, return it as it is.
> If `default-directory' is local, return FILE as it is.
> Otherwise, prepend the remote file name component of `default-directory'
> to FILE."
>   (if (file-remote-p file)
>       file
>     (concat (file-remote-p default-directory) file)))
> --8<---------------cut here---------------end--------------->8---

I'm missing expand-file-name somewhere (FILE could be not an absolute
file name) in the case that FILE is a local file.  Otherwise, yes,
thanks.




This bug report was last modified 1 day ago.

Previous Next


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