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 #71 received at 79036 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Liu Hui <liuhui1610 <at> gmail.com>
Cc: 79036 <at> debbugs.gnu.org, kobarity <at> gmail.com, michael.albinus <at> gmx.de
Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames
Date: Fri, 18 Jul 2025 15:08:37 +0300
> From: Liu Hui <liuhui1610 <at> gmail.com>
> Date: Fri, 18 Jul 2025 12:47:07 +0800
> Cc: michael.albinus <at> gmx.de, kobarity <at> gmail.com, 79036 <at> debbugs.gnu.org
> 
> > If we did have such a function, wouldn't it be enough to just call
> >
> >    (find-file-noselect (remote-file-name file-name))
> >
> > ?  That is, we won't need to call get-file-buffer, nor file-exists-p,
> > right?  Or am I still missing something?
> 
> They are still needed because python-pdbtrack-set-tracked-buffer is
> not just used to visit file-name.
> 
> If the file-buffer already exists, which uses get-file-buffer for
> checking, we don't kill it when pdb finishes. Otherwise, the
> file-buffer will be created by find-file-noselect and added to
> python-pdbtrack-buffers-to-kill.

This could be handled by other means.  For example, use
buffer-list-update-hook.  Or you could use get-file-buffer first and
_then_ call find-file-noselect unconditionally; it would still be
cleaner, IMO.

> file-exists-p: For a local file name in a remote python shell, we
> cannot simply distinguish whether it is a file on the remote system or
> a local file (i.e. sending code from local host), although the former
> is more likely. So we need file-exists-p for verification.

Sorry, I don't understand the problem and its solution.  What do you
mean by "local file name in a remote python shell"?

> Moreover, if file doesn't exist (e.g. the original file may be
> deleted), it makes no sense to create an empty buffer/file, because we
> don't want to edit it, but to debug the code in it.

This can be handled by other means.  But again, I don't understand why
is this important, so please elaborate.

> The attached patch fixes the original bug and another one of pdbtrack
> (described earlier). It also adds a check in case
> python-pdbtrack-set-tracked-buffer cannot find file.

Thanks, but let's first finish the discussion about all those
precautions instead of just calling find-file-noselect.




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.