From unknown Sat Aug 09 04:55:49 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#79036 <79036@debbugs.gnu.org> To: bug#79036 <79036@debbugs.gnu.org> Subject: Status: [PATCH] Fix pdb tracking for remote filenames Reply-To: bug#79036 <79036@debbugs.gnu.org> Date: Sat, 09 Aug 2025 11:55:49 +0000 retitle 79036 [PATCH] Fix pdb tracking for remote filenames reassign 79036 emacs submitter 79036 Liu Hui severity 79036 normal tag 79036 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 00:58:11 2025 Received: (at submit) by debbugs.gnu.org; 17 Jul 2025 04:58:12 +0000 Received: from localhost ([127.0.0.1]:52355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucGh9-0005Wh-GC for submit@debbugs.gnu.org; Thu, 17 Jul 2025 00:58:11 -0400 Received: from lists.gnu.org ([2001:470:142::17]:47902) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucGh5-0005W8-OW for submit@debbugs.gnu.org; Thu, 17 Jul 2025 00:58:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucGgy-0003Ck-QZ for bug-gnu-emacs@gnu.org; Thu, 17 Jul 2025 00:58:00 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ucGgx-0003Tr-2c for bug-gnu-emacs@gnu.org; Thu, 17 Jul 2025 00:58:00 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3a5257748e1so323807f8f.2 for ; Wed, 16 Jul 2025 21:57:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752728277; x=1753333077; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=ixKc3kHuk+7yvt4LF4baBETskrt7woNH73nKURCZCPE=; b=Em2jrOQ/2d2sZhxKc/0BId1MTs04v7BNFJUVvecU/SLQfZlLDY+JlXKzslLm2K2fwO 4/MjsaVeRqp/YBZTJVvx+XYuh++fK7Dvj+Qq28VQJxGuxBkIfGvi4EIMrWXmd0pD+I7W cwLsXXBAHdZACAxvdzSGe76jv4E5n3/z4Axn6rJ6ueLoO/PsssUWaWMuG+1MVPk1xDBi kfLlwTRkAr+CF74IiaHJNzLsRL3Q/o1hQLxlZYyICRvhokLA0vuGhNOCEPdgebK96h2s e0lEzBmFplf5/DcrcJTmiskmAyGnwAxPICVk/s2VRUtXVENTfALuPigCNe51Ta0MCpzu rHOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752728277; x=1753333077; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ixKc3kHuk+7yvt4LF4baBETskrt7woNH73nKURCZCPE=; b=QpvcAJZwW05d3lipCGoMI8CnYkF45QRX/eiZj2+a8EqLlq74Dzbgrdgv6LD0utXwm4 IljM0Xy8r5/bfH+yS/269lIBlOCix94no6d8SLtew8X83i+4xHEJa5pyxOEdttN/O7rQ 1pl6PPv7W76k161xyOTwm9EJUoNd2F1xC31Hx4d4qHQ8+eXSMXtXLN86lAKjahNFEiYh 6SkdYxTLUtEaNefkrOEdTzSUeZeTDxCy5sajaaE3yTbwL48jPa4HzXQQpifNGpgypdMZ xtEXHhyS9ueWF3bhNiM1HwzH/hyLUgZpOXEdKSZZnDKs6rak/46RO2e8i3BMknHk92ZO +B0g== X-Gm-Message-State: AOJu0YyBxhCzN0H12GiNqkEGli/7vo+jKDgHIHmngD3P5oonNODRS+es +oX/Qzwa3BCPa9fZuZI3i3ENHpZZVn9B7ZTRkgQo++Iy5bOIRWvH9UuWvpSynZLQu63DYXzaQe9 xdCfuwcENIN6ey4d/mnms29XQZNgLDhDVfA9GUI8= X-Gm-Gg: ASbGnct9Vpp4f/j+OFy7gXIYekW54ifLwYtEc0K5LZ4O/EukBRplLJDr64sCsru4sns VRfcbKIgNJRzYr3dw7ddn+LjGPKN2dlYEQtpRiR30UGWtY45fXxPWiu4gt4CRmp11wolz6DleVC y/+Y+A7LY7IR2c4nGsl1Mnu9pWtyrl7cvFWPVeS5ZKaZaGeQGse4B8M2WvUfSpZnLdwWWfMdYDi 0ygBL0= X-Google-Smtp-Source: AGHT+IHgN+kwMCA7fzBPeQKW2SOLsxffowl/xacyvkHtrZOBZMorbDmXNPdhyqQZKKxDKRrZjOYstgnemQ7iEe139XM= X-Received: by 2002:a05:6000:2008:b0:3a5:2b1d:7889 with SMTP id ffacd0b85a97d-3b60e53e961mr4053735f8f.43.1752728276629; Wed, 16 Jul 2025 21:57:56 -0700 (PDT) MIME-Version: 1.0 From: Liu Hui Date: Thu, 17 Jul 2025 12:57:45 +0800 X-Gm-Features: Ac12FXxatteT926-RmpO5KHPy3SRoW-yHGINbk9h3vADO3UIk7l2fCFiWWeXvno Message-ID: Subject: [PATCH] Fix pdb tracking for remote filenames To: bug-gnu-emacs@gnu.org Content-Type: multipart/mixed; boundary="0000000000005145f6063a18dab5" Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=liuhui1610@gmail.com; helo=mail-wr1-x42a.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello, The recipe: 1. emacs -Q 2. Create a remote python file and start the remote python shell, e.g. M-x find-file /ssh:server:/tmp/test.py M-x run-python 3. Insert the following code in test.py and press C-c C-c to se [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (liuhui1610[at]gmail.com) 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (liuhui1610[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2001:470:142:0:0:0:0:17 listed in] [list.dnswl.org] X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) --0000000000005145f6063a18dab5 Content-Type: text/plain; charset="UTF-8" Hello, The recipe: 1. emacs -Q 2. Create a remote python file and start the remote python shell, e.g. M-x find-file /ssh:server:/tmp/test.py M-x run-python 3. Insert the following code in test.py and press C-c C-c to send it to the python shell: def f(): breakpoint() return 1 4. Execute f() in the python shell to trigger the pdb Result: Emacs tries to open /ssh:server:/ssh:server:/tmp/test.py instead of /ssh:server:/tmp/test.py. The reason is the filename set by python-shell-send-string may be remote. The attached patch fixes the issue. -- Liu Hui --0000000000005145f6063a18dab5 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Fix-pdb-tracking-for-remote-filenames.patch" Content-Disposition: attachment; filename="0001-Fix-pdb-tracking-for-remote-filenames.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_md6x36ew0 RnJvbSBiOTc3MGNlYTIwMTg2ZDAyMDUzMTllZmI1NDMyNzA5OTg0OWUzYTIxIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBMaXUgSHVpIDxsaXVodWkxNjEwQGdtYWlsLmNvbT4KRGF0ZTog VGh1LCAxNyBKdWwgMjAyNSAxMjo0MzozNCArMDgwMApTdWJqZWN0OiBbUEFUQ0hdIEZpeCBwZGIg dHJhY2tpbmcgZm9yIHJlbW90ZSBmaWxlbmFtZXMKCiogbGlzcC9wcm9nbW9kZXMvcHl0aG9uLmVs IChweXRob24tcGRidHJhY2stc2V0LXRyYWNrZWQtYnVmZmVyKToKQ2hlY2sgcmVtb3RlIGZpbGUg bmFtZXMuCi0tLQogbGlzcC9wcm9nbW9kZXMvcHl0aG9uLmVsIHwgNiArKysrLS0KIDEgZmlsZSBj aGFuZ2VkLCA0IGluc2VydGlvbnMoKyksIDIgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvbGlz cC9wcm9nbW9kZXMvcHl0aG9uLmVsIGIvbGlzcC9wcm9nbW9kZXMvcHl0aG9uLmVsCmluZGV4IGY0 ZjA1MThkYmZkLi41OTk3N2ZjYjQ5ZiAxMDA2NDQKLS0tIGEvbGlzcC9wcm9nbW9kZXMvcHl0aG9u LmVsCisrKyBiL2xpc3AvcHJvZ21vZGVzL3B5dGhvbi5lbApAQCAtNTA3OSw4ICs1MDc5LDEwIEBA IHB5dGhvbi1wZGJ0cmFjay1zZXQtdHJhY2tlZC1idWZmZXIKICAgIlNldCB0aGUgYnVmZmVyIGZv ciBGSUxFLU5BTUUgYXMgdGhlIHRyYWNrZWQgYnVmZmVyLgogSW50ZXJuYWxseSBpdCB1c2VzIHRo ZSBgcHl0aG9uLXBkYnRyYWNrLXRyYWNrZWQtYnVmZmVyJyB2YXJpYWJsZS4KIFJldHVybnMgdGhl IHRyYWNrZWQgYnVmZmVyLiIKLSAgKGxldCogKChmaWxlLW5hbWUtcHJvc3BlY3QgKGNvbmNhdCAo ZmlsZS1yZW1vdGUtcCBkZWZhdWx0LWRpcmVjdG9yeSkKLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGZpbGUtbmFtZSkpCisgIChsZXQqICgoZmlsZS1uYW1lLXByb3NwZWN0IChpZiAoZmls ZS1yZW1vdGUtcCBmaWxlLW5hbWUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBm aWxlLW5hbWUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29uY2F0IChmaWxlLXJl bW90ZS1wIGRlZmF1bHQtZGlyZWN0b3J5KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgZmlsZS1uYW1lKSkpCiAgICAgICAgICAoZmlsZS1idWZmZXIgKGdldC1maWxlLWJ1 ZmZlciBmaWxlLW5hbWUtcHJvc3BlY3QpKSkKICAgICAodW5sZXNzIGZpbGUtYnVmZmVyCiAgICAg ICAoY29uZAotLSAKMi4yNS4xCgo= --0000000000005145f6063a18dab5-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 02:42:12 2025 Received: (at 79036) by debbugs.gnu.org; 17 Jul 2025 06:42:12 +0000 Received: from localhost ([127.0.0.1]:52687 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucIJn-0003dT-OU for submit@debbugs.gnu.org; Thu, 17 Jul 2025 02:42:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49368) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucIJk-0003d7-It for 79036@debbugs.gnu.org; Thu, 17 Jul 2025 02:42:09 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucIJf-0001cg-0p; Thu, 17 Jul 2025 02:42:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=H1Dsv4hrDp9CW3YdNG5Ny+26fGrP8wI9inqR5MVSXKs=; b=Gt9hrG1Jj+DU Gd0EW/k7lAHKJBFhcp8tuCYlHOtxq5gRPZ7X8S4y3GtrHAf9Gfp9d5fDJw/pTmgjKOQa65Ep6UbNC mhbZmzVlYmiXzBvOW1F4SLRR3Rnkszuz25dDQYPA17+ek0kQi9ZxsIkW+p9rDODa+xohVhncKvgQa tVup6h5qPrtwU676goEPYtQTJ8SJ+SVfYUX2Aa8635lFCzpmaQv1eFshIrBstT2r0wNT2UA4egXQx lUSEW3roKdRrHFmDnEfUolrdcKbDsO5ltuQstYC2cQtbEZ1uBABa+gBE/FAwhKxNLNJEgXhsuaA3u vxSep6wNwqWD67vELI4g2Q==; Date: Thu, 17 Jul 2025 09:41:44 +0300 Message-Id: <86tt3bgvyv.fsf@gnu.org> From: Eli Zaretskii To: Liu Hui , Michael Albinus In-Reply-To: (message from Liu Hui on Thu, 17 Jul 2025 12:57:45 +0800) Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Liu Hui > Date: Thu, 17 Jul 2025 12:57:45 +0800 > > 1. emacs -Q > 2. Create a remote python file and start the remote python shell, e.g. > M-x find-file /ssh:server:/tmp/test.py > M-x run-python > 3. Insert the following code in test.py and press C-c C-c to send it > to the python shell: > > def f(): > breakpoint() > return 1 > > 4. Execute f() in the python shell to trigger the pdb > > Result: Emacs tries to open /ssh:server:/ssh:server:/tmp/test.py > instead of /ssh:server:/tmp/test.py. > > The reason is the filename set by python-shell-send-string may be > remote. The attached patch fixes the issue. > > From b9770cea20186d0205319efb54327099849e3a21 Mon Sep 17 00:00:00 2001 > From: Liu Hui > Date: Thu, 17 Jul 2025 12:43:34 +0800 > Subject: [PATCH] Fix pdb tracking for remote filenames > > * lisp/progmodes/python.el (python-pdbtrack-set-tracked-buffer): > Check remote file names. > --- > lisp/progmodes/python.el | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el > index f4f0518dbfd..59977fcb49f 100644 > --- a/lisp/progmodes/python.el > +++ b/lisp/progmodes/python.el > @@ -5079,8 +5079,10 @@ python-pdbtrack-set-tracked-buffer > "Set the buffer for FILE-NAME as the tracked buffer. > Internally it uses the `python-pdbtrack-tracked-buffer' variable. > Returns the tracked buffer." > - (let* ((file-name-prospect (concat (file-remote-p default-directory) > - file-name)) > + (let* ((file-name-prospect (if (file-remote-p file-name) > + file-name > + (concat (file-remote-p default-directory) > + file-name))) > (file-buffer (get-file-buffer file-name-prospect))) > (unless file-buffer > (cond Shouldn't this code use 'expand-file-name' instead? Using 'concat' to construct file names is a bug waiting to happen, IME. Michael, WDYT? From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 02:47:19 2025 Received: (at 79036) by debbugs.gnu.org; 17 Jul 2025 06:47:19 +0000 Received: from localhost ([127.0.0.1]:52702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucIOl-0006mQ-EY for submit@debbugs.gnu.org; Thu, 17 Jul 2025 02:47:19 -0400 Received: from mout.gmx.net ([212.227.17.22]:50589) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucIOi-0006lz-61 for 79036@debbugs.gnu.org; Thu, 17 Jul 2025 02:47:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1752734829; x=1753339629; i=michael.albinus@gmx.de; bh=lKTOTkPsU4JMLoeo+mhv/u48qo4vcNXjCNErInz/mmA=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=tZ66fDMQEvSazpkXQ+/mVlQ+Wekx+ctEmN0bGzPUeVktto2oZjaVpwdtdyVpo8UO ihcAb2WLhNjiULwy7Q7IJuBi4oxiRcXtaUe5W4h7Rp8qhxSxQAXJuCwpXd7Hxzsqt V5OhOoqt+E/9kgMwKqwEWt2VNNeHH9/asCgIiEltDmA2ZZRExcHzzpKwXxzLO9x57 wh+JxGZE4Xjn8arRmwd8mvtUvN0q/a+h/Q6B7DN7ZIx7k8c67XKSrsEc8+X6+Fg1x kWhXUpJa7b4b1QJu/c6rNaK5A6ycmk+AoE8xL8DPuZwVo6ncmctq9nB/KKhupjQ/P ikVjNhK/uxTO4JFwmw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.37.61]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N3bX1-1ultBW1AW3-014dgB; Thu, 17 Jul 2025 08:47:09 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames In-Reply-To: <86tt3bgvyv.fsf@gnu.org> References: <86tt3bgvyv.fsf@gnu.org> Date: Thu, 17 Jul 2025 08:47:08 +0200 Message-ID: <87zfd3iaab.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:3s4dR9mMrlhk7+OnN5mZ9a6F/jzlXP6TRDmx/RRgYPGLqhiFQ49 3aA0/e0+kgBmhEb5xW4h1L4j886N/+/QE5LxUUCZZfax6WcgTc4RSOA9p6TivSEl/0w5PBM Cc+OJQMbVeMK3wxl3x/mC/avb5x/n9DGtFEAcjQwZu9Fg8dBozl2Y67mYokDt5XV1373gx0 972SX9OOfjTL/l4WXBRAA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:0R9HrSVHlAw=;5xSjCAVzshR8/x4qLfFmJYJ4GsI vFWOH74LbuLhb2qoPH+GaGxUnRV2SB3j6AdRpBWfVAFfhRj50EQAMdm0jjg7/NWgLHEad59bx uW9tJUFQojeSvhbdgvd2dYxZebusPw+jdmrkq1m62mht2K3m2QCW77ACMmfRWpP7QNRZTI+6E TSoxp1S9/UanngObqMpLnPugkoGUQhJ+EUNyf01l5LEOQuaETe9LHY07hiNpAixuZGgZfgyMJ 63tusriwFqT3qoEK7qpcPDmhtufbNcWIWBGqm9X3TDrXwTnnVzurgDSR7CxEmSz+ADzwO9SQW 6Kdc0hSD7898TJFWp0wq3F+5TbUcpH2/OF2PzUk+jHjZHFfqvoJkwsjpe1IJKmKl9seBCKpEe 8hDZKv77iNXJjcz796orX8J3amqR+JKXBq1WjyGTCYThhihLn6Yo3ZG0ZLRwkmjJXSFMkZnsZ /5lDE30j0nPHdz53YPVGNCdfT2M9JkiDr8yxWMjbqiqbQlglz8eOdHc/9mimYQq9DwBQfCHne cDJQOcV0q3SPxCGOzNPmyHGKkjB3Z7EZQgb07UNijhNta4AgDWGtNXpEIVGwQp5OJ695uTOuK K8gy9MBIbRiNivcbAkCc2k/OB1CXfTiIbpbvIEqmS3yoXIXASQj8hbdMxfaWCqUyPMAzVRPxo wkHOe+qkLhYsn30tFM+8qa5axof1LDnSxmuWYm5xHeL2cGQk5V/oPWu6B35CA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hysb/mT/O8ND6ZQ8qwMTPxo7OvDTBH9BGfHGYcucP74oRJNOVgWpBcqNh5UGMQSHxSdNb5W70 SjeMthqZar+rBuvu5n9MlUV1ewD10c1kLsGu/a3K0gxShrqDArLtDDXtiXJ+nIyEoM2GpKVfu foUZd26aJgVs79ze1PfRrHNGnUpFunBB4VgwKbZIy/aNMPg/56/fuHD1/nni0JNdGHI0kL/km Xg+H+ubcMpT36CWZCScIE5QCJB28M7Qwl5/rKwr2Hs5/FRA3e2+MopCre7Ao/SVceU3TgY+Xp 3d1X6Z/WrbbblNTl/c8eT6fi3+BCYhLrQi9SR/1t5pS7laP4Ad75HQBN1SDjQdzv3uugFIr3X QBV5SV7iTZ5CgqaZGppEXLildlTS//BEEntwJ97n+RAued7UMNGOvuiPoNnOzLLn47LNYe4Cq dXaK3b0HVBXdCFp02sXzGp6oOOJPGbR+XBxSnyBHfptna6xIkwBxxd6dgB5/YIuySEQqxwOzS GkvGrsqVBujDka+Doj+Ye5wXfXLJPnGBCS3yQLg2+eE16oEYJd0sQLHsgABPlHwpc6sl7E9zL Te7TJYNdPD7XOdVXJKTXx++s4BroQ/pDHHC7mYaiBmlUYvF2qJiYl5mGAEm0ZGdj1fdfjRwrH YXl6jlVEdhCXYq8R2EspLc0x2QS3wNn02GwhYztVcadN2zOT3x5PWWo+CgtJGgMdvDuHb3L0s 0+VY1Px/m2HsD3FueH/9MGXbMmspgch2m7kI4VoW+HOTdzPb/lZLyIQsUKMBikQhW6GdvAtfA 08jafHe5wq4057OA8q+HuN3uPKbmiep2p64 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79036 Cc: Liu Hui , 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: Hi Eli, >> diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el >> index f4f0518dbfd..59977fcb49f 100644 >> --- a/lisp/progmodes/python.el >> +++ b/lisp/progmodes/python.el >> @@ -5079,8 +5079,10 @@ python-pdbtrack-set-tracked-buffer >> "Set the buffer for FILE-NAME as the tracked buffer. >> Internally it uses the `python-pdbtrack-tracked-buffer' variable. >> Returns the tracked buffer." >> - (let* ((file-name-prospect (concat (file-remote-p default-directory) >> - file-name)) >> + (let* ((file-name-prospect (if (file-remote-p file-name) >> + file-name >> + (concat (file-remote-p default-directory) >> + file-name))) >> (file-buffer (get-file-buffer file-name-prospect))) >> (unless file-buffer >> (cond > > Shouldn't this code use 'expand-file-name' instead? Using 'concat' to > construct file names is a bug waiting to happen, IME. `expand-file-name' wouldn't work if file-name is an absolute file name. `file-remote-p' is designed to cooperate with `concat'. It mentions it in its docstring. > Michael, WDYT? Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 03:48:09 2025 Received: (at 79036) by debbugs.gnu.org; 17 Jul 2025 07:48:09 +0000 Received: from localhost ([127.0.0.1]:52816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucJLc-0001lE-Jg for submit@debbugs.gnu.org; Thu, 17 Jul 2025 03:48:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59756) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucJLa-0001kQ-Cf for 79036@debbugs.gnu.org; Thu, 17 Jul 2025 03:48:07 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucJLU-000452-Kj; Thu, 17 Jul 2025 03:48:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=f5YBXxxuCa3X7jvBUdPGgkXoYu9KITKMQnQApnFGBlo=; b=OanIzi73NnDH yqd8arrQghh7+beCluFeFu0WCHC+BMKjRy0QzPQXrqra6I2CJRVC/t1Clh3QZFttLm2Y7C9XEdLaR sIonL0PVGBIWtZkvDxPjDddHWp/qn3TqEjrA4vimfpudCk8yipY/dDNSLH12qPzv9GZVjn9XXQ+0e PwDiOcXmUJNVH+SQ/DGhRM1YwrdcXSVeA+vFWCSImEZeSSDLMjXDfmqcv/fE4wXdoTE3QKyb5jGEn w9JNS0/bknedUTvr2UQeMKpI1GhwPXDXKTSnhXJFAs3RqfegbR7AZRcnv4SutkRBEkRnz4Kcpnyka mcy+ePtdHELw61676p/b+g==; Date: Thu, 17 Jul 2025 10:47:53 +0300 Message-Id: <86pldzgswm.fsf@gnu.org> From: Eli Zaretskii To: Michael Albinus In-Reply-To: <87zfd3iaab.fsf@gmx.de> (message from Michael Albinus on Thu, 17 Jul 2025 08:47:08 +0200) Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79036 Cc: liuhui1610@gmail.com, 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Michael Albinus > Cc: Liu Hui , 79036@debbugs.gnu.org > Date: Thu, 17 Jul 2025 08:47:08 +0200 > > >> diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el > >> index f4f0518dbfd..59977fcb49f 100644 > >> --- a/lisp/progmodes/python.el > >> +++ b/lisp/progmodes/python.el > >> @@ -5079,8 +5079,10 @@ python-pdbtrack-set-tracked-buffer > >> "Set the buffer for FILE-NAME as the tracked buffer. > >> Internally it uses the `python-pdbtrack-tracked-buffer' variable. > >> Returns the tracked buffer." > >> - (let* ((file-name-prospect (concat (file-remote-p default-directory) > >> - file-name)) > >> + (let* ((file-name-prospect (if (file-remote-p file-name) > >> + file-name > >> + (concat (file-remote-p default-directory) > >> + file-name))) > >> (file-buffer (get-file-buffer file-name-prospect))) > >> (unless file-buffer > >> (cond > > > > Shouldn't this code use 'expand-file-name' instead? Using 'concat' to > > construct file names is a bug waiting to happen, IME. > > `expand-file-name' wouldn't work if file-name is an absolute file name. I guess I'm missing something: doesn't this code want to produce an absolute file name? If not, what does it try to do? > `file-remote-p' is designed to cooperate with `concat'. It mentions it > in its docstring. So you agree with the patch? It looks strange to me that we should use file-remote-p in the branch where it is known that FILE-NAME is not a remote file name. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 04:18:57 2025 Received: (at 79036) by debbugs.gnu.org; 17 Jul 2025 08:18:57 +0000 Received: from localhost ([127.0.0.1]:52853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucJpR-0003Oo-9S for submit@debbugs.gnu.org; Thu, 17 Jul 2025 04:18:57 -0400 Received: from mout.gmx.net ([212.227.17.20]:45407) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucJpN-0003OZ-Mr for 79036@debbugs.gnu.org; Thu, 17 Jul 2025 04:18:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1752740323; x=1753345123; i=michael.albinus@gmx.de; bh=fzHTYN9OlZCXWpTVM6cB3wQVZz5pvfFf//KOz0d+sCk=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=APnAib2OKnSQE7/WLG3fQw8Vi9zgbO0BVVzVpecsf4704Ku69il7cUx9DUvnJKlk 4OO0xiN+HZjCLzgQ6WpvoS5YnFgujKbBfWPc7rJuWcpLeHyrlaiTxrxhxtMI85qXf 2K+JvDEwahhpwJBC4nHhR+/gat7eImmZIIw53yPEYkb0gj7Q+ZDMjrSzGIRwplWhI kb/OdhRvulzn2VCwJuELBjts7k+4PEFC1Y/2WYlWzPHwMLPu00Zovn4g30HUNMFy3 YZEUVdvVrOQOvTyWcrorUGZ6xoeVcE2gtoX4RT03KHCWGO6/BqieoyGtJHY0fNJWw V2RSTm/JHCambw/Ubw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.37.61]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MJmKX-1uIs4B2RWj-00ORea; Thu, 17 Jul 2025 10:18:42 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames In-Reply-To: <86pldzgswm.fsf@gnu.org> References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> Date: Thu, 17 Jul 2025 10:18:41 +0200 Message-ID: <87v7nri61q.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:jFs+rIn8fxjiU2DMz30uuh11cmd8oin2Bu1xfKwlOycjHRZto4p I4XL+SbgGr5sc0q4JQ7m22UuFuW08UF8LfpMGZG+vo0HYGjGalgo1uhHm+vtXAAVVI5ZrqI MJHRv1Bd3qXZgM8iqJ0Pll8+0CzYC565UNmM+9+w13LRYMOB3Fmy9/njRlRh2QBX65sP5fR CJTFLpiY58WviTctm67uA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:GQ7ixdoCkJs=;qdBUwMZeZ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T8Unk6Hg+IIVNrKoTxzn06dLmJhN5AUw+QCvGUleGF MPmxAQ5PuQYcmwnh/NCtyuv3BDrrU6aKc1ONKFIy2ueyx9p7wG4vmU238L6I3kkmOKSas00PZ ERzmMhAbiWwNnM7O2+m/R0TPTNCmAd65JwLgdhBovLKMCC8ed1uoQ11EuvGx3cutl+NsMnc9a QtyS44mPiNcY0gWgoDGILDr0a/AjpxDc02ZkxEbeKXVxwcNd5kg8hK3Us8+ItaOw8Lw/wwnj+ iDS7obYp9WE9mJcuAc6tM9h1pENYBlsRA56iJ8dnPDMun1Uf11ohOECHZLLHJk0IC9RzdPkzS 98D6fqCcjbkK/oflinbkXmq/YGuJd48T89NSB7KA/KpDBSjR2fkUJ4Up/5SAf+Z8q3NipcPAv X7RX/zWsbL7TyYcPod0B2/cC6Bnlf9FddbEdqQ3rL2eki1mnfKKaVmatgxWkvOFFjUyghFybh 0odghnGilwQUCCfIyA0ZObj7Q9WK0WhQSVt Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79036 Cc: liuhui1610@gmail.com, 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: Hi Eli, >> >> diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el >> >> index f4f0518dbfd..59977fcb49f 100644 >> >> --- a/lisp/progmodes/python.el >> >> +++ b/lisp/progmodes/python.el >> >> @@ -5079,8 +5079,10 @@ python-pdbtrack-set-tracked-buffer >> >> "Set the buffer for FILE-NAME as the tracked buffer. >> >> Internally it uses the `python-pdbtrack-tracked-buffer' variable. >> >> Returns the tracked buffer." >> >> - (let* ((file-name-prospect (concat (file-remote-p default-directo= ry) >> >> - file-name)) >> >> + (let* ((file-name-prospect (if (file-remote-p file-name) >> >> + file-name >> >> + (concat (file-remote-p default-direc= tory) >> >> + file-name))) >> >> (file-buffer (get-file-buffer file-name-prospect))) >> >> (unless file-buffer >> >> (cond >> > >> > Shouldn't this code use 'expand-file-name' instead? Using 'concat' t= o >> > construct file names is a bug waiting to happen, IME. >>=20 >> `expand-file-name' wouldn't work if file-name is an absolute file name. > > I guess I'm missing something: doesn't this code want to produce an > absolute file name? If not, what does it try to do? > >> `file-remote-p' is designed to cooperate with `concat'. It mentions it >> in its docstring. > > So you agree with the patch? It looks strange to me that we should > use file-remote-p in the branch where it is known that FILE-NAME is > not a remote file name. I didn't check the code, so I don't know whether file-name is guaranteed to be a relative file name. The docstring doesn't tell about this promise. I just checked the file-remote-p construct, used with concat. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 04:46:21 2025 Received: (at 79036) by debbugs.gnu.org; 17 Jul 2025 08:46:21 +0000 Received: from localhost ([127.0.0.1]:52941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucKFx-0005On-AL for submit@debbugs.gnu.org; Thu, 17 Jul 2025 04:46:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52552) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucKFu-0005OT-4C for 79036@debbugs.gnu.org; Thu, 17 Jul 2025 04:46:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucKFk-0003vR-C6; Thu, 17 Jul 2025 04:46:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=cpuSpXyjn+JUYoK1dD7yRqVJ2sGTEngFK9VFWGuV06k=; b=DzfxVdWrJI7n YHuAZUENvgiaKiFA9nc8BEdwVw5boB78CBsHjQCPhG6CWILGOygNtyTupY1KZ8JKsRKouIPzoKwRs 5rtXfl4UsfYObWU0RTIez67bM6CVNnxGw9RvQ7jtiV6sNmNELNcUqBFS797O4VhlYHSicXtl3sKIk y0xmJ8OK9RZazIJW+IwQB3jN0t9o4NzEZPDICzaSioFrwdfpvWcphsLBzzhoDoxfEBXsmtUU5IfJs UzbA6JhFjwuRH+NmCYmFQKwr1vTdqyFGru/WJ/zZWbWYYO7PJKFSo2X3H0oji1HPnjtGZcvfMBxwS Juo4n7hQHHZas8N92AqRsA==; Date: Thu, 17 Jul 2025 11:45:55 +0300 Message-Id: <86ms93gq7w.fsf@gnu.org> From: Eli Zaretskii To: liuhui1610@gmail.com, Michael Albinus , kobarity In-Reply-To: <87v7nri61q.fsf@gmx.de> (message from Michael Albinus on Thu, 17 Jul 2025 10:18:41 +0200) Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Michael Albinus > Cc: liuhui1610@gmail.com, 79036@debbugs.gnu.org > Date: Thu, 17 Jul 2025 10:18:41 +0200 > > Eli Zaretskii writes: > > Hi Eli, > > >> >> diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el > >> >> index f4f0518dbfd..59977fcb49f 100644 > >> >> --- a/lisp/progmodes/python.el > >> >> +++ b/lisp/progmodes/python.el > >> >> @@ -5079,8 +5079,10 @@ python-pdbtrack-set-tracked-buffer > >> >> "Set the buffer for FILE-NAME as the tracked buffer. > >> >> Internally it uses the `python-pdbtrack-tracked-buffer' variable. > >> >> Returns the tracked buffer." > >> >> - (let* ((file-name-prospect (concat (file-remote-p default-directory) > >> >> - file-name)) > >> >> + (let* ((file-name-prospect (if (file-remote-p file-name) > >> >> + file-name > >> >> + (concat (file-remote-p default-directory) > >> >> + file-name))) > >> >> (file-buffer (get-file-buffer file-name-prospect))) > >> >> (unless file-buffer > >> >> (cond > >> > > >> > Shouldn't this code use 'expand-file-name' instead? Using 'concat' to > >> > construct file names is a bug waiting to happen, IME. > >> > >> `expand-file-name' wouldn't work if file-name is an absolute file name. > > > > I guess I'm missing something: doesn't this code want to produce an > > absolute file name? If not, what does it try to do? > > > >> `file-remote-p' is designed to cooperate with `concat'. It mentions it > >> in its docstring. > > > > So you agree with the patch? It looks strange to me that we should > > use file-remote-p in the branch where it is known that FILE-NAME is > > not a remote file name. > > I didn't check the code, so I don't know whether file-name is guaranteed > to be a relative file name. The docstring doesn't tell about this promise. > > I just checked the file-remote-p construct, used with concat. Thanks. So now, Liu Hui, please explain the problem in more detail. I stared at the code for some time, and I don't understand why it goes to such great lengths here: (let* ((file-name-prospect (concat (file-remote-p default-directory) file-name)) (file-buffer (get-file-buffer file-name-prospect))) (unless file-buffer (cond ((file-exists-p file-name-prospect) (setq file-buffer (find-file-noselect file-name-prospect))) ((and (not (equal file-name file-name-prospect)) (file-exists-p file-name)) ;; Fallback to a locally available copy of the file. (setq file-buffer (find-file-noselect file-name-prospect)))) Why not just call find-file-noselect with FILE-NAME as its argument? The function find-file-noselect will itself check if there's already a buffer visiting that file, so it's unnecessary to do that "by hand" here. And I don't see the reason for that 'concat' dance, either, since find-file-noselect again does everything that needs to be done internally. So what am I missing here? kobarity, any comments or suggestions? From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 06:21:21 2025 Received: (at 79036) by debbugs.gnu.org; 17 Jul 2025 10:21:21 +0000 Received: from localhost ([127.0.0.1]:53165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucLjs-0001yL-Vx for submit@debbugs.gnu.org; Thu, 17 Jul 2025 06:21:21 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:54571) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ucLjp-0001xs-D4 for 79036@debbugs.gnu.org; Thu, 17 Jul 2025 06:21:18 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-45611a6a706so3950005e9.1 for <79036@debbugs.gnu.org>; Thu, 17 Jul 2025 03:21:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752747671; x=1753352471; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VMia0sVZxfWBmDtKGoQvOkgMKR4ACD2hUTJu4eV1rU4=; b=SB7x7irWMmqfi0IQf1dcL2sVOXph9pNnYII0yxQ4tKzNGMw+1cWs33lAr0fy9rhAly wlHAUv7L0KJ5tcHp72kChxg6n+CUscmyZNiAifcrsdaCk0L6cWN2nI9/67vU7vlZhdDv a0B7rugw84bl/yrMUyhLtmDN/fpHM+jTqQadxukqZY7eHS2hXj+yht6awch/ONj0+S0U qAqxJW3w7nTig23Li8G1/2QM90nFKaURdtxojxeTgnD1qQkuJvAbRMlJXyoA4/jRa7P1 z+F6AhcKgUFcA+6VMyPodP1Hyg6hCs3ZopaSb8YALqICnSBCbtJ0qCGi5FJ5JWko97JF lgyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752747671; x=1753352471; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VMia0sVZxfWBmDtKGoQvOkgMKR4ACD2hUTJu4eV1rU4=; b=t6BSONDE090BSBpQiWMVJEJBRyr5ZiISKdqlAjpkV7T5K+79Bx2GcuM0FNhr4Tbzix GXy8WTweKfZcX1JnYce8LKbrGy56H+R4MMbXpf4syl9by4ALqTZxyb+/03eYNF3foYhZ JJFXBi/b/TsHqqkm2mEE/7ecZzwd1jiMELbqaN+xqyqTwllmgUxRWLQ6YYpMU+WadDPF niFg1MSZZwU0xDLzTOiS0MwwC75uv3DYU2C0P2pbfKQkxuBfVjT5A+qiWCwepxLDdnkl j1PXcd/cppWZe/AQuPWLgkg344WDdlENMs/2bHmdyA9JDVE/kZhI/7algf1VG2B0uqTg DpoQ== X-Forwarded-Encrypted: i=1; AJvYcCUVuNREagByNvN8mhopC09tiYtaNi62Egea2hqPEFki3cRediLDlKlkUrWO2ZHtncrce/OSfA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwYPg5Pcy00M6qVuuNvFIWNVsJa9KWvNECRJyTdfijP0BXzoVzz cCTZ3Ohin5VDGC9cjTmtP3MFxiF1ZsVBe4pfkeUKZfZPN3u8AnCU+lKVnWUrJOeY4sP+c+DEvL1 SxsI58K6areN9GxpOES+nHtJrw7Nksns= X-Gm-Gg: ASbGncsAUtpLSIwmixDhmokNKLDjZOvFmr1s/rCB1Yq7i1qVZhK4BIwEUZuiuZVGdGC jEs/0yAAF8Q8prhmm3o6M3BOK2Ipw0YwLzzEznjOhuf6/babrZK9QGjNtBr0sxMoYic7pcKmy2/ rH+QVJjU45WyvGRpQwtCcKOhGwz+gUee2cjE3N7RyJ//KNiWkck4elO1Mm3VMZYrZiT3RFTY15w Sv7yYo= X-Google-Smtp-Source: AGHT+IEEZRKPiI0o4q00u7bgyeKh7ee+e797FRzIk9d5+QIhNF5ftEgj7XFqnGj8Hek4QxrTfFWmnpIGrAQIKMpDOZE= X-Received: by 2002:a05:600c:450b:b0:43d:563:6fef with SMTP id 5b1f17b1804b1-4562e373e21mr52353055e9.21.1752747670730; Thu, 17 Jul 2025 03:21:10 -0700 (PDT) MIME-Version: 1.0 References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> In-Reply-To: <86ms93gq7w.fsf@gnu.org> From: Liu Hui Date: Thu, 17 Jul 2025 18:20:59 +0800 X-Gm-Features: Ac12FXw_7GbKq9Fnn6cAsCm4r5tNJe_3oKnz_cxKYQfg0e3GIWsUN0S25E01Xc4 Message-ID: Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org, kobarity , Michael Albinus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Thu, Jul 17, 2025 at 4:46=E2=80=AFPM Eli Zaretskii wrote: > So now, Liu Hui, please explain the problem in more detail. > > I stared at the code for some time, and I don't understand why it goes > to such great lengths here: > > (let* ((file-name-prospect (concat (file-remote-p default-directory) > file-name)) > (file-buffer (get-file-buffer file-name-prospect))) > (unless file-buffer > (cond > ((file-exists-p file-name-prospect) > (setq file-buffer (find-file-noselect file-name-prospect))) > ((and (not (equal file-name file-name-prospect)) > (file-exists-p file-name)) > ;; Fallback to a locally available copy of the file. > (setq file-buffer (find-file-noselect file-name-prospect)))) > > Why not just call find-file-noselect with FILE-NAME as its argument? > The function find-file-noselect will itself check if there's already a > buffer visiting that file, so it's unnecessary to do that "by hand" > here. And I don't see the reason for that 'concat' dance, either, > since find-file-noselect again does everything that needs to be done > internally. So what am I missing here? Because file-name may be not the actual file. file-name is actually extracted from the pdb output in the python shell, e.g. >>> f() > /ssh:server:/tmp/test.py(3)f() (Pdb) Generally, pdb shows local file names. But if we send the code using C-c C-c from python buffers (i.e. step 3), python-send-string passes (buffer-file-name), which may be a remote file name, to python process. Therefore, pdb may also shows remote file names. Then, if file-name is remote, we don't prepend any prefix (the updated behavior in the patch) and calling find-file-noselect is enough. If we execute "from test import f; f()" in the remote python shell, instead of C-c C-c, the pdb output is: >>> from test import f; f() > /tmp/test.py(3)f() -> return 1 (Pdb) Then file-name "/tmp/test.py" is local, but the actually file is remote. Therefore, the code tries to prepend the remote prefix of python shell to file-name by concat. There are also other cases, e.g. sending code in a local file to a remote python process, or sending code in a remote file to a local python process. Therefore, the code becomes complex. In fact, I just find a bug when sending code in a local file to a remote python process: 1. emacs -Q and start a remote python shell 2. Create a local python file, e.g. /tmp/foo.py 3. Insert the following code in foo.py and press C-c C-c to send it to the remote python shell: def g(): breakpoint() return 2 4. Execute g() in the python shell to trigger the pdb Result: Emacs tries to open /ssh:server:/tmp/foo.py instead of /tmp/foo.py. I will try to update the patch to fix both problems. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 07:11:18 2025 Received: (at 79036) by debbugs.gnu.org; 17 Jul 2025 11:11:18 +0000 Received: from localhost ([127.0.0.1]:53254 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucMWE-0004Rt-Be for submit@debbugs.gnu.org; Thu, 17 Jul 2025 07:11:18 -0400 Received: from mout.gmx.net ([212.227.15.19]:40873) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucMWB-0004RY-A2 for 79036@debbugs.gnu.org; Thu, 17 Jul 2025 07:11:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1752750657; x=1753355457; i=michael.albinus@gmx.de; bh=8KEDRumDNNmkboKSCxiI2O9PAESa3Nbkyk3GiEUQ4Xw=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=VjLwYIEe+/h3INsBFYFVZrIqJtC00cjOFKxfI7GWXegwpRA63nUbmXweqMTpgYyR aFcdyaxhCMv7sMH4xND4xC1nusQ32m69j3m480lmg8R/Y2rrm+CmheahSvZ+DI6gb yDL3IcncK1fHr0FDdOjnwrod2n2y6ug3DkDPoH56Kn0yLfgKS6T6Hy1RCWh0cw2YA tpGVfEBy4jGvb/4+A83agbWlAEFM+KAiAPEQ24aP14CrD7RYoQk8nFwBTkCXtBaaE aqxc8S1k3YVEprTX5WO7VEVJezUAK2LWogUwm3C9BZHsQO9mKdh57SBXKxqKRK3bg wmgsTOEIp8XDFyjROg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.37.61]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MPXd2-1uGpE23C0w-00QsXW; Thu, 17 Jul 2025 13:10:56 +0200 From: Michael Albinus To: Liu Hui Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames In-Reply-To: References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> Date: Thu, 17 Jul 2025 13:10:55 +0200 Message-ID: <87pldzhy2o.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:Tw2hqlC2PmymjhnJpMgwBhk4ntQWVrEm6tEPhTq/gyfSy5oIAw9 wCjbruf8EmWiWu+zV/grQUjtEn1mrVoGJXFNxPWdO/wVRSqaUNU57oY+A3HYUK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MKc7bEwEsCIB/Oq5o+8E Ki2Xv1PmAmQPJuh6qKXXftXyqVqm9GlwGm+zHeRYezRadQv7IINhBMctloZoWxgXxEWRG5okF YUgQ1Ezyai3dMWy70R8Fdeb8xZHAvIG7c+NmxSgN5Viqrec+YtUWoCTz8986NKGoSTKZS0CVE Elc0brUg4nz7LEs3017KV2QgKll45RkvgD5Zk+z07RvMsr5lJzT3SlA6e9hnXdiOgIltsM5FH 2RmHZ0tJdBpaxJW8IamojwmbXo4kXWZCWphC9ngQ60BPKx2njCWQyRZBFMOUFrbkW6tPZodyc wAFhL2kZFukJxxbfsiSzZaKG5KuhwlfImPSPf/8hce+QZETsfaGaN9ulOkCWOugwwvNTYx4dp iNC+HyfM2YRF6njPNeJeXIhwQNPq70cXOo6jcMWZRK56VVktmww+4lXkkmkex1OS/DPkr+nRd 54gLByVQ6Ts8LM8Sj2fWU5KP+OT95eQjQ/rjAFwEgaEE1Y7MKt5bsngncxmkuVt+BpCj0pJQs /MwhF7HIaDjKN0e0lsJkz4zQcIXwNJDH5Q8Slf39U/T2Y6ZTX843Av7x/jsVxyAmGgVCperpL Yg62H++XMyz8kds3JK6fYKYFht56YGUHvIK X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79036 Cc: Eli Zaretskii , 79036@debbugs.gnu.org, kobarity X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Liu Hui writes: Hi, > Because file-name may be not the actual file. file-name is actually > extracted from the pdb output in the python shell, e.g. > > >>> f() > > /ssh:server:/tmp/test.py(3)f() > (Pdb) > > Generally, pdb shows local file names. But if we send the code using > C-c C-c from python buffers (i.e. step 3), python-send-string passes > (buffer-file-name), which may be a remote file name, to python > process. Therefore, pdb may also shows remote file names. This is an error. python-send-string shall send (file-local-name (buffer-file-name)) . Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 08:09:15 2025 Received: (at 79036) by debbugs.gnu.org; 17 Jul 2025 12:09:15 +0000 Received: from localhost ([127.0.0.1]:53403 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucNQJ-000240-9t for submit@debbugs.gnu.org; Thu, 17 Jul 2025 08:09:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34386) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucNQE-00023S-C9 for 79036@debbugs.gnu.org; Thu, 17 Jul 2025 08:09:12 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucNQ8-0003Kc-By; Thu, 17 Jul 2025 08:09:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=fGMUXw2zEVai25MeZDjP2MF9K0WgvZKci4TBZG1Nod8=; b=WDo83wwltxvnTshYQQy1 qeKyY9RpbkLru1UwGbma2XHtuuXTEnZfwHY3QyWfr1YzEnV9wGY5KMTUmcEaf4MfeN9BWI52eu7TE O087xRxOHiiQJeGbsb6zaV3Yg9C2TRTJXwXZksaHsrMdrpX+n7Mp1Px4Qx0CZRgFDK8ODQNzctDvc ucK7Lr4BGGsSPgJPalROXnGouzRb/trZZiWk3g6mn/UbNWnLsUWankh0BFTfD5lAMkuCpqRps2Ovq Vzu2lY1TJ/eu5FqHd7xUCg5li/t6mL1RB6CV1vQqkh0BDHuhRxPLB49jXEZOLFWGtpkPOjQwdLFpO q9g0b7oAK6aJAw==; Date: Thu, 17 Jul 2025 15:08:48 +0300 Message-Id: <86ecufggtr.fsf@gnu.org> From: Eli Zaretskii To: Liu Hui In-Reply-To: (message from Liu Hui on Thu, 17 Jul 2025 18:20:59 +0800) Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org, kobarity@gmail.com, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Liu Hui > Date: Thu, 17 Jul 2025 18:20:59 +0800 > Cc: Michael Albinus , kobarity , 79036@debbugs.gnu.org > > On Thu, Jul 17, 2025 at 4:46 PM Eli Zaretskii wrote: > > > So now, Liu Hui, please explain the problem in more detail. > > > > I stared at the code for some time, and I don't understand why it goes > > to such great lengths here: > > > > (let* ((file-name-prospect (concat (file-remote-p default-directory) > > file-name)) > > (file-buffer (get-file-buffer file-name-prospect))) > > (unless file-buffer > > (cond > > ((file-exists-p file-name-prospect) > > (setq file-buffer (find-file-noselect file-name-prospect))) > > ((and (not (equal file-name file-name-prospect)) > > (file-exists-p file-name)) > > ;; Fallback to a locally available copy of the file. > > (setq file-buffer (find-file-noselect file-name-prospect)))) > > > > Why not just call find-file-noselect with FILE-NAME as its argument? > > The function find-file-noselect will itself check if there's already a > > buffer visiting that file, so it's unnecessary to do that "by hand" > > here. And I don't see the reason for that 'concat' dance, either, > > since find-file-noselect again does everything that needs to be done > > internally. So what am I missing here? > > Because file-name may be not the actual file. file-name is actually > extracted from the pdb output in the python shell, e.g. > > >>> f() > > /ssh:server:/tmp/test.py(3)f() > (Pdb) > > Generally, pdb shows local file names. But if we send the code using > C-c C-c from python buffers (i.e. step 3), python-send-string passes > (buffer-file-name), which may be a remote file name, to python > process. Therefore, pdb may also shows remote file names. > > Then, if file-name is remote, we don't prepend any prefix (the updated > behavior in the patch) and calling find-file-noselect is enough. My question was why cannot we simply call find-file-noselect regardless of whether file-name is local or remote? And why do we need all those checks with explicit calls to get-file-buffer etc.? From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 09:30:25 2025 Received: (at 79036) by debbugs.gnu.org; 17 Jul 2025 13:30:25 +0000 Received: from localhost ([127.0.0.1]:53598 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucOgp-0006TZ-LB for submit@debbugs.gnu.org; Thu, 17 Jul 2025 09:30:25 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:45211) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ucOgm-0006Rq-Cg for 79036@debbugs.gnu.org; Thu, 17 Jul 2025 09:30:21 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3a6d1369d4eso582522f8f.2 for <79036@debbugs.gnu.org>; Thu, 17 Jul 2025 06:30:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752759014; x=1753363814; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=HtH/zQ9Eh7vYbsvS0yrsT0Km7NGWgRPOOrHJy/uog30=; b=KCQVoVS7si8XTVLp95ypo7Z20Yb1BX/VrV8sQyXz6Sf5FSjUTQgaWd9uPsDae/qyCO N79qJ5AiXdrBQglMZdlQcGEjuS+nW0xrn9F3vLDXTD+Vq1RJCQGQP2KEIWx/wvJUifCb 36QtP8sfxCR63B1FEDPIMF+qefbmXdm5MkhH0tyJDuK+9T38jtT+9O8W6ybbk/xDG1Eq bmuXgpa6awLXIdt8pJm/plvzMxxEFx0SS5Cihqni5YJjBajQQGay1BhJFU4o2un/YgVO QvwNJy34JiK+dhlwpmgtZd1Cu8FLjXdS849fk6kCAUnEAeXLGwY/Fg1wN65eroO1yHVm puhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752759014; x=1753363814; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HtH/zQ9Eh7vYbsvS0yrsT0Km7NGWgRPOOrHJy/uog30=; b=Vu4gK87tVJGGtaAhRenOnu7DIQS5szj+GLKOc1PYCHXOZHU7DIOsE2um2mh9RGKED6 q+1rsZhVtTfYpOCFPyACzb50KJh8YkIcxRpUeLDNgWz1CZOv2ODt8P+ot9mXE1BS0mHW BiLYjgsmOcx9+9Mx+GjXOEtW11F3CPeBFEzDr5+CQ7ifq/S8WlVzo/WdBa9NTc27AnuP orYu/ZRhDSKUYyfmK3dwtUfqXx/xNq6Owb/LWeGITsSbClrivUiFZdlaIVcZSJ/iJphW cT3QZ61pohczDQyZOGZdMhaQgH+jVNcF1CwNEMu7RJoUhKOzXdjcG+b01LL5WYZaDAnG KbFQ== X-Forwarded-Encrypted: i=1; AJvYcCVFSvQnjGDuXveGAwU/KlGhpvo0+fFgUmQVzpQtRTMGhOhK3fB/E9eFFJhbsoCLvzvpkHx2UQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YydsWGl8oT8iNCJsMELxumCszF3sXxlw4JiyG2coPoifrhoHAPY 8vAZbxzsSKq8LjtB8ILeyeXq96XRBAdtNVyiWWg6UFkXlMNP4RfaX0C489uZgtgiriDbcoawVtM JHsBE5Owr232cJLuuOaBR/2U8TtEwBGM= X-Gm-Gg: ASbGncsrjZ2Wpl/8KFXWmOeilmV4Ob+Cnwm3IGp/FMGtDwpHRZr2YE6ILl5iKidC5XL i/3lXL40sPRvqHLSToXXRHAnlU9ZpdQHqa09XOxvicye7BsRK17BLoMQT/pxkNqAvgsRiLgHgmE bNs14FC7gdvT5TPQzC4ANHSHBkm8k0kTyDWGLy1ZnpVzqIMYsKf5nKNU/uiH6evllFmQWH99mMB cvlQAs= X-Google-Smtp-Source: AGHT+IGNFy4ACkcPb1rqKd9qB3O1im2Tp8AVTxfI9UO6S2uGG/UyK7TZfHq6reLS2jhvUcidS0kCVby7o4hQpUrvTjI= X-Received: by 2002:a05:6000:4706:b0:3a4:d9fa:f1ed with SMTP id ffacd0b85a97d-3b60dd6a932mr5080270f8f.13.1752759013385; Thu, 17 Jul 2025 06:30:13 -0700 (PDT) MIME-Version: 1.0 References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> In-Reply-To: <86ecufggtr.fsf@gnu.org> From: Liu Hui Date: Thu, 17 Jul 2025 21:30:01 +0800 X-Gm-Features: Ac12FXy616sWUIIjNnp8kpfy0vsJUMflFllzMqh6z6VZQ60d0eoYFZWYXUYDOJ4 Message-ID: Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org, kobarity@gmail.com, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Thu, Jul 17, 2025 at 8:09=E2=80=AFPM Eli Zaretskii wrote: > > > From: Liu Hui > > Date: Thu, 17 Jul 2025 18:20:59 +0800 > > Cc: Michael Albinus , kobarity , 79036@debbugs.gnu.org > > > > On Thu, Jul 17, 2025 at 4:46=E2=80=AFPM Eli Zaretskii wr= ote: > > > > > So now, Liu Hui, please explain the problem in more detail. > > > > > > I stared at the code for some time, and I don't understand why it goe= s > > > to such great lengths here: > > > > > > (let* ((file-name-prospect (concat (file-remote-p default-directory= ) > > > file-name)) > > > (file-buffer (get-file-buffer file-name-prospect))) > > > (unless file-buffer > > > (cond > > > ((file-exists-p file-name-prospect) > > > (setq file-buffer (find-file-noselect file-name-prospect))) > > > ((and (not (equal file-name file-name-prospect)) > > > (file-exists-p file-name)) > > > ;; Fallback to a locally available copy of the file. > > > (setq file-buffer (find-file-noselect file-name-prospect)))) > > > > > > Why not just call find-file-noselect with FILE-NAME as its argument? > > > The function find-file-noselect will itself check if there's already = a > > > buffer visiting that file, so it's unnecessary to do that "by hand" > > > here. And I don't see the reason for that 'concat' dance, either, > > > since find-file-noselect again does everything that needs to be done > > > internally. So what am I missing here? > > > > Because file-name may be not the actual file. file-name is actually > > extracted from the pdb output in the python shell, e.g. > > > > >>> f() > > > /ssh:server:/tmp/test.py(3)f() > > (Pdb) > > > > Generally, pdb shows local file names. But if we send the code using > > C-c C-c from python buffers (i.e. step 3), python-send-string passes > > (buffer-file-name), which may be a remote file name, to python > > process. Therefore, pdb may also shows remote file names. > > > > Then, if file-name is remote, we don't prepend any prefix (the updated > > behavior in the patch) and calling find-file-noselect is enough. > > My question was why cannot we simply call find-file-noselect > regardless of whether file-name is local or remote? And why do we > need all those checks with explicit calls to get-file-buffer etc.? I have provided an example: >>> from test import f; f() > /tmp/test.py(3)f() -> return 1 (Pdb) Given above pdb output in the remote python shell, the file-name "/tmp/test.py" is local and find-file-noselect will simply open the local file. But the file is on the remote system. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 09:34:38 2025 Received: (at 79036) by debbugs.gnu.org; 17 Jul 2025 13:34:38 +0000 Received: from localhost ([127.0.0.1]:53632 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucOkv-0006lr-QS for submit@debbugs.gnu.org; Thu, 17 Jul 2025 09:34:38 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:47171) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ucOkq-0006lW-8s for 79036@debbugs.gnu.org; Thu, 17 Jul 2025 09:34:33 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-455fddfa2c3so9191135e9.2 for <79036@debbugs.gnu.org>; Thu, 17 Jul 2025 06:34:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752759266; x=1753364066; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=eZbyJ2iFnuTIqFUcAlq2o/SKVsJEqB83NpuvikAG5p4=; b=im+uq+WTyjnYDMvMQK/aJ3BIKh/1C/qRYE3h4/z6s9ITn8Zhmh2VR7u7ZlZv5ewLc2 xp/yglonVM/ltuy89YPNdcXh1OvWUjvLZZnpuQLjLCBICHSNq73AZ/Sz4FgkH1Dx1hlm McAjEqAfSwPNLEfiCM2jZhCazLx7bPfhLEUk2TQYPkBP1AdNh1r65/pflgBFjWfMarWd ibO4BI/IQeh9iDEC/5OL1Ey9pzHTJjNQm/qIms20k3q5XJp6/KoE4ox10P4W7lHe3GpQ S03flFJCKyAuV6oQWDsmKuj3H7+5IDN0Fjh/5N3ApSYEmqVmllpjnpPSOi519qzK8sb6 kAuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752759266; x=1753364066; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eZbyJ2iFnuTIqFUcAlq2o/SKVsJEqB83NpuvikAG5p4=; b=KKHUXvRo4WYs3iHCFiDwn14Fk3Io5230Ch/M3a1ob2NE2dWAP8tURoQTqC0bC/8Edo fNt7M2mUZnwzwFwMRS179ror2W18JE1d7OXWEn9bi7LGN1s46FTL+ONUCTE6q+OInw09 pvSn+touXJ8zFHipnORVaY2GE2xP8Nbs5/5TQLtGmpyRDnmAsefrOGgCC9XkfcgJKMuj 6P75PwZHeHfnBgyuLiFyrKJEy0Y7ohdpORwMw0aVYMxD71WuY8N8U9cdX5ZZ77Kg+i0R W6eNfCF4IA8C9MbKtXWeCSdGjtA1EM8jONyfQbOEQgfjWvYvlxO0mG+BMdRlrJB2kJVW zvWw== X-Forwarded-Encrypted: i=1; AJvYcCUKEoD0RTqKZE9NzyQSb9082TeUzb6MsVdZQqA6IQs3oLWO6XcgM9Zv0gXjFCZ2esdXtpFKsQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzU4ZyFbTHoWp3pIzmbGTcOHfapRLAOAFKSI/Q1GburW/i3Shuc qy4xbHAJqYtOZ478eeO4jsNyIdO33SBGAOHtK/L9rzPpGo6BTJXRoXPcxzNDpeFn8GA8QsxKcxU OA5gAGOaEa4vYIK13Lo/aqFfaiVMQtC8= X-Gm-Gg: ASbGncsx2XNJxkpSxZQjp9yE53Fe/jTzwTZtVlppU9qwFWw2YFtRyCxbarrRlY7QWVR DQXWD72ec2lpFAGOZIG5F3Bojah2vhXCV7zaWpTHRSJeM7mIEfj2oCNEq4atuPc///cYEb4Kao3 qTJTaz+Je4iXrX9dB5cnHBO81L6ZI1K3a35Myj+g09oyZ4Gsb1v+tbB5WIHUUgjAXwCXyk06GOX f3/Stc= X-Google-Smtp-Source: AGHT+IHJHSRrrQGhGz06ruBdf8jAKosKmlF6u5Dv0cXbWaT+EPo6WI9A55Y3j/h2KZeJoVKnWz9z8/jUNCZDk2PFWFU= X-Received: by 2002:a05:600c:1c11:b0:456:1b51:67fe with SMTP id 5b1f17b1804b1-4562e276f79mr78233175e9.16.1752759265461; Thu, 17 Jul 2025 06:34:25 -0700 (PDT) MIME-Version: 1.0 References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <87pldzhy2o.fsf@gmx.de> In-Reply-To: <87pldzhy2o.fsf@gmx.de> From: Liu Hui Date: Thu, 17 Jul 2025 21:34:14 +0800 X-Gm-Features: Ac12FXyB6owkgf0vLnnk3F8oFYOllOeJWgqXWvifNCDWZNzH9w4SkvtSfPeY5bA Message-ID: Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames To: Michael Albinus Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 79036 Cc: Eli Zaretskii , 79036@debbugs.gnu.org, kobarity X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Thu, Jul 17, 2025 at 7:10=E2=80=AFPM Michael Albinus wrote: > > Liu Hui writes: > > Hi, > > > Because file-name may be not the actual file. file-name is actually > > extracted from the pdb output in the python shell, e.g. > > > > >>> f() > > > /ssh:server:/tmp/test.py(3)f() > > (Pdb) > > > > Generally, pdb shows local file names. But if we send the code using > > C-c C-c from python buffers (i.e. step 3), python-send-string passes > > (buffer-file-name), which may be a remote file name, to python > > process. Therefore, pdb may also shows remote file names. > > This is an error. python-send-string shall send (file-local-name (buffer-= file-name)) . Why is it an error? In python-shell-send-string, (buffer-file-name) is finally passed to python's compile function in __PYTHON_EL_eval or __PYTHON_EL_eval_file, and is just used for run-time error messages according to the docstring. The filename argument should give the file from which the code was read; pass some recognizable value if it wasn=E2=80=99t read from a file ('' is commonly used). I think it is suitable to use a remote filename or even buffer name as long as it helps Emacs find the source. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 09:45:05 2025 Received: (at 79036) by debbugs.gnu.org; 17 Jul 2025 13:45:06 +0000 Received: from localhost ([127.0.0.1]:53704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucOv3-0007Ur-4M for submit@debbugs.gnu.org; Thu, 17 Jul 2025 09:45:05 -0400 Received: from mout.gmx.net ([212.227.17.20]:53075) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucOux-0007TL-QH for 79036@debbugs.gnu.org; Thu, 17 Jul 2025 09:45:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1752759893; x=1753364693; i=michael.albinus@gmx.de; bh=R/n1ppvwdEQhBP6I++DniPU283+vm1lTHargGvoKgA8=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=Gj7A/VY6odGLqeCuukR3meWN6aj+3rcuutyLpWwYs+m2aVL0yKPwTge2gn3PcFGf CuDdbfZw5oZLQ/9dv7XgijY+ZCO1L5Isi3tgS6u8rTg2lZA1c3P1UtONotGFc1EWe iHyTkZQX2CpJEM6ltAvVxpT27p05KjhY8y9RteU8Ul4voIbiSbK+PIAPVqtmKJLpN 5BRDuKqwKrDBF6K0MUwejYWMtdroLX0H9AgAba76sy3jUey/rN8BE33jR+MOW2Fww lhKOIgOVL6O+SCkV598zelpUIygLz4BxfLr+OA7QpDu8qsGkAF1snyzExjOroDf6z ZurRBMZa+DWvl5qxKg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.37.61]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M6DWi-1uVm8r1BCC-002etW; Thu, 17 Jul 2025 15:44:53 +0200 From: Michael Albinus To: Liu Hui Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames In-Reply-To: References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <87pldzhy2o.fsf@gmx.de> Date: Thu, 17 Jul 2025 15:44:52 +0200 Message-ID: <87jz47hqy3.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:p2RCsD4NOGLT01mGqzzZ8+zpSUXUN+J/ikYiBG/licLuKC7bgbI OoX0WC6EslX0KKm3pHckR2+pI3NZK6ywk2dz1I2LPdVaGeswFuIRJxEiIxuqGKBSt2IF2Go nu5ZCZrpJzKF4iFl+r2rOhBYxLRQ6k+vQEav1oqphDDU8b6mDLXpW4UmRfWX3P1AxUQOFBm 5tNj5OXrC7yf1Py2nlwUw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:w7verkhysJs=;+HkrSLdRRpu0MGejQjhcLPbi35X FCw0kI8l4us+jTAnGkv03RzgXt4B62CN/bm3xk1fBUADOwDGbaqATNEGPFT05Vhr+VZedev/r hCL4H9XL7kOyt/BymCOR4BcriuOmXo3/vgZfQM1LDqejYkLzzon2aHlJqsau8cLcMJ/kkFPvy EOIFP/RRxKmAjuPLX/oJCeXPp+XKXJDQvJ9uvWeXOmvZvXnqb9BuiHEnWJxcm7YIy/lPkDJcO MMUJdFtvvVvG30+U0qPEWRUt/s8GPsSJsa7tXgPKKPO70nnJMwlu359kYXiHACXUdFBGL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ITRbTs7kX+oTePOlkA1Z7BF/sPfFIaeJm8cF69pJ690mOcncCvMFKjXa+WIDI0WU2dv/4L 2+D7VwRcqIrYYvTAEiX7R7/MHA6rfdKMHqIFry2mUmZHpWu8dYnFVAitTjINSmvBWbv8AbonL aJ2y20+njETdSCi8lfC98PSUUy1knOkJ1toWGqg4u4A0wF1goyC1Wkk5vr0zln+dAHfz/e+GG pBCvvn4OxxB7ZnL9+vA0lrFEwL X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79036 Cc: Eli Zaretskii , 79036@debbugs.gnu.org, kobarity X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Liu Hui writes: Hi, >> > Because file-name may be not the actual file. file-name is actually >> > extracted from the pdb output in the python shell, e.g. >> > >> > >>> f() >> > > /ssh:server:/tmp/test.py(3)f() >> > (Pdb) >> > >> > Generally, pdb shows local file names. But if we send the code using >> > C-c C-c from python buffers (i.e. step 3), python-send-string passes >> > (buffer-file-name), which may be a remote file name, to python >> > process. Therefore, pdb may also shows remote file names. >> >> This is an error. python-send-string shall send (file-local-name (buffer= -file-name)) . > > Why is it an error? In python-shell-send-string, (buffer-file-name) is > finally passed to python's compile function in __PYTHON_EL_eval or > __PYTHON_EL_eval_file, and is just used for run-time error messages > according to the docstring. > > The filename argument should give the file from which the code was > read; pass some recognizable value if it wasn=E2=80=99t read from a fi= le > ('' is commonly used). > > I think it is suitable to use a remote filename or even buffer name as > long as it helps Emacs find the source. This bug report is about an inconsistenccy in pdb. Sometimes it shows absolute file names which should be interpreted as remote file names. Sometimes, the file names are already prefixed with the remote identification. If python-shell-send-string does not use remote file names, your patch isn't needed. The existing code --8<---------------cut here---------------start------------->8--- (let* ((file-name-prospect (concat (file-remote-p default-directory) file-name)) --8<---------------cut here---------------end--------------->8--- would be OK. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 10:23:38 2025 Received: (at 79036) by debbugs.gnu.org; 17 Jul 2025 14:23:38 +0000 Received: from localhost ([127.0.0.1]:55080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucPWM-0002CL-6a for submit@debbugs.gnu.org; Thu, 17 Jul 2025 10:23:38 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:58541) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ucPWH-0002BW-TX for 79036@debbugs.gnu.org; Thu, 17 Jul 2025 10:23:35 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-456108bf94bso6978595e9.0 for <79036@debbugs.gnu.org>; Thu, 17 Jul 2025 07:23:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752762207; x=1753367007; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=T6WgvkSeX4TQKDE0JN35auYT0uZl3yojolOkGMHtlBo=; b=TF87P7pZbBVRS1lnYZhUKgq8OE0UTV/9OEqiQG/cVteyWdGiMg1eC+1Zf6J6mkABOM LqbOO8OJ1RvgbmPsUZz7T6FWkN/6CBecHa8mtklJ8vcKW7o9jqdxgHkYe02bkzn/mf2S wXNLBXKDiTBMzvmiFq2amX1eKDXgnSVeWcudTk6fO3wLWAR/+UbsnjXf4VHhJH/ABqYV StwU52Ool2k1N7/35Sz0Ox2245zZ/hUimRdQF1HMwhtTU9uh005bLoeYYiMzQ62ZS4b/ vfb6xR+0JpN0bNmN2/tSmEzfvYdzK6IGvYJ4KIpFNlStU6eCUi9W6V+SGDk32l0zBuKJ SJJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752762207; x=1753367007; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T6WgvkSeX4TQKDE0JN35auYT0uZl3yojolOkGMHtlBo=; b=XYDTpRncBaM0GQa0u7iQxxlJUZcvGE5b9jyfv2QR93xdprhZmq93W1pTkxPgI8thyC v/6s/rj5sNNGHsrFoHmRyv66sB3yTRV2h4KOnH9vNjE3Pkgjea9fBdo6DIgFaSNEbkMU 5p/l4y/ulitsuLvw9onCvAIWoTH2dcCcgvWsKJu8eqXa05mgKmp+SXdkjP3zdmhBe+hW 2H965J6SCqZvdPHOKpwGlnvnShYy9PuFuGgi+0iZxHZpmBbQEtGsX31bvR6E4jWUMPDM ca/d0ht6nlHnvlmpsKvTkw9llxCjfK7tUF42ueEwhDZ7fho1+FzzdQiAK8fvFVu37jBF esqw== X-Forwarded-Encrypted: i=1; AJvYcCUwsQ3ngIlhIjY68rtJVrrdghp24P/tD2TvC6W7TzGJPiSlJS9DvlpdC+XfCd0Gbf/GnLEzBQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0Ywuk5MYNwkKwqpn5hGCLK7Tl3dTohlxF+nONlepRIy6nOTzUg+1 98Ldlsc/EhVWBk4lgM18nlce4RAlmEpeUZnqxnUHkM0RP0rxg+129c2pQDfNiDDrfPL5V1cUbcE yqeVQJ+5K8IkurnoDud5HAfliOiWIAW4= X-Gm-Gg: ASbGncuYXWV0Vl4OZy1v/sUxkUcRFIJZwJygXWGKD9u7DjXmc/okSf/yJ2MCJzFQVii INzl/B5G0/yGxVX0CLVrpRGRaCdIoL8TezC3XMhBJhZkPxkQrpMfDyn3bVNvGwevpw+ytjTI0D6 UyRqoFT1msxsWuLxbpiKcEMSpEaBQNAMEwFLmlbH9HPwWpL9RNyI8Zq/EDlp0fBcoAQ8jFFNi/O tZmV2k= X-Google-Smtp-Source: AGHT+IGGGzM58o8GO/DjQlVbc6SHejhLhjQJzIoa7SF6SDPUG8MStvaoZinz8Jhm43BDzOlM+fUV0vAtIW4suABpRhU= X-Received: by 2002:a05:600c:4ed1:b0:456:24db:2efb with SMTP id 5b1f17b1804b1-4562e361e50mr72823725e9.15.1752762206957; Thu, 17 Jul 2025 07:23:26 -0700 (PDT) MIME-Version: 1.0 References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <87pldzhy2o.fsf@gmx.de> <87jz47hqy3.fsf@gmx.de> In-Reply-To: <87jz47hqy3.fsf@gmx.de> From: Liu Hui Date: Thu, 17 Jul 2025 22:23:14 +0800 X-Gm-Features: Ac12FXxewTBMDONpYtIMP0xQp_DllpeDGAuFM64R218HSBcjkZ3yKhXsYhrC7a4 Message-ID: Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames To: Michael Albinus Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 79036 Cc: Eli Zaretskii , 79036@debbugs.gnu.org, kobarity X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Thu, Jul 17, 2025 at 9:45=E2=80=AFPM Michael Albinus wrote: > > Liu Hui writes: > > Hi, > > >> > Because file-name may be not the actual file. file-name is actually > >> > extracted from the pdb output in the python shell, e.g. > >> > > >> > >>> f() > >> > > /ssh:server:/tmp/test.py(3)f() > >> > (Pdb) > >> > > >> > Generally, pdb shows local file names. But if we send the code using > >> > C-c C-c from python buffers (i.e. step 3), python-send-string passes > >> > (buffer-file-name), which may be a remote file name, to python > >> > process. Therefore, pdb may also shows remote file names. > >> > >> This is an error. python-send-string shall send (file-local-name (buff= er-file-name)) . > > > > Why is it an error? In python-shell-send-string, (buffer-file-name) is > > finally passed to python's compile function in __PYTHON_EL_eval or > > __PYTHON_EL_eval_file, and is just used for run-time error messages > > according to the docstring. > > > > The filename argument should give the file from which the code was > > read; pass some recognizable value if it wasn=E2=80=99t read from a = file > > ('' is commonly used). > > > > I think it is suitable to use a remote filename or even buffer name as > > long as it helps Emacs find the source. > > This bug report is about an inconsistenccy in pdb. Sometimes it shows > absolute file names which should be interpreted as remote file > names. Sometimes, the file names are already prefixed with the remote > identification. > > If python-shell-send-string does not use remote file names, your patch > isn't needed. The existing code > > --8<---------------cut here---------------start------------->8--- > (let* ((file-name-prospect (concat (file-remote-p default-directory) > file-name)) > --8<---------------cut here---------------end--------------->8--- > > would be OK. Yes, forcing python-shell-send-string to use local filenames would also solve the original problem, but may cause other problems. For example, when sending some codes in a remote file to the local python process, without the remote indentation, pdbtrack cannot find the remote file. So I think using remote file names in python-shell-send-string is a feature rather than a bug. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 10:31:34 2025 Received: (at 79036) by debbugs.gnu.org; 17 Jul 2025 14:31:34 +0000 Received: from localhost ([127.0.0.1]:55124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucPe1-0002oL-IB for submit@debbugs.gnu.org; Thu, 17 Jul 2025 10:31:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43798) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucPdx-0002nk-6g for 79036@debbugs.gnu.org; Thu, 17 Jul 2025 10:31:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucPdq-0004u9-SL; Thu, 17 Jul 2025 10:31:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=mZzEYDTRyntH+fKhCIB50tWc9Tdf8jCwBTMXklrAfec=; b=k1hMDhFmrirwM8pK5jtr LUO6m3RvpGLq9N0B2getLmRgGk8BqGPOvp8tVEHXOoe+1MnNGfdV5fhXegPKGcjk6zQWQhF0jaBkc 32nhV5yCnkdNzQlBoSB5Xwir5gTAuzelbbr1AE2xtqGJfGx+Lh9sPJlw6ZAzwXqW1mm/k2OwTcTUy cvKCn98j0vIzXF4Qd/hSSyJ3J+kojas00RQBf2o/x2eitpsJWDB2MQ4r4F0t2K6cqw5JYs9WVS+QR NV20CpaTsvAEvfG9vqosXvl2t8e/OrTwH89YTAzmbEpn4vAyJ/d/YnLFbWuPy2AhKTjKbSMMMHO2S 56NWoK9IJT+4Xw==; Date: Thu, 17 Jul 2025 17:30:41 +0300 Message-Id: <8634auhotq.fsf@gnu.org> From: Eli Zaretskii To: Liu Hui In-Reply-To: (message from Liu Hui on Thu, 17 Jul 2025 21:30:01 +0800) Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org, kobarity@gmail.com, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Liu Hui > Date: Thu, 17 Jul 2025 21:30:01 +0800 > Cc: michael.albinus@gmx.de, kobarity@gmail.com, 79036@debbugs.gnu.org > > On Thu, Jul 17, 2025 at 8:09 PM Eli Zaretskii wrote: > > > > My question was why cannot we simply call find-file-noselect > > regardless of whether file-name is local or remote? And why do we > > need all those checks with explicit calls to get-file-buffer etc.? > > I have provided an example: > > >>> from test import f; f() > > /tmp/test.py(3)f() > -> return 1 > (Pdb) > > Given above pdb output in the remote python shell, the file-name > "/tmp/test.py" is local and find-file-noselect will simply open the > local file. But the file is on the remote system. Thanks, I see now. 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? 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? From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 10:46:29 2025 Received: (at 79036) by debbugs.gnu.org; 17 Jul 2025 14:46:29 +0000 Received: from localhost ([127.0.0.1]:55233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucPsT-0003w3-23 for submit@debbugs.gnu.org; Thu, 17 Jul 2025 10:46:29 -0400 Received: from mout.gmx.net ([212.227.15.18]:34481) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucPsQ-0003vM-4T for 79036@debbugs.gnu.org; Thu, 17 Jul 2025 10:46:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1752763574; x=1753368374; i=michael.albinus@gmx.de; bh=HpMsXaglxuEgYkI2PQPcYwa46VKGC29lZPxeZJ9kMRQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=Wyc0cJ++dkgyRmux66HKEE5O+phlMVVkcoJhiGUlFeYEYBP+CFT0xEj/kSB8bWV6 uWHJpdPQyIxv5qb1+wLUtJmrLyxDaqST6+meMVu/+59cIuGgTe6DjdSZDCsTG6jfK bbRLeC/wV/TGiRp3ioYxX/Ono/6AxxpQ+d/8/c3HvkRdZImpZ/q0aJXL244idrGDt fbaiRY4Auaa57UBup1BPDSodp5IJ6xRlbBNfS/uPu6bTg7Peb494SceSs2gxFrbzT 6C+XENGwcNfqB5rm7j/pEhK31786o4r3RWn7sWN58/oJmjWR3TI6XgN/V7mxFU2LH jBvpGCVfrqUvgJoPBg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.37.61]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MTRR0-1uB0aQ0bim-00NIQp; Thu, 17 Jul 2025 16:46:14 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames In-Reply-To: <8634auhotq.fsf@gnu.org> References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> Date: Thu, 17 Jul 2025 16:46:13 +0200 Message-ID: <87freuj2oa.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:1A0+kyKvmDPadKnD/93TbG4Q9KJZoxDWMhqEFVGmaTWiJhahn7z icQ/brVqIScjleCI2Baez0teFGHYnOXqkejIbO+9Xth/SLxo0v7dYTaqHrXtOKx3ynQYeab iuBj4m8U/vB1XjItbM51JX58z1hJv3lghOozsOH2SHlCfSKR1vVu3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+39ZTDKR5NFGPzTI/50gqzXspyv44ehCYLVpCFb/UOYY3vW5 q60h881MUfMSopthjspQnfnIlFn+njLHIx0vTugCrcPmGdA7xpxttnH+P5+w+hbh7Y8mnLxDt iFtQaQPoT6FK5EYZ+IPKqyxu++vSjE3qgFP9vABmPwnsE0Y++1k5j5q2ZJo8UgxbcOM+ZlOj8 qR8gpeqSP+VN16RIrTSezHUZjOdwItPfkm7pLFY4ylCEhst+VN7xbaUl1lM3+D6sFcFViBD11 gGWfpatjxEoytovRgiYqU6VhOJS4jDbOirA1FRnKr4/tDiO3gSVDTGDNsOwwdYv229sj0jvZY T6nbiSgRMspg+jbzxsokVJOWJFgouH0E2E/c4Bxs5Lba/lpTCi26qadouWg5ZLKYKQeupJ9WI 7AUZaxQdj46jalOYsDThGdwAiuuW4T3gEIYOio5gUBFFb+cxhc9lPCe71jYGQul39/zUTyblt XR4egjJ+VclqXN1H70KewiGcrs0Du+Wn3Klw4tL1M2iRyEvO0/K5uoEvQtIFYi13++kttfN9x pMCKOakfhIqdtQ= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79036 Cc: Liu Hui , kobarity@gmail.com, 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: Hi Eli, > 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--- Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 11:00:45 2025 Received: (at 79036) by debbugs.gnu.org; 17 Jul 2025 15:00:45 +0000 Received: from localhost ([127.0.0.1]:55326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucQ6H-0004tz-Em for submit@debbugs.gnu.org; Thu, 17 Jul 2025 11:00:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53504) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucQ6F-0004tO-1d for 79036@debbugs.gnu.org; Thu, 17 Jul 2025 11:00:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucQ69-000184-Gj; Thu, 17 Jul 2025 11:00:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=TR8pnBDVSCzR1rbTnuAB/BmD0Sn3R24loEAr+JR+sjA=; b=Y7szUhGgLZOz sa+90Pi+M5h+o2S8QmKNf/v50oLunHqPVORfNd5p9hj0CG2qbf2QRrpl/rG3GUc4r7qQiVXvJww6V uKbrxOiEyvwN0oJj5iaRkgBNBaHWcyqTlRSPLJdR95MOe2zFY4ESbjBHRbQEs9IezAkfatSJufNHt rAW2iHTYhxzAMpN0Oa5aIHmMxbJp27EkA82yPOqlZMGRDcuw0yxvqEUwZQYzjhf+lisEvboM16Wqq 2CLW02EEspG3iiWB49QMS+5gSJkK8AWGtmFoAfLwRHtkaAlYVDIcjvhBrOc2mBoxs424fYGzrHlDE 32Aj5lTIkxP/fYeZxn26aA==; Date: Thu, 17 Jul 2025 18:00:34 +0300 Message-Id: <861pqehnfx.fsf@gnu.org> From: Eli Zaretskii To: Michael Albinus In-Reply-To: <87freuj2oa.fsf@gmx.de> (message from Michael Albinus on Thu, 17 Jul 2025 16:46:13 +0200) Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <87freuj2oa.fsf@gmx.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79036 Cc: liuhui1610@gmail.com, kobarity@gmail.com, 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Michael Albinus > Cc: Liu Hui , kobarity@gmail.com, 79036@debbugs.gnu.org > Date: Thu, 17 Jul 2025 16:46:13 +0200 > > Eli Zaretskii 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. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 11:09:32 2025 Received: (at 79036) by debbugs.gnu.org; 17 Jul 2025 15:09:32 +0000 Received: from localhost ([127.0.0.1]:55389 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucQEl-0005TT-NE for submit@debbugs.gnu.org; Thu, 17 Jul 2025 11:09:32 -0400 Received: from mout.gmx.net ([212.227.15.18]:51663) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucQEj-0005St-64 for 79036@debbugs.gnu.org; Thu, 17 Jul 2025 11:09:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1752764957; x=1753369757; i=michael.albinus@gmx.de; bh=TsSoBnOqX60qjMiGYZ/MAwMRjBo2jZu0fjNAGP8V5xs=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=M6EaoOlnNAparDFeaZUOzkhlsv4McpRJ7aIWdFD8s4U3YzR+NP0YUv7Zi3UBNegs ZNHF4fYqJvhec/fKJ+J08mWxbgHxggpyqC1FvH1+uKWmctioUEir61iuM8Y19J9ck fZzOiigMtIbbTt7OyfekKpz4ZoDsVbM4HKPqkN0aM0Z79Qh2nmWgFTVTPohUjiij9 3pSySgIs+/ofg6k+FhkNf3lxEw1cdJjqEawg/B4+okLZmp85TDwUwhY/XfxYpb+te uW1m5FBxazUT2DpW8FLEECpVu24ZMhw326qeDO4DeYh0mVlhZyCbh1m27VytZ6OUR 8sBwXFJkXJPFVBseHQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.37.61]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N7zFZ-1uhJu52MqJ-00quXA; Thu, 17 Jul 2025 17:09:14 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames In-Reply-To: <861pqehnfx.fsf@gnu.org> References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <87freuj2oa.fsf@gmx.de> <861pqehnfx.fsf@gnu.org> Date: Thu, 17 Jul 2025 17:09:13 +0200 Message-ID: <87bjpij1ly.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:27YK4E3S/EQ28HYzzj6LjTRuO+X1m2VWgjVCKCXjE3qLX/8iEfO 5+i+AqN2jv2UdV4yNFtsdTqBxDkDqU5ZCnqU0IBYu2yIffOBK6XBFa/u0S08lBCtOoAjBoK UQJ/prD6tRByndj7ADs9wWbO+L3cQU0RCuWRq1clWOJaUfDPZ0nALduwpiH4Wn53gEWToNL Ra4ulxmH8m6ZSuyXj+XvQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:jVeWhIe6+YI=;8CSkhOS/3MgSQLlC4yNvsysDvzy hexdpx4I6Ty6MIS8Qc6To+CtlVz0PPbw7BIStyZ3wpCj9sFSzA9umT9j6J051xO5YCElKJGAY ANk5tjtEYxZdq/vuv2nEv+UwDMGIKtpzncKvpDzzIQGRGIpoKIws/C8onKZaCRJadri++DfTz nuFG1PZWcHQoLkZWDOpEAGXYDQftlsaHbTM8xM7XW+Izhy1hYbuHhieoM07Ta3KIFVXudIQFY qcneeTz/vgsawh35sFQfnmOtU97L4t9ACsdZfQAwpOAKL6V8LTiIKVNyQ775u3ckRLFVng6pl 6Ck2toOYMM4Xjwkn306OEJeGULpN97N/BswTd6mOW6XuLQVxVXHmo/ftoM4u2/BfZr0uwaHRV HBJnW77kYH4+2dRSoIIUS3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PRwsyebuO29Am1U7TiDwmcVsYCvRaahIh6d2oARJGhE0vwtz6qs+0C2Z/uqKyIdu+u5 3Fo8e8nxxoUQw5K8lAaZyaHJAL8M06pmEfNCPW+3r/BlMyPSh2XMgYaFQ== Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79036 Cc: liuhui1610@gmail.com, kobarity@gmail.com, 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: >> > So we need a function called, say, remote-file-name, which, when give= n >> > 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? >>=20 >> No, we haven't IIRC. Something like this? (untested) >>=20 >> --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. I have left it out by intention. expand-file-name has a price on remote systems, it should be called explicitly by the callee of file-remote-name. So maybe we do something like this: =2D-8<---------------cut here---------------start------------->8--- (defun file-remote-name (file) "Return the remote file name of FILE. If FILE is a relative file name, return FILE as it is. If FILE is already remote, return FILE 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 (or (not (file-absolute-p file)) (file-remote-p file)) file (concat (file-remote-p default-directory) file))) =2D-8<---------------cut here---------------end--------------->8--- Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 11:46:02 2025 Received: (at 79036) by debbugs.gnu.org; 17 Jul 2025 15:46:02 +0000 Received: from localhost ([127.0.0.1]:55596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucQo5-0007td-DO for submit@debbugs.gnu.org; Thu, 17 Jul 2025 11:46:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51462) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucQo2-0007tG-SM for 79036@debbugs.gnu.org; Thu, 17 Jul 2025 11:46:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucQnx-0007io-2E; Thu, 17 Jul 2025 11:45:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=TdIgasLKgvDCNVQmQlLlsPWGap+AxMAP4jheOTt4QXE=; b=Kcc69VEDzuBS 5ImqOjo2tCq2MifOY8MHygp2t20/XSjFLWTuXb/DWfcGAK9imEobVeENqsu8mCLYoajPkiyObLwnI u9SVHJ6fgBTdFDK7NoX2hjMkssDwNwsf/dcFDo30mCdInmJJzBBkRe3Iu2eE4L8N+15D3YNV6UAJG CSRt7yLEqM9P2DqdRHaLDDCZIFtOSSDhrU1LchFRGcd3dPneefeghQVlrSj0xls2w2Cu457N/VCPU gtTrqzs79/1ugjmJCCrX0elIDIuBzK4Ns+WypkvudyVwtF1U+PTuejKjIzV31tknLlBzk830EckEF guniZ4APbTAcIsP8hXR6QQ==; Date: Thu, 17 Jul 2025 18:45:22 +0300 Message-Id: <86zfd2g6st.fsf@gnu.org> From: Eli Zaretskii To: Michael Albinus In-Reply-To: <87bjpij1ly.fsf@gmx.de> (message from Michael Albinus on Thu, 17 Jul 2025 17:09:13 +0200) Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <87freuj2oa.fsf@gmx.de> <861pqehnfx.fsf@gnu.org> <87bjpij1ly.fsf@gmx.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79036 Cc: liuhui1610@gmail.com, kobarity@gmail.com, 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Michael Albinus > Cc: liuhui1610@gmail.com, kobarity@gmail.com, 79036@debbugs.gnu.org > Date: Thu, 17 Jul 2025 17:09:13 +0200 > > Eli Zaretskii writes: > > > 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. > > I have left it out by intention. expand-file-name has a price on remote > systems I meant to call expand-file-name only in the local case. AFAIU, if file-remote-p returns non-nil, its argument is already an absolute file name. But the alternative: (concat (file-remote-p default-directory) file) will not necessarily produce an absolute file name. > (defun file-remote-name (file) > "Return the remote file name of FILE. > If FILE is a relative file name, return FILE as it is. > If FILE is already remote, return FILE 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." I would like this to be the equivalent of expand-file-name, so we could use it instead of expand-file-name when an absolute file name actually names a remote file. If we return a relative file name, Lisp programs will need to call expand-file-name on them, which is not what we want, IMO. And I'm not sure I understand what you are trying to say here: > expand-file-name has a price on remote systems, it should be called > explicitly by the callee of file-remote-name (I guess you meant "caller", not "callee".) If you want to avoid the price of calling expand-file-name when FILE is already expanded, we can call expand-file-name only on relative file names and only if default-directory is local. Would that solve the problem? From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 11:53:14 2025 Received: (at 79036) by debbugs.gnu.org; 17 Jul 2025 15:53:14 +0000 Received: from localhost ([127.0.0.1]:55612 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucQv3-0008IH-M4 for submit@debbugs.gnu.org; Thu, 17 Jul 2025 11:53:13 -0400 Received: from mout.gmx.net ([212.227.15.18]:55927) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucQv0-0008Hu-Cd for 79036@debbugs.gnu.org; Thu, 17 Jul 2025 11:53:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1752767580; x=1753372380; i=michael.albinus@gmx.de; bh=TI+V1ecRP7J3k/i5XRYU1YztePWqygOdeNOI7mG2Rsc=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=dZYYrAxfpQwWM8TLlQQpdoL3ZAo20q3hCWhGxtfr+Dlsq/lVL3YvwerRa3eQbWLc H+DcEG3lbg6srQ/IZNWkT67mtzpwWauFT3c/kFm3syWF/w11iGpZAfh44cuGBP7L0 GeUMh3yC2e6B3QzNh+9/1WM1aIbJNK3bixaSebWaFx+3OFmwVgR7pL3HC33rVp4U4 +NbBZ/RPdBxpQP++BZvtJT5BE6+DUytOJOb9NptMdPEMTr5SuUs1Rg9IAwRUSFGPn mySiBk+s31WidNrgPNIy7dDNkp8SOu2AWArUi6yJ5lPhjiWrMFnuufmrv3ztbvX3j hh5RjZmce0vHUY4UGw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.37.61]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N95iH-1uiQkW2iHv-00s0Li; Thu, 17 Jul 2025 17:52:59 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames In-Reply-To: <86zfd2g6st.fsf@gnu.org> References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <87freuj2oa.fsf@gmx.de> <861pqehnfx.fsf@gnu.org> <87bjpij1ly.fsf@gmx.de> <86zfd2g6st.fsf@gnu.org> Date: Thu, 17 Jul 2025 17:52:59 +0200 Message-ID: <877c06izl0.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:36XLtn0MVTagvivCl5hdEf9i9ZbfKqHICSs1gKe6v4hbWHuasvu 29CUhpBeWoqKHmY+7HaDbewqQQkMPQGXWzPDQ1IzBA+uDTF7K/qvzfmNHAy4+K197Q/vT7z gAnMwJINCp7YQkeJ1O3zYaYpAyhm9ducY2WEysDHB40ssKQ7N36jMNIsxpPTSJQRTbYnC74 J5YGjqn6ihY3uJOxII4rg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:p5EplDKO7zQ=;7wAwlyLSsVX19dVAgBuZU+yoTXZ kmOuEOrcnqq4LdvYVzrfrPez3llqcYWYU/3S01o/WOHi7jB9Wc8+yUwVGXQaSd29GICkT2uQR Bhea+f3wbM1/ngdgRumWr4iQ15+414/o4wgxFr08iwYz/lsSVHNRYGrtpV3MJCl3CU/W12j/y zozD8XSi78KxqCVPLSn8F6gXQVCznz3ylITzXYiqqtSc9fCl/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LKZzjzDOsCV4K5Nb3A1WxsTn 3JDhHJLRtj8GK+fCiWX0TqpNOoyW7ko9df6Cwz3W/u8rc64LepRDpmH2GtNQ2Zt9YWMv3/ykN lQ4C2IsmkHRmlEWQdVLJADfx8w6Izoi1m8EaWYPGUcVpRNumsyr+52EvY4kHPkvV58OmNtX7b 1WzJ1H0SoBkXbQzzjQ0lLXAHxZUTXF9Ll9Yafw+Z3GVPlA3Y2gqR/qFHFWuGtKIgHN6H04/Iz dx+rKAI+8lvTHI= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79036 Cc: liuhui1610@gmail.com, kobarity@gmail.com, 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: Hi Eli, > I meant to call expand-file-name only in the local case. AFAIU, if > file-remote-p returns non-nil, its argument is already an absolute > file name. But the alternative: > > (concat (file-remote-p default-directory) file) > > will not necessarily produce an absolute file name. Sure. That's why I don't use it in case FILE is relative. >> (defun file-remote-name (file) >> "Return the remote file name of FILE. >> If FILE is a relative file name, return FILE as it is. >> If FILE is already remote, return FILE 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." > > I would like this to be the equivalent of expand-file-name, so we > could use it instead of expand-file-name when an absolute file name > actually names a remote file. If we return a relative file name, Lisp > programs will need to call expand-file-name on them, which is not what > we want, IMO. Again, the function shall be as cheap as file-local-name or file-remote-p. No round-trip to the remote, in no case. (I remember when I've added file-local-name. I was blamed for performance problems.) > And I'm not sure I understand what you are trying to say here: > >> expand-file-name has a price on remote systems, it should be called >> explicitly by the callee of file-remote-name > > (I guess you meant "caller", not "callee".) Of course. > If you want to avoid the > price of calling expand-file-name when FILE is already expanded, we > can call expand-file-name only on relative file names and only if > default-directory is local. Would that solve the problem? It isn't simply needed. Whatever the new function returns, it is good for being used with expand-file-name. Just a granular function. It is up to the callee (sic :-) to apply expand-file-name if needed. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 11:56:25 2025 Received: (at 79036) by debbugs.gnu.org; 17 Jul 2025 15:56:25 +0000 Received: from localhost ([127.0.0.1]:55629 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucQy9-000057-AP for submit@debbugs.gnu.org; Thu, 17 Jul 2025 11:56:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41956) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucQy6-0008WD-KU for 79036@debbugs.gnu.org; Thu, 17 Jul 2025 11:56:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucQy1-0000dM-3l; Thu, 17 Jul 2025 11:56:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=hWYP077fjpvftmajjb6aO2LZuo00mhc9BC7u3MNMfbU=; b=pQcf5u1N7U/9 cyDVPsXJD3hcnMELJEA4eRLb4dS4uuSC1WFsJf6wOHSYP9sANCROao0i+CLgL9C82fdX0CG6TynKZ 1UxQbYD/LsXd1bUAyTvR6GHEVVqGhXRjGni6ELNn0cr6q66+04CTFNMhY2oQgcNJBCUPOxGh/Jwkw foVVpimnejPnf6ngTEmf2ck+K32ktfabbLpQsuL2VtjkG7j3xIBTlVL4iNuOM8qoCTwV4Mv0B9yrf Zs567ab9MdTss81+lOb+iOCm6X9FXTc+30nTagU35yu9BnhuyemruIQRx3+u8VY8AgqADIkYnZOcl AIEp7fsUJgR6Xl8vJFILhA==; Date: Thu, 17 Jul 2025 18:56:12 +0300 Message-Id: <86y0smg6ar.fsf@gnu.org> From: Eli Zaretskii To: Michael Albinus In-Reply-To: <877c06izl0.fsf@gmx.de> (message from Michael Albinus on Thu, 17 Jul 2025 17:52:59 +0200) Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <87freuj2oa.fsf@gmx.de> <861pqehnfx.fsf@gnu.org> <87bjpij1ly.fsf@gmx.de> <86zfd2g6st.fsf@gnu.org> <877c06izl0.fsf@gmx.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79036 Cc: liuhui1610@gmail.com, kobarity@gmail.com, 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Michael Albinus > Cc: liuhui1610@gmail.com, kobarity@gmail.com, 79036@debbugs.gnu.org > Date: Thu, 17 Jul 2025 17:52:59 +0200 > > > And I'm not sure I understand what you are trying to say here: > > > >> expand-file-name has a price on remote systems, it should be called > >> explicitly by the callee of file-remote-name > > > > (I guess you meant "caller", not "callee".) > > Of course. > > > If you want to avoid the > > price of calling expand-file-name when FILE is already expanded, we > > can call expand-file-name only on relative file names and only if > > default-directory is local. Would that solve the problem? > > It isn't simply needed. How so? > Whatever the new function returns, it is good for being used with > expand-file-name. Just a granular function. > > It is up to the callee (sic :-) to apply expand-file-name if needed. If they will always call expand-file-name on the result, we might as well call it internally and make the usage simpler. From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 17 12:34:38 2025 Received: (at 79036) by debbugs.gnu.org; 17 Jul 2025 16:34:38 +0000 Received: from localhost ([127.0.0.1]:55839 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucRZ7-0002oZ-Mu for submit@debbugs.gnu.org; Thu, 17 Jul 2025 12:34:38 -0400 Received: from mout.gmx.net ([212.227.17.20]:38255) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucRZ3-0002oA-QA for 79036@debbugs.gnu.org; Thu, 17 Jul 2025 12:34:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1752770060; x=1753374860; i=michael.albinus@gmx.de; bh=fzPfGEyTd9oWb4qUk8V1sl6m3ASwT+1rdBv9ws2RT2c=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=iKKgL63DNhkJUL5weaGB9zj5qIZ3dPz1X1JpeSwwe+6t5+CnH2qawexP5L9eWYwl kl9xbsseDdFp3yZF+9FjYrKiTlZ+cUQcKv0gKzt82OSVIjtB7+adXkJ80OxwFDiHZ 9vSu0h0pAr13FtrnurFx+JIXb5P/pObOs/ygz3+BfHshn9h1+PETzBlJUFWvpi2jG SWY4WL19ie01oVdE//zrcOBdjETYRkxqhaT7x3ccXJ2Vxp6YplxkY+EpnfpuYh9GN rOtFQH96uUrFxBlYWFz7btrhMs7rt1cEVBu4Z9GWGpRBXpnTqchx1ajiXxLz4uL3S num+A0xju+LeBkAVHw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.37.61]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MYeR1-1u7yIB21xr-00R9yG; Thu, 17 Jul 2025 18:34:20 +0200 From: Michael Albinus To: Eli Zaretskii Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames In-Reply-To: <86y0smg6ar.fsf@gnu.org> References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <87freuj2oa.fsf@gmx.de> <861pqehnfx.fsf@gnu.org> <87bjpij1ly.fsf@gmx.de> <86zfd2g6st.fsf@gnu.org> <877c06izl0.fsf@gmx.de> <86y0smg6ar.fsf@gnu.org> Date: Thu, 17 Jul 2025 18:34:19 +0200 Message-ID: <8734auixo4.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:H5+Ttj+CozljK3AbHDIPRNoIx1mwm75RzswfWWcGA4qaZhmbjtt +E9dZBjFgPx3YTAMf+GZpcZ4KWyb9kcVtwOei7m0j/tjMK8z9eNPQ2Rx6dxiEgxBcXIFGQC B8rmqlnsxlakc41n7QSdwSy8a7efXHdsoAE3iMpNM4DOasJUBCDitEC3HLvHqsO4dBHxW/O FbkmEtC2ZVvn8aJWArOUg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:XXIcn3TYThU=;x85tq1HaIfdld+1GvYe08+CmdNG Xd0uxHBaxVFA16LF479q7MxSw2pd/Y4ZHH8xLyiTaNObEL2+QasjL31OK9b/IXyOi+rmT0RX1 N2TIomp5HC+qnKbjKgnxIZqym4PA1+MzPTMwr/3FGBiIpu7PA7kuDJHfgRxt7dssh2SEDgJ2b bX97PH/leWDRd++EEqTliQXg9MXtx727K5p7QdO8LeK4qiz/85bfxmHReqyKqa24j2fZVPJ01 1K+CoZaY0GJvb5lLjau76JbekBcr37puY0cbNk7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GYoIWkESJAOv34MM6wGXgrih5VyYIIZTEvWSCb58bJKU+6T/8u/jBiEAcHkK7GqELBO 2WMQyx6iGE9iG7ie46jd6ERbDrJ1PdblOL4HxLO9ORex8l4Zf4QvCsNRquDljMvo4YgDQHRmq jnfWUIcbfEZ0emrgVBApKU17dMz7/xPKt4qkIIpHlRg8GLV3jKLuKgUb4Ys3p+/Bl4tZHBEMV BDgMmkxkF0ODooeuI3tMM58eU/zjBAc2R52Inw9lGEvPsVdf6WLisL5QX/oMZ8ZsjTpVxTLcX JC0SY= Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79036 Cc: liuhui1610@gmail.com, kobarity@gmail.com, 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eli Zaretskii writes: >> Whatever the new function returns, it is good for being used with >> expand-file-name. Just a granular function. >>=20 >> It is up to the callee (sic :-) to apply expand-file-name if needed. > > If they will always call expand-file-name on the result, we might as > well call it internally and make the usage simpler. "If". We don't know the future usage pattern. And this bug report has shown us an example, which doesn't seem to callexpand-file-name (I mhaven't scanned the whole code, 'tho). Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 00:47:30 2025 Received: (at 79036) by debbugs.gnu.org; 18 Jul 2025 04:47:30 +0000 Received: from localhost ([127.0.0.1]:59438 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucd0M-0004uV-0m for submit@debbugs.gnu.org; Fri, 18 Jul 2025 00:47:30 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:49260) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ucd0H-0004u9-Vw for 79036@debbugs.gnu.org; Fri, 18 Jul 2025 00:47:27 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3a536ecbf6fso997952f8f.2 for <79036@debbugs.gnu.org>; Thu, 17 Jul 2025 21:47:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752814040; x=1753418840; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=fCvZyZn7g6gKm6YzydraNhZFXtSrGvZh+JDTumcDjC8=; b=VsZYCdCWFC694pw67qlRt2BaRscHL+xV1pzR6Cn8xReytscz71OrBH/nh6nFZoDWq3 ZTXpCfUYQ88k8D3W4X7d+h1kRvEgO4JHKWMJmD6R4ECmp6lBl/7YigDipYs8GtA6ie5p 3BI/fqBVA26ARP5rVQmQVKr1L6zCZ5aUYzeGHFoGUhzkF6r8avmBtJL6P3svZ0VahqZV 6sADknJPKRzj3NOkoPuH9pSyegZAkeeLU3JNxJTwQEtDZJcDfrv2kaRXR6gPJmznTk6e Omvec/YUfp5n8zPql0EmR7U6rypOwV7gzDubQs/b7YxMIg8outx3cuqOZDO7peVV0RPT cPDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752814040; x=1753418840; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fCvZyZn7g6gKm6YzydraNhZFXtSrGvZh+JDTumcDjC8=; b=r1SZIEN0Upd0Uo6Ow90mR9OevtyFNneCZotfyVmm+bqoqglWuGv8zXEI2Vi2GxmzIJ smlhr0ar+iGDdetCXymxWg1ftrwVe99CCyWx/1MKh+m9lHs0NoqpCVMl4+LsblE/A2sv dlUTl5gDPg8SzFVfvCf6qA7MKKzkUBplxvhD/P6GGAZFww9H0PWPEMhohXVEkzE+/Gnu kRqVQ9MG6NNP3qCVvN+BCbvofkNwAzrrQ1Sa1QY1vrPPGj4zqbcKKtJMon//ZSNWvd5M ss+CZrUjkpdTsqx1Cf59NgVdfBkw2RXleYfXjsGUs1qzKBYMKdA6ScgTseNOe2e+Lza+ +kBA== X-Forwarded-Encrypted: i=1; AJvYcCV6UCwXhs/FNtm5KKJnqH4kzgv1lCnHHxbr9p+9uYGro9jYJ5HurJdn70mFIF1bn8/aHY5GdA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyGs8wRvSyeSiOOZh6GyCmNGFajjBpNKodNyfpO/S4hiyxibeQm RhXsDHEil+zuPMmb6gtf5OoQpeuyTiyWgS+AHttBxIVq8N8JsUColVxyvvtbWN9mtJ+M/2nfbgY q+Oy5oSynHi1nSN89MQJcBhfoigNBohA= X-Gm-Gg: ASbGncv1vYSeJHYrZk5H6sfGXv6FKYJ13ViLjDPXcD3airfPxPwloeCH1rB3DEDm75F /Z0CFXVJ/YJ8h2IueEvo0eKNonNBEg92ductKW8BFZaxbe/TvjQJwG82/aiR68vv/wPvbSrzc8x NDgb8POSv9DC66sKbPc5JwFeE4htXMkzpz7W9rKIfhCCXzecePrIK2ImMURSzf8McREfWEGJgb/ ZY0OpM= X-Google-Smtp-Source: AGHT+IFS4/05aspf5O5W5LchweyvlxTKif25x7U/RHg8EK2JcvL7wFlwOXPRAQhxBgB4J3Ji/tF5wzBrltpebaMvAKk= X-Received: by 2002:a05:6000:430d:b0:3b3:9ca4:ac8e with SMTP id ffacd0b85a97d-3b613ea2cbfmr4896324f8f.44.1752814039373; Thu, 17 Jul 2025 21:47:19 -0700 (PDT) MIME-Version: 1.0 References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> In-Reply-To: <8634auhotq.fsf@gnu.org> From: Liu Hui Date: Fri, 18 Jul 2025 12:47:07 +0800 X-Gm-Features: Ac12FXz-bcs1BmxHmKYioj1gAHtcwCF3edzdx7WkgBnSBtI1Ix4XFU0p8zNZf_Y Message-ID: Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames To: Eli Zaretskii Content-Type: multipart/mixed; boundary="0000000000002cb7a7063a2cd2b6" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org, kobarity@gmail.com, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --0000000000002cb7a7063a2cd2b6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jul 17, 2025 at 10:31=E2=80=AFPM Eli Zaretskii wrote= : > 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? > > 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. 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. 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. 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. --0000000000002cb7a7063a2cd2b6 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Fix-pdb-tracking-bug-79036.patch" Content-Disposition: attachment; filename="0001-Fix-pdb-tracking-bug-79036.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_md8c5mm10 RnJvbSAxNjdlMWEwODA4ZmY5ZWYxZmM1YWI1MjNkYTM4MTIyNjdjOGRhNThhIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBMaXUgSHVpIDxsaXVodWkxNjEwQGdtYWlsLmNvbT4KRGF0ZTog VGh1LCAxNyBKdWwgMjAyNSAxMjo0MzozNCArMDgwMApTdWJqZWN0OiBbUEFUQ0hdIEZpeCBwZGIg dHJhY2tpbmcgKGJ1ZyM3OTAzNikKCiogbGlzcC9wcm9nbW9kZXMvcHl0aG9uLmVsIChweXRob24t cGRidHJhY2stc2V0LXRyYWNrZWQtYnVmZmVyKToKVXNlIGNvcnJlY3QgZmlsZSBuYW1lcy4KKHB5 dGhvbi1wZGJ0cmFjay1jb21pbnQtb3V0cHV0LWZpbHRlci1mdW5jdGlvbik6IERvIG5vdCBjb250 aW51ZQppZiBgcHl0aG9uLXBkYnRyYWNrLXNldC10cmFja2VkLWJ1ZmZlcicgcmV0dXJucyBuaWwu Ci0tLQogbGlzcC9wcm9nbW9kZXMvcHl0aG9uLmVsIHwgNDIgKysrKysrKysrKysrKysrKysrKysr KysrLS0tLS0tLS0tLS0tLS0tLQogMSBmaWxlIGNoYW5nZWQsIDI1IGluc2VydGlvbnMoKyksIDE3 IGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL3B5dGhvbi5lbCBiL2xp c3AvcHJvZ21vZGVzL3B5dGhvbi5lbAppbmRleCBmNGYwNTE4ZGJmZC4uOWIwYjRjMGVjNTIgMTAw NjQ0Ci0tLSBhL2xpc3AvcHJvZ21vZGVzL3B5dGhvbi5lbAorKysgYi9saXNwL3Byb2dtb2Rlcy9w eXRob24uZWwKQEAgLTUwNzksOSArNTA3OSwxNCBAQCBweXRob24tcGRidHJhY2stc2V0LXRyYWNr ZWQtYnVmZmVyCiAgICJTZXQgdGhlIGJ1ZmZlciBmb3IgRklMRS1OQU1FIGFzIHRoZSB0cmFja2Vk IGJ1ZmZlci4KIEludGVybmFsbHkgaXQgdXNlcyB0aGUgYHB5dGhvbi1wZGJ0cmFjay10cmFja2Vk LWJ1ZmZlcicgdmFyaWFibGUuCiBSZXR1cm5zIHRoZSB0cmFja2VkIGJ1ZmZlci4iCi0gIChsZXQq ICgoZmlsZS1uYW1lLXByb3NwZWN0IChjb25jYXQgKGZpbGUtcmVtb3RlLXAgZGVmYXVsdC1kaXJl Y3RvcnkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWxlLW5hbWUpKQotICAgICAg ICAgKGZpbGUtYnVmZmVyIChnZXQtZmlsZS1idWZmZXIgZmlsZS1uYW1lLXByb3NwZWN0KSkpCisg IChsZXQqICgoZmlsZS1uYW1lLXByb3NwZWN0IChpZiAoZmlsZS1yZW1vdGUtcCBmaWxlLW5hbWUp CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWxlLW5hbWUKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAoY29uY2F0IChmaWxlLXJlbW90ZS1wIGRlZmF1bHQtZGlyZWN0 b3J5KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmlsZS1uYW1lKSkp CisgICAgICAgICAoZmlsZS1idWZmZXIgKG9yIChnZXQtZmlsZS1idWZmZXIgZmlsZS1uYW1lLXBy b3NwZWN0KQorICAgICAgICAgICAgICAgICAgICAgICAgICA7OyBmaWxlLW5hbWUgaXMgbG9jYWwg JiBQeXRob24gc2hlbGwgaXMgcmVtb3RlCisgICAgICAgICAgICAgICAgICAgICAgICAgIChhbmQg KG5vdCAoZXF1YWwgZmlsZS1uYW1lIGZpbGUtbmFtZS1wcm9zcGVjdCkpCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKGdldC1maWxlLWJ1ZmZlciBmaWxlLW5hbWUpKSkpKQogICAgICh1 bmxlc3MgZmlsZS1idWZmZXIKICAgICAgIChjb25kCiAgICAgICAgKChmaWxlLWV4aXN0cy1wIGZp bGUtbmFtZS1wcm9zcGVjdCkKQEAgLTUwODksOCArNTA5NCw5IEBAIHB5dGhvbi1wZGJ0cmFjay1z ZXQtdHJhY2tlZC1idWZmZXIKICAgICAgICAoKGFuZCAobm90IChlcXVhbCBmaWxlLW5hbWUgZmls ZS1uYW1lLXByb3NwZWN0KSkKICAgICAgICAgICAgICAoZmlsZS1leGlzdHMtcCBmaWxlLW5hbWUp KQogICAgICAgICA7OyBGYWxsYmFjayB0byBhIGxvY2FsbHkgYXZhaWxhYmxlIGNvcHkgb2YgdGhl IGZpbGUuCi0gICAgICAgIChzZXRxIGZpbGUtYnVmZmVyIChmaW5kLWZpbGUtbm9zZWxlY3QgZmls ZS1uYW1lLXByb3NwZWN0KSkpKQotICAgICAgKHdoZW4gKGFuZCBweXRob24tcGRidHJhY2sta2ls bC1idWZmZXJzCisgICAgICAgIChzZXRxIGZpbGUtYnVmZmVyIChmaW5kLWZpbGUtbm9zZWxlY3Qg ZmlsZS1uYW1lKSkpKQorICAgICAgKHdoZW4gKGFuZCBmaWxlLWJ1ZmZlcgorICAgICAgICAgICAg ICAgICBweXRob24tcGRidHJhY2sta2lsbC1idWZmZXJzCiAgICAgICAgICAgICAgICAgIChub3Qg KG1lbWJlciBmaWxlLWJ1ZmZlciBweXRob24tcGRidHJhY2stYnVmZmVycy10by1raWxsKSkpCiAg ICAgICAgIChhZGQtdG8tbGlzdCAncHl0aG9uLXBkYnRyYWNrLWJ1ZmZlcnMtdG8ta2lsbCBmaWxl LWJ1ZmZlcikpKQogICAgIChzZXRxIHB5dGhvbi1wZGJ0cmFjay10cmFja2VkLWJ1ZmZlciBmaWxl LWJ1ZmZlcikKQEAgLTUxNzgsMTggKzUxODQsMjAgQEAgcHl0aG9uLXBkYnRyYWNrLWNvbWludC1v dXRwdXQtZmlsdGVyLWZ1bmN0aW9uCiAgICAgICAgICAgICAgICAgIChzaGVsbC1idWZmZXIgKGN1 cnJlbnQtYnVmZmVyKSkKICAgICAgICAgICAgICAgICAgKHRyYWNrZWQtYnVmZmVyLXdpbmRvdyAo Z2V0LWJ1ZmZlci13aW5kb3cgdHJhY2tlZC1idWZmZXIpKQogICAgICAgICAgICAgICAgICAodHJh Y2tlZC1idWZmZXItbGluZS1wb3MpKQotICAgICAgICAgICAgKHdpdGgtY3VycmVudC1idWZmZXIg dHJhY2tlZC1idWZmZXIKLSAgICAgICAgICAgICAgKHNldHEtbG9jYWwgb3ZlcmxheS1hcnJvdy1w b3NpdGlvbiAobWFrZS1tYXJrZXIpKQotICAgICAgICAgICAgICAoc2V0cSB0cmFja2VkLWJ1ZmZl ci1saW5lLXBvcyAocHJvZ24KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAoZ290by1jaGFyIChwb2ludC1taW4pKQotICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIChmb3J3YXJkLWxpbmUgKDEtIGxpbmUtbnVtYmVyKSkKLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocG9pbnQtbWFya2Vy KSkpCi0gICAgICAgICAgICAgICh3aGVuIHRyYWNrZWQtYnVmZmVyLXdpbmRvdwotICAgICAgICAg ICAgICAgIChzZXQtd2luZG93LXBvaW50Ci0gICAgICAgICAgICAgICAgIHRyYWNrZWQtYnVmZmVy LXdpbmRvdyB0cmFja2VkLWJ1ZmZlci1saW5lLXBvcykpCi0gICAgICAgICAgICAgIChzZXQtbWFy a2VyIG92ZXJsYXktYXJyb3ctcG9zaXRpb24gdHJhY2tlZC1idWZmZXItbGluZS1wb3MpKQotICAg ICAgICAgICAgKHBvcC10by1idWZmZXIgdHJhY2tlZC1idWZmZXIpCi0gICAgICAgICAgICAoc3dp dGNoLXRvLWJ1ZmZlci1vdGhlci13aW5kb3cgc2hlbGwtYnVmZmVyKSkpKSkpCisgICAgICAgICAg ICAoaWYgKG5vdCB0cmFja2VkLWJ1ZmZlcikKKyAgICAgICAgICAgICAgICAobWVzc2FnZSAicGRi dHJhY2sgY2Fubm90IGZpbmQgJXMiIGZpbGUtbmFtZSkKKyAgICAgICAgICAgICAgKHdpdGgtY3Vy cmVudC1idWZmZXIgdHJhY2tlZC1idWZmZXIKKyAgICAgICAgICAgICAgICAoc2V0cS1sb2NhbCBv dmVybGF5LWFycm93LXBvc2l0aW9uIChtYWtlLW1hcmtlcikpCisgICAgICAgICAgICAgICAgKHNl dHEgdHJhY2tlZC1idWZmZXItbGluZS1wb3MgKHByb2duCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAoZ290by1jaGFyIChwb2ludC1taW4pKQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGZvcndhcmQtbGluZSAo MS0gbGluZS1udW1iZXIpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgKHBvaW50LW1hcmtlcikpKQorICAgICAgICAgICAgICAgICh3aGVuIHRyYWNrZWQt YnVmZmVyLXdpbmRvdworICAgICAgICAgICAgICAgICAgKHNldC13aW5kb3ctcG9pbnQKKyAgICAg ICAgICAgICAgICAgICB0cmFja2VkLWJ1ZmZlci13aW5kb3cgdHJhY2tlZC1idWZmZXItbGluZS1w b3MpKQorICAgICAgICAgICAgICAgIChzZXQtbWFya2VyIG92ZXJsYXktYXJyb3ctcG9zaXRpb24g dHJhY2tlZC1idWZmZXItbGluZS1wb3MpKQorICAgICAgICAgICAgICAocG9wLXRvLWJ1ZmZlciB0 cmFja2VkLWJ1ZmZlcikKKyAgICAgICAgICAgICAgKHN3aXRjaC10by1idWZmZXItb3RoZXItd2lu ZG93IHNoZWxsLWJ1ZmZlcikpKSkpKSkKICAgb3V0cHV0KQogCiAoZGVmdW4gcHl0aG9uLXBkYnRy YWNrLXNldHVwLXRyYWNraW5nICgpCi0tIAoyLjI1LjEKCg== --0000000000002cb7a7063a2cd2b6-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 08:08:53 2025 Received: (at 79036) by debbugs.gnu.org; 18 Jul 2025 12:08:53 +0000 Received: from localhost ([127.0.0.1]:33038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucjtU-0001hb-Ru for submit@debbugs.gnu.org; Fri, 18 Jul 2025 08:08:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38576) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucjtQ-0001h5-Nq for 79036@debbugs.gnu.org; Fri, 18 Jul 2025 08:08:50 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucjtJ-0007Hm-AH; Fri, 18 Jul 2025 08:08:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=O3A3tCd+xjqTHpzQO5ChrI2vWtUAopH+ymnNrIoTguA=; b=o/Qc08b+r6uE mhjBfrLIbWavWFbhBTAgfMfG5BJOTL+BbYW7J+z2HOleVy1RH/A65q8xAA0ET3xVqQYGLfidw9PRr a+hNC8M6ViKGpFhFhPedFYfiIgEHhsDAgd7o1jjnBnEv44GJ+zFAYMsbIUGQoDtNDSc2zcBXIWIzP ZGn2ogUF/MQyhBAUbVWaQi5sQJhyV5gJMcLhBDEwpCwY7Uo+T5FlpSEo10RrPp5vSLxeHyetq7Dzh 7BwJWS6zxnYzJriHdf4duWZQeGX8f/buJHEzujN4AmmUpZCsE3dOeDr4Nvw50VJ1nho9lMEsFurtA CAFFJplJETjpPFb5rlLKFg==; Date: Fri, 18 Jul 2025 15:08:37 +0300 Message-Id: <86jz45g0qi.fsf@gnu.org> From: Eli Zaretskii To: Liu Hui In-Reply-To: (message from Liu Hui on Fri, 18 Jul 2025 12:47:07 +0800) Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org, kobarity@gmail.com, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Liu Hui > Date: Fri, 18 Jul 2025 12:47:07 +0800 > Cc: michael.albinus@gmx.de, kobarity@gmail.com, 79036@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. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 10:07:18 2025 Received: (at 79036) by debbugs.gnu.org; 18 Jul 2025 14:07:18 +0000 Received: from localhost ([127.0.0.1]:34582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uclk6-0004qv-3B for submit@debbugs.gnu.org; Fri, 18 Jul 2025 10:07:18 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:43474) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uclk3-0004qQ-37 for 79036@debbugs.gnu.org; Fri, 18 Jul 2025 10:07:16 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3a4f72cba73so1983752f8f.1 for <79036@debbugs.gnu.org>; Fri, 18 Jul 2025 07:07:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752847629; x=1753452429; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=nIE8vPrLz1NZ2/rFr377EH84i919mp89bA48ETatgco=; b=UICkdc8+0BIpxw+VtGLSjqsMw+W2rprxLub/HbzPkNMDSLV1TfC1AegVZnH2zjQzhA QH7gllOTDnbDnHIqYDFTjNvbOjsgmyJUfdTw9/92Fk/iy/KW/3NiNJMnQ8bzcBAg/sY7 Rxr6n9UuIMCh6LZ5tm2/vodcNsPq6lnsYJUChSvDWPuoHEG4Eq8pcAwgSEmAm8iEoNaK anR9W5AX4vyuC/ytwt5PrUt3+KM/5JapS7AdmdNSdKm/QeIb4lCZ0MMq2Q1Gr9pBuhwt fjG6GlTrD7xqrtS7QpAuSOIs8PfhC0f6XX8ccZ1uaYbRF8SW60rp8xbj0vO32A1h9i7Q hEWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752847629; x=1753452429; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nIE8vPrLz1NZ2/rFr377EH84i919mp89bA48ETatgco=; b=PUIQdZn4CoAAHDApX9evbbudRfNwxUDF7lvS00vwcDadzSaocqEiiIEhPm3RagMZUU WcroYtBS/LvH/E1VfMiQqQFENYcJVWdxM7MmAvkS70s0rc+eP0NsWCbWQz2/Od9Q9mWW dzfB368icVasE2kXyCevL1XC5UDOsZSavTNzVyuqtVY45T/pFTBVlM9S2gVayNzlylqS bIgcJZ5rvbT2/sFyAn4BmrVzTzP426EqqCm+Z/E+QOxF38kx09WH5mVrZAs5bFC83oCY wNKWIfkWSiQwFepcR+xY14RVLDcyYKqqKTmIHz/zix1PjpUcpkvpzqsgto8W57FH09mk lgUQ== X-Forwarded-Encrypted: i=1; AJvYcCV+ElZFAE/9qsvTRmygqJKzEOcIBAJeAW6a6C0zdL0Y9DKDfNZ+OnuXocKlBrp8ps/xz2LHJQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzNZOj6OL0wTIDxvBjyIWzVfbW1oAmZaOABxiNw5LsZXhDm4Z8c FIX7edmfK1eWBwZ9Q/xIwGGdByy/7bVxZHxgZWXiclA6nDiv5q7LknpFg+3yyfDPwEdZrg/ZW85 hX4VD4bzfGjPlDTxUSBH/0+icpaKfVmc= X-Gm-Gg: ASbGncu1fdDROTJm4+sDSWQMxn1EoMdki1feRwTeEvJ/krlQyXwAzkQA7xfIXX/Zv3p ebrQwudtDZ6rVvB8xHvKXscU690dBJYogDyzyKXb8NShg5tZ9WgHxsalpmFbVBStN4CP5gIZvQS PJ+2+w5O6elUDgX6urMh3Tt4I5VwteE0uFVmeXPI77c4sseajTmqbmJLbrfisHDQ9pZEd3+uVwV QUf6QY= X-Google-Smtp-Source: AGHT+IFLF6tSyPIgNVg/08jz4D0y9EpAlwNvv9unRI0WsBiv4d+nv0wUID5AO9HXrNZN30YDjsE9I0EBVruFLH9rgyg= X-Received: by 2002:adf:9cd2:0:b0:3a6:daff:9e5 with SMTP id ffacd0b85a97d-3b619c9d35fmr2393539f8f.7.1752847628245; Fri, 18 Jul 2025 07:07:08 -0700 (PDT) MIME-Version: 1.0 References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> In-Reply-To: <86jz45g0qi.fsf@gnu.org> From: Liu Hui Date: Fri, 18 Jul 2025 22:06:56 +0800 X-Gm-Features: Ac12FXyJ5Q7Iv1EoXphqYjkahPFLc5PNcyicunOWBGWQzsdNSGfI9p2E1caA-To Message-ID: Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Fri, Jul 18, 2025 at 8:08 PM Eli Zaretskii wrote: > > > From: Liu Hui > > Date: Fri, 18 Jul 2025 12:47:07 +0800 > > Cc: michael.albinus@gmx.de, kobarity@gmail.com, 79036@debbugs.gnu.org > > > [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (liuhui1610[at]gmail.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (liuhui1610[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:42c listed in] [list.dnswl.org] 1.0 FREEMAIL_REPLY From and body contain different freemails X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org, kobarity@gmail.com, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Fri, Jul 18, 2025 at 8:08=E2=80=AFPM Eli Zaretskii wrote: > > > From: Liu Hui > > Date: Fri, 18 Jul 2025 12:47:07 +0800 > > Cc: michael.albinus@gmx.de, kobarity@gmail.com, 79036@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"? For example, below is the pdb output in a remote python shell, and the file-name "/tmp/test.py" is local. Because of the "from ... import ...", we can know the file is on the remote system. >>> from test import f; f() > /tmp/test.py(3)f() -> return 1 (Pdb) However, with the following pdb output in a remote python shell >>> f() > /tmp/test.py(3)f() -> return 1 (Pdb) The local filename "/tmp/test.py" may be on the remote system like the above case, or may be on the local host if we press C-c C-c to send its code to the remote process. Which file should python shell track? The simplest solution is to check which file exists. > > 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. I was explaining why file-exists-p is needed. It is another possible case. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 10:13:12 2025 Received: (at 79036) by debbugs.gnu.org; 18 Jul 2025 14:13:12 +0000 Received: from localhost ([127.0.0.1]:34607 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uclpn-0005De-VA for submit@debbugs.gnu.org; Fri, 18 Jul 2025 10:13:12 -0400 Received: from mout.gmx.net ([212.227.17.20]:46015) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uclpk-0005Cu-BE for 79036@debbugs.gnu.org; Fri, 18 Jul 2025 10:13:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1752847981; x=1753452781; i=michael.albinus@gmx.de; bh=5Vdypwl4ccGbBURI8CLQUIDcmXFAlkhQotSO13r7fQc=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=ViY1QK3EFCukgELp6CvdLpYtZsT809q28gRk57SD1NZWBpRBsbKH5yAh+CZiElJg InzCqN7FWvoL25lwEG984Ybb1FmLUSkpLxqK3iiXfNgGAVkCJLZo+EqIxfwGeZDu0 RrqvtGSxVPJU9wiu8rkPQbs34+eNH6CB6X3iVvqpDRvWDsXh7AXknNisduqQe+bqU l059LJrJUXkFrDVD7So3N19arZ+FYMbjmDBQ88OfEfpm68gWHCAkaZlJ7LayxWfLN XslGJpeYQPmYehm9I9ytgFbkZZBMkErQkmshZ9IF8KDoCIpNl0BAq5AY3URVHr5P6 +kwYXXVjr9A1pczruw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.37.61]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mof9F-1ux0cO1fXV-00kCxv; Fri, 18 Jul 2025 16:13:01 +0200 From: Michael Albinus To: Liu Hui Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames In-Reply-To: References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> Date: Fri, 18 Jul 2025 16:13:00 +0200 Message-ID: <87seith9jn.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:dGG197O4+tkvpkiTp/DWjZECohuHOfl6lwQgJO06xmYLtMU1zsv oG7f3KajqthCQAHjfpbdx4Wdwkf+QDAytlWTIIC5RZp2IDALSIDtaG0KVhaIgSbAlH6/3SL MSIv6FMrlcoTgCoaPGMbHzERW++mANW8yMEU0EhKRgN+iQrpqhpmu1vLCSJN4FRbepbz1TC te/851yhir7GWwlXi8t2A== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:1Cjdkzw8G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1gPd+fcPEVAy5UI6yo4m0S833LwbWqcGsN7/G ZCrdAYc7/AsDPhlNtIVpMjYnDEHbtIVfKk9z9zBWaBT7xJ8qjqqccCBKaXyORwl0x5vPtJjGL lSoqOjOG06T8TQUfyzZQm6hgu5i8R/trXm5yPFxrQoFmwKWCh90E0KkmsTMlUTkE8QUhaXiGy hG7top9PelDBtoRQxeYJh52qRGTgryOv0tje6BainDblvM+XlSzxM+26D8eJcw48pdeYAfOdc 8mTFDHPuGSL/QQbqhY1G84WBFMzwwyPsEK9xcHlscsr9qORX4VzQqGrNFpSBjaHh6+WK7CAEK H+UH1dmepCG1ZmLfJA7U8DSUVNpNH+Bg7eKvfkV3c/bVAaYSSfz5xK6S/rrZkqpVGz9uwcwr9 xR0l3DHF3fHFpI0FUtex8Kyp0aMO5+t6kT2Sfj5adjcuN/vMSSP981uwyEpCAnf/MN2dIsmMj 1ykAcxumkRVAbc= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79036 Cc: Eli Zaretskii , 79036@debbugs.gnu.org, kobarity@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Liu Hui writes: > For example, below is the pdb output in a remote python shell, and the > file-name "/tmp/test.py" is local. Because of the "from ... import > ...", we can know the file is on the remote system. > > >>> from test import f; f() > > /tmp/test.py(3)f() > -> return 1 > (Pdb) > > However, with the following pdb output in a remote python shell > > >>> f() > > /tmp/test.py(3)f() > -> return 1 > (Pdb) > > The local filename "/tmp/test.py" may be on the remote system like the > above case, or may be on the local host if we press C-c C-c to send > its code to the remote process. > > Which file should python shell track? The simplest solution is to > check which file exists. No. The mature check is whether default-directory is remote. Everything else is voodoo. Can work, but no guarantee. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 10:53:06 2025 Received: (at 79036) by debbugs.gnu.org; 18 Jul 2025 14:53:07 +0000 Received: from localhost ([127.0.0.1]:34797 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucmSQ-00082z-F4 for submit@debbugs.gnu.org; Fri, 18 Jul 2025 10:53:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37932) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucmSN-00082I-Bp for 79036@debbugs.gnu.org; Fri, 18 Jul 2025 10:53:04 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucmSH-0006cW-PJ; Fri, 18 Jul 2025 10:52:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=oLlxtE+mrPvTQTLOLgMZK5NKcydS4wZPs1W3ZbGOC5g=; b=dgixl1Ffb15Ox8KVmjUf DcF5WIuWY77ux8DlkOtv658nz7CU/s4ECiMoV0gM5fj5jRZ7t5u4wtPe2hI9huGgT95E2WZbE+uUn jy1Sk2Mht0zeQ/yEH9quazPLYUwSf1Q5V7kDM9jTh2ddY2NMgknGJ5rsDfwsj4HVE7pZVJAnvI0yC sU22AFLX+uG51vkn5HIDuRD+keN2LlPT8mHxbtOTuFHQtXnKy9tLb6tWTxtUro/5hHbdWO5Ol4WyU 3XGFHuT6YTknV84P88ujTMkA2RyQ7QM4+8qC2nqUAKk8M5qgLmLkjdA9mjiqy1fhnSHEnD2rfmw6w DAM3jJ4wIXJ6vQ==; Date: Fri, 18 Jul 2025 17:52:54 +0300 Message-Id: <86ikjpft4p.fsf@gnu.org> From: Eli Zaretskii To: Liu Hui In-Reply-To: (message from Liu Hui on Fri, 18 Jul 2025 22:06:56 +0800) Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org, kobarity@gmail.com, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Liu Hui > Date: Fri, 18 Jul 2025 22:06:56 +0800 > Cc: michael.albinus@gmx.de, kobarity@gmail.com, 79036@debbugs.gnu.org > > On Fri, Jul 18, 2025 at 8:08 PM Eli Zaretskii wrote: > > > > > 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"? > > For example, below is the pdb output in a remote python shell, and the > file-name "/tmp/test.py" is local. Because of the "from ... import > ...", we can know the file is on the remote system. > > >>> from test import f; f() > > /tmp/test.py(3)f() > -> return 1 > (Pdb) > > However, with the following pdb output in a remote python shell > > >>> f() > > /tmp/test.py(3)f() > -> return 1 > (Pdb) > > The local filename "/tmp/test.py" may be on the remote system like the > above case, or may be on the local host if we press C-c C-c to send > its code to the remote process. > > Which file should python shell track? The simplest solution is to > check which file exists. Doesn't the value of default-directory tells us whether it's a local or a remote file? If not, why not? > > > 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. > > I was explaining why file-exists-p is needed. It is another possible > case. If a file doesn't exist, debugging it will not work. The fact that we leave behind an empty buffer is not important. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 10:54:07 2025 Received: (at 79036) by debbugs.gnu.org; 18 Jul 2025 14:54:07 +0000 Received: from localhost ([127.0.0.1]:34807 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucmTP-00086B-3O for submit@debbugs.gnu.org; Fri, 18 Jul 2025 10:54:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57916) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucmTM-00085V-Fx for 79036@debbugs.gnu.org; Fri, 18 Jul 2025 10:54:05 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucmTH-0006ss-4o; Fri, 18 Jul 2025 10:53:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=F7tJgmIoxueXu+fLlLEbyHE5v0cxnD63KYD0WUnG+HQ=; b=npwr27djgJwM yH/JMBFYlutEy9ZZ/7WHG18Re9B5nU2LNKZB6F94OLKAxx8EiAqdsEZnZTpOAG2UhdWoLtUPjthBl yS2HobAjfbBnxZHaWo0Iz+4BuD6+/1RydNN1jUJe1jGql643KHZiK3QVOz7bK9FZ6ulGrCCUjT4K9 Ci5w+5XPjq+MrSn9LkQAfP1RplOcXaGFQoKSDSLal/oHeMNOStM12WqAh5bi2S5zNiGL0JdAeKtfh YaXLrjNBx36wl5fQreOpzGcks2sMLOw2o+cyro+uO1bpGO2gGuqcLTgjFqG9Pin0JjKH6Q4XNTHiS LTyORSewyD5U7VyCCGtVvw==; Date: Fri, 18 Jul 2025 17:53:55 +0300 Message-Id: <86h5z9ft30.fsf@gnu.org> From: Eli Zaretskii To: Michael Albinus In-Reply-To: <87seith9jn.fsf@gmx.de> (message from Michael Albinus on Fri, 18 Jul 2025 16:13:00 +0200) Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <87seith9jn.fsf@gmx.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79036 Cc: liuhui1610@gmail.com, kobarity@gmail.com, 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Michael Albinus > Cc: Eli Zaretskii , kobarity@gmail.com, 79036@debbugs.gnu.org > Date: Fri, 18 Jul 2025 16:13:00 +0200 > > Liu Hui writes: > > > For example, below is the pdb output in a remote python shell, and the > > file-name "/tmp/test.py" is local. Because of the "from ... import > > ...", we can know the file is on the remote system. > > > > >>> from test import f; f() > > > /tmp/test.py(3)f() > > -> return 1 > > (Pdb) > > > > However, with the following pdb output in a remote python shell > > > > >>> f() > > > /tmp/test.py(3)f() > > -> return 1 > > (Pdb) > > > > The local filename "/tmp/test.py" may be on the remote system like the > > above case, or may be on the local host if we press C-c C-c to send > > its code to the remote process. > > > > Which file should python shell track? The simplest solution is to > > check which file exists. > > No. The mature check is whether default-directory is remote. Everything > else is voodoo. Can work, but no guarantee. Right. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 11:20:12 2025 Received: (at 79036) by debbugs.gnu.org; 18 Jul 2025 15:20:12 +0000 Received: from localhost ([127.0.0.1]:34896 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucmse-0001Vk-4Z for submit@debbugs.gnu.org; Fri, 18 Jul 2025 11:20:12 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:43093) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ucmsZ-0001Pk-Fr for 79036@debbugs.gnu.org; Fri, 18 Jul 2025 11:20:09 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-45619d70c72so27000835e9.0 for <79036@debbugs.gnu.org>; Fri, 18 Jul 2025 08:20:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752852001; x=1753456801; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Jbij+SNH6ZeQ3nEQzhzTvG6BAmrfCYS3IFyPy2kP55o=; b=Smfz1WaAgx5zP2YeHXd/rT34gi/RMjR4xIZoia35zQ+ZhY5b0a5mndap8odN2lLV21 5pDZLO+DyfAz1CBYOdibnwccuCKJNnnMk0iAmz3OAsXJpxojHUbE2G3Izk3dUBh4JzFj i3ZU8O4MsxG4TcaIjpdA/JVpwlb1zbEYn+QUnSby7sCOmyd0M+dEw9DsCH6sLWVL/xJW 4TgbF968aCY2eIdU0VvB01+Wtaw50pgvYgCqpSQy5S0OvHX/PMnqmeGK/gX4t4TSPE/u wRoEDRGBX1upFzlhhm7WEHp4pTRRSVah3vE7tbROSj/W0v+tQGvG96Fbg0FnQLEMarjq UA6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752852001; x=1753456801; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Jbij+SNH6ZeQ3nEQzhzTvG6BAmrfCYS3IFyPy2kP55o=; b=JeJYbvynInuRkMdMduHeURF/ysA2d8ppxM4q2QeCdlaF4J0Jtzz5fUU0Gf9XOknaUQ qlAzXqaC92PDaK4Yz8f7SJB49jjxqN0KzmK3+bm5G3t07wwi+zjZC8S8SpYaN4cc/Aa3 Tv+pzcvw1wQLim6VnKN3LUy59lsbsjBXd6RWVJpGNJvWyp97/C7+rj58ouO4MeBE4Lqg 5Q/bdpyjxfBbIqXCT3FOcduplMdAi/y0MxjkrMi9sIlZAdkduUvYmpWPWQDzy0XnJHqf GL3/HvaDITAbTsc4TSoz9SldhCnznzl0SOX2MW+ZwCFelH5Huik+BoCvtalKx2W9Ne49 vXuA== X-Forwarded-Encrypted: i=1; AJvYcCWopEKzaIkI+BcpJ94jGtQMuHJnPi4hoiGcbFqTKjobxWiAseogroQQYFRca5A15YF0uu9u8g==@debbugs.gnu.org X-Gm-Message-State: AOJu0YygPWihs4mc7/Y7YGtohElqoFeoJIMFE2UYtAMLQrFcBU54xLSf wzebbwz05KBwaOkm/BZCh4zOSW4yUSDKCnAZqI25WHMBOFtOzc3Oza6g/RjW+YAoLCJjZ4Bib/T d9Ey3EHinlOp16fhFtohYnBW4ibC1G9s= X-Gm-Gg: ASbGncs/dEq4yD3ZjtVVmmet4njniVP2O8mwM07YMtcCcsfUwNwq170JweGzuhkqpU4 UMUQkClfiEKbWEWUwoDZRzbvnA5VPKGoeNZz4z3wvYMpWuP7C/wZhef8jFHS1WP5mcVH61gtK8g PZvM6H2LEsFOT2WsksNgOWuKol4b8WjG8pvaHqpqGbEu9xAPzNgmd2HB4K1R+hR7yCfpOMwbMAy 8ze+5k= X-Google-Smtp-Source: AGHT+IHHPA9Ykl/qb7lu7D+wyHpMq1RSnjEkGT+iCEm6xJHR1jZUF8DByml1IQDNWphwB4UyYhar/lqOGyX9Oc9Ab6s= X-Received: by 2002:a05:600c:8b01:b0:456:f22:ca49 with SMTP id 5b1f17b1804b1-4563b8d1413mr31684495e9.0.1752852001064; Fri, 18 Jul 2025 08:20:01 -0700 (PDT) MIME-Version: 1.0 References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <87seith9jn.fsf@gmx.de> <86h5z9ft30.fsf@gnu.org> In-Reply-To: <86h5z9ft30.fsf@gnu.org> From: Liu Hui Date: Fri, 18 Jul 2025 23:19:49 +0800 X-Gm-Features: Ac12FXwZj1U27GAsEE1q3c8qwv5UvQUd4FOO5K-fHBWfyYfSr63eo6NllMvV364 Message-ID: Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Fri, Jul 18, 2025 at 10:53 PM Eli Zaretskii wrote: > > > From: Michael Albinus > > Cc: Eli Zaretskii , kobarity@gmail.com, 79036@debbugs.gnu.org > > Date: Fri, 18 Jul 2025 16:13:00 +0200 > > [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (liuhui1610[at]gmail.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (liuhui1610[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:32b listed in] [list.dnswl.org] 1.0 FREEMAIL_REPLY From and body contain different freemails X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org, kobarity@gmail.com, Michael Albinus X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Fri, Jul 18, 2025 at 10:53=E2=80=AFPM Eli Zaretskii wrote= : > > > From: Michael Albinus > > Cc: Eli Zaretskii , kobarity@gmail.com, 79036@debbugs.g= nu.org > > Date: Fri, 18 Jul 2025 16:13:00 +0200 > > > > Liu Hui writes: > > > > > For example, below is the pdb output in a remote python shell, and th= e > > > file-name "/tmp/test.py" is local. Because of the "from ... import > > > ...", we can know the file is on the remote system. > > > > > > >>> from test import f; f() > > > > /tmp/test.py(3)f() > > > -> return 1 > > > (Pdb) > > > > > > However, with the following pdb output in a remote python shell > > > > > > >>> f() > > > > /tmp/test.py(3)f() > > > -> return 1 > > > (Pdb) > > > > > > The local filename "/tmp/test.py" may be on the remote system like th= e > > > above case, or may be on the local host if we press C-c C-c to send > > > its code to the remote process. > > > > > > Which file should python shell track? The simplest solution is to > > > check which file exists. > > > > No. The mature check is whether default-directory is remote. Everything > > else is voodoo. Can work, but no guarantee. > > Right. I agree Emacs should first find the file on the remote system when the python shell is remote. But if the file doesn't exist, I think it is reasonable to try finding local file (supposed behavior currently in python-pdbtrack-set-tracked-buffer but there is a bug) instead of opening an empty remote file (actual behavior) or doing nothing. I would like to add an option if you think Emacs should just find the remote file. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 11:31:23 2025 Received: (at 79036) by debbugs.gnu.org; 18 Jul 2025 15:31:23 +0000 Received: from localhost ([127.0.0.1]:34942 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucn3S-0002Gk-IV for submit@debbugs.gnu.org; Fri, 18 Jul 2025 11:31:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55256) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucn3O-0002Fo-W2 for 79036@debbugs.gnu.org; Fri, 18 Jul 2025 11:31:20 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucn3J-0001hk-BE; Fri, 18 Jul 2025 11:31:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=XA6dxsDvRnr20XaLp3fGlbNaWHACKVhBPZ+P+Wba2m0=; b=AQWISIToiP5TMK1iTcZb wPYz+LlR0llH/7R+o+z6phWMO3S3ylfn1t+pKmlRx/aY7rV650VZQ3B+C+XqcUnQ+6sxdqb1JGoSp jUSg9PVid8CYhpe7YDoRvGNMDBXpuCfhFq/UoryqC7sBgbeCjJHifi2mVdSm7DbBOnDJ7+fru7nN9 wDvRayblHFjqemYZV1ZLSfoojDRZbEpzMsPy52YpkNuh/IgU5T+BO0XNO22e9TxQDs8x/6TE7nMNV 91LCy9S8An1QVpxjEtktCR8pBlpGo+c4NWDHbNcOj9OO0VCbP9On4nht8LAYmQF72fk/8WGJupui/ Gr/fH6Ppq548zQ==; Date: Fri, 18 Jul 2025 18:31:06 +0300 Message-Id: <86fretfrd1.fsf@gnu.org> From: Eli Zaretskii To: Liu Hui In-Reply-To: (message from Liu Hui on Fri, 18 Jul 2025 23:19:49 +0800) Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <87seith9jn.fsf@gmx.de> <86h5z9ft30.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org, kobarity@gmail.com, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Liu Hui > Date: Fri, 18 Jul 2025 23:19:49 +0800 > Cc: Michael Albinus , kobarity@gmail.com, 79036@debbugs.gnu.org > > On Fri, Jul 18, 2025 at 10:53 PM Eli Zaretskii wrote: > > > > > From: Michael Albinus > > > Cc: Eli Zaretskii , kobarity@gmail.com, 79036@debbugs.gnu.org > > > Date: Fri, 18 Jul 2025 16:13:00 +0200 > > > > > > Liu Hui writes: > > > > > > > For example, below is the pdb output in a remote python shell, and the > > > > file-name "/tmp/test.py" is local. Because of the "from ... import > > > > ...", we can know the file is on the remote system. > > > > > > > > >>> from test import f; f() > > > > > /tmp/test.py(3)f() > > > > -> return 1 > > > > (Pdb) > > > > > > > > However, with the following pdb output in a remote python shell > > > > > > > > >>> f() > > > > > /tmp/test.py(3)f() > > > > -> return 1 > > > > (Pdb) > > > > > > > > The local filename "/tmp/test.py" may be on the remote system like the > > > > above case, or may be on the local host if we press C-c C-c to send > > > > its code to the remote process. > > > > > > > > Which file should python shell track? The simplest solution is to > > > > check which file exists. > > > > > > No. The mature check is whether default-directory is remote. Everything > > > else is voodoo. Can work, but no guarantee. > > > > Right. > > I agree Emacs should first find the file on the remote system when the > python shell is remote. But if the file doesn't exist, I think it is > reasonable to try finding local file (supposed behavior currently in > python-pdbtrack-set-tracked-buffer but there is a bug) instead of > opening an empty remote file (actual behavior) or doing nothing. I > would like to add an option if you think Emacs should just find the > remote file. If we decide that the file is local, the value of default-directory should reflect that. Then all our infrastructure for handling files will seamlessly work correctly. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 11:32:10 2025 Received: (at 79036) by debbugs.gnu.org; 18 Jul 2025 15:32:11 +0000 Received: from localhost ([127.0.0.1]:34952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucn4E-0002JI-FV for submit@debbugs.gnu.org; Fri, 18 Jul 2025 11:32:10 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:46449) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ucn4B-0002IU-Qq for 79036@debbugs.gnu.org; Fri, 18 Jul 2025 11:32:08 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-45600581226so23270065e9.1 for <79036@debbugs.gnu.org>; Fri, 18 Jul 2025 08:32:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752852721; x=1753457521; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=yc/pG3H+Pl/FMkxzVmv39yph/ve/zvWm3Xc/rwV+MUI=; b=bLUxKEHXR6OlWsFqcnwXLbZGASjllu7AG/mnpwqrSZbuWPbzwZrn8eQMFNrAgvAiJd Eanj8UBvJd4lNXDFEqkUpFO7sv1DOjjjkkVS0PXg5JAr/hYF5a8x6NbwoZjqfhXybpeP swTtivKyzrNDhnZ+Z1zyA7iJRH+xum883zHXzaps4oiHNhi50J8LkzOo7PAFyiuWEuqc ZkvgdhMpNE+cK5X8CmyJkg/FySaXUD88NWMQCPiBgpDkklHJ/p0QGFkLwObNUCkBjZYb gzwIckCtpdQEPLz1orhjuabZqgS7uygjVMmV5S/Hs1idvvD/yRb1woSJBOVvWoUFhU3w M/pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752852721; x=1753457521; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yc/pG3H+Pl/FMkxzVmv39yph/ve/zvWm3Xc/rwV+MUI=; b=vxoYMVOv2x0pj/xiZp6gTAfQbrtjxZJ7BLAFXBXxAa1d2FS70Rm2TVu3S+jc1ojTk9 6MRs/NsSOW5ZEoTtfze7tl8J0Ev4lCG0sYP44JREjKcCofW9lyseiIhi+XHos530xE54 oM5ccdQckxbj2VSCjW4kN8NxqjWl3ZjJ+5d1VamiKnqJpmGHAnkPKmLHcnr+Tsp+ZCRN zwZ6FbIVHx6K8N/7Fk78X1Ts+vI+RIdReCcBvtwnTpOB4ndhuoMnnVC2YZwvqljKGjtF DwkNBVmpRrn++BpSUoUO5Yz/namXKOAvxcg5X0fcdgBkaMwtZ06ZA08poOmskVsMcdjr J1yg== X-Forwarded-Encrypted: i=1; AJvYcCUMpKi63NN8C2XdtSF+XpaSeqrMNfT2F5e/o9DvzRtlPjC0EbgMC3huBdC/lCkVIyx8osk1cg==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwH09Z+Hkdprxss9KbQhmZI+/NitBzS1qNML3zV8BCrxtaB1s3K 8qIKVWlL1uOSIdA61W9tCRimbt9yjupIk+KoV06AUuTQQOiko4OVxTOp4fL1Xs+7nLvi3WXN43T smkMhnNXJh593gndXKy7/GkKVtpUn2rU= X-Gm-Gg: ASbGncupKHrSA8G6uVInElSmnoFsEXWEZGEO8Vy2DMaKAjnQl6QweVX6aARGmvku+AZ GO++Jk0j2nsqOYJpxgoTAB3Ka3HSu9dNeV+O7xfUMQTUT3VJW3X8ZpKv5k8FhIiwVFTp2sei5dF 0QRYogM6sDeznfq7uqW52uV5cA2smkc/IVvwcD/Oto04TTD5H1swMhkr96OTydp8VfLDaak8lI3 sZLVx0= X-Google-Smtp-Source: AGHT+IEs38VKCHwtv1CuFBHk2pZ7LRx7jHWOnyVIwZyyHjbvgrItFInWnLvCT4rm2tizdOQaa470cxB8gF66kX3tIb0= X-Received: by 2002:a05:600c:310a:b0:456:58e:318e with SMTP id 5b1f17b1804b1-4562e29c660mr122546155e9.30.1752852721371; Fri, 18 Jul 2025 08:32:01 -0700 (PDT) MIME-Version: 1.0 References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <86ikjpft4p.fsf@gnu.org> In-Reply-To: <86ikjpft4p.fsf@gnu.org> From: Liu Hui Date: Fri, 18 Jul 2025 23:31:50 +0800 X-Gm-Features: Ac12FXw3XQtOM8KHj-0MXiWJg1uOLdyJI3zuix5AgREl9aicsQMRUI3ovBthNZk Message-ID: Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Fri, Jul 18, 2025 at 10:52 PM Eli Zaretskii wrote: > > > From: Liu Hui > > Date: Fri, 18 Jul 2025 22:06:56 +0800 > > Cc: michael.albinus@gmx.de, kobarity@gmail.com, 79036@debbugs.gnu.org > > [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (liuhui1610[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:333 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (liuhui1610[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 1.0 FREEMAIL_REPLY From and body contain different freemails X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org, kobarity@gmail.com, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Fri, Jul 18, 2025 at 10:52=E2=80=AFPM Eli Zaretskii wrote= : > > > From: Liu Hui > > Date: Fri, 18 Jul 2025 22:06:56 +0800 > > Cc: michael.albinus@gmx.de, kobarity@gmail.com, 79036@debbugs.gnu.org > > > > On Fri, Jul 18, 2025 at 8:08=E2=80=AFPM Eli Zaretskii wr= ote: > > > > > > > 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 form= er > > > > 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"? > > > > For example, below is the pdb output in a remote python shell, and the > > file-name "/tmp/test.py" is local. Because of the "from ... import > > ...", we can know the file is on the remote system. > > > > >>> from test import f; f() > > > /tmp/test.py(3)f() > > -> return 1 > > (Pdb) > > > > However, with the following pdb output in a remote python shell > > > > >>> f() > > > /tmp/test.py(3)f() > > -> return 1 > > (Pdb) > > > > The local filename "/tmp/test.py" may be on the remote system like the > > above case, or may be on the local host if we press C-c C-c to send > > its code to the remote process. > > > > Which file should python shell track? The simplest solution is to > > check which file exists. > > Doesn't the value of default-directory tells us whether it's a local > or a remote file? If not, why not? In the example: >>> f() > /tmp/test.py(3)f() -> return 1 (Pdb) The current buffer is the Python shell buffer, default-directory is remote only means python process is remote. "/tmp/test.py" may be on the local host because = users may send code in local file "/tmp/test.py" to the remote process. > > > > 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 wh= y > > > is this important, so please elaborate. > > > > I was explaining why file-exists-p is needed. It is another possible > > case. > > If a file doesn't exist, debugging it will not work. The fact that we > leave behind an empty buffer is not important. Since an empty buffer is useless, why not just not show it in the first place? I find it disturbing. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 14:26:01 2025 Received: (at 79036) by debbugs.gnu.org; 18 Jul 2025 18:26:01 +0000 Received: from localhost ([127.0.0.1]:35549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucpmS-0008MY-Vw for submit@debbugs.gnu.org; Fri, 18 Jul 2025 14:26:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34358) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ucpmO-0008M6-CA for 79036@debbugs.gnu.org; Fri, 18 Jul 2025 14:25:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ucpmI-0006mp-Pn; Fri, 18 Jul 2025 14:25:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=B2oa+2/evBw8i4Bii2CKGvZG7BcQty/FBfDqPCx/7Xs=; b=Lx/3g15iL4Qouy83NCHL /nIXUrZigrcRGoidWUJxTAXtj33Bv/wiNILL5BBnLXJxfGPVBiR23E+cKywfc1aRl8At6Z2ywmpLf f9SA/cjgTIbXe3iGQNMX/eMpdfhhPCOC6+eK7OsYxP1Gsw1nFG2B813JRQdIf4Gik1RHjxGpY4Gt+ JNtxVxkycUhl03jebaDkSg8LMl0WfvgewZlTQ3rOeVnSANTMXskXOSsABfKI+iXVDgvzVtJzPwr8X itQu0pKjxtxho8d1RLMfyBGCN6p+KCRgIYH67G8jcefHKLCcE/Zo6A3zpm9EZGnLAXIl0GGB1bx4W WJy8d3ohXV1Hqw==; Date: Fri, 18 Jul 2025 21:25:47 +0300 Message-Id: <86ecudfj9w.fsf@gnu.org> From: Eli Zaretskii To: Liu Hui In-Reply-To: (message from Liu Hui on Fri, 18 Jul 2025 23:31:50 +0800) Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <86ikjpft4p.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org, kobarity@gmail.com, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Liu Hui > Date: Fri, 18 Jul 2025 23:31:50 +0800 > Cc: michael.albinus@gmx.de, kobarity@gmail.com, 79036@debbugs.gnu.org > > On Fri, Jul 18, 2025 at 10:52 PM Eli Zaretskii wrote: > > > > > From: Liu Hui > > > Date: Fri, 18 Jul 2025 22:06:56 +0800 > > > Cc: michael.albinus@gmx.de, kobarity@gmail.com, 79036@debbugs.gnu.org > > > > > > On Fri, Jul 18, 2025 at 8:08 PM Eli Zaretskii wrote: > > > > > > > > > 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"? > > > > > > For example, below is the pdb output in a remote python shell, and the > > > file-name "/tmp/test.py" is local. Because of the "from ... import > > > ...", we can know the file is on the remote system. > > > > > > >>> from test import f; f() > > > > /tmp/test.py(3)f() > > > -> return 1 > > > (Pdb) > > > > > > However, with the following pdb output in a remote python shell > > > > > > >>> f() > > > > /tmp/test.py(3)f() > > > -> return 1 > > > (Pdb) > > > > > > The local filename "/tmp/test.py" may be on the remote system like the > > > above case, or may be on the local host if we press C-c C-c to send > > > its code to the remote process. > > > > > > Which file should python shell track? The simplest solution is to > > > check which file exists. > > > > Doesn't the value of default-directory tells us whether it's a local > > or a remote file? If not, why not? > > In the example: > > >>> f() > > /tmp/test.py(3)f() > -> return 1 > (Pdb) > > The current buffer is the Python shell buffer, default-directory is > remote only means > python process is remote. "/tmp/test.py" may be on the local host because users > may send code in local file "/tmp/test.py" to the remote process. This cannot work reliably, and I don't think we should support it. Please ignore this case in the following discussions. > > > > > 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. > > > > > > I was explaining why file-exists-p is needed. It is another possible > > > case. > > > > If a file doesn't exist, debugging it will not work. The fact that we > > leave behind an empty buffer is not important. > > Since an empty buffer is useless, why not just not show it in the > first place? I find it disturbing. Because it complicates the code for no good reason. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 18 20:43:49 2025 Received: (at 79036) by debbugs.gnu.org; 19 Jul 2025 00:43:49 +0000 Received: from localhost ([127.0.0.1]:37072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ucvg5-0003aO-3W for submit@debbugs.gnu.org; Fri, 18 Jul 2025 20:43:49 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:54516) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ucvg1-0003Zt-PT for 79036@debbugs.gnu.org; Fri, 18 Jul 2025 20:43:46 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3a57ae5cb17so1320097f8f.0 for <79036@debbugs.gnu.org>; Fri, 18 Jul 2025 17:43:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1752885819; x=1753490619; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=TVCvMlxvJkMseNWs9GaOL67bEVW4wKUrk/O3/o0ojVE=; b=aaY6BGHI7/dn6GEGn96Vrn8PWQSQbhUU/BiRWw+NOKiO9Y5LercxOqrUPdjARHRjIg /6FTmEqjaxm1u+hOB677Y96625zax1ueBZR69XyPkpOvygxlODTd3Af+LMQiunkwy2qY 6p+WT7UrXnxHy9mUmEoKSji7vC9EQmMgZNiSxZ19nQpurJjUKRQ9yXAjgc/chlnC1XK7 cjQz7QaASZMe9wGL0Dy478Ch29FB7r2hbp3IO2Q4+fYpwLSlY4rGgiXFo+YKhxT+WnvZ /yElDicR0H94GlyVc+bUnBEuOEeHtiRmF1ZUytiTFe+YZj/aJDEaWCxdv5hjAyf4pWZR Zkcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752885819; x=1753490619; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TVCvMlxvJkMseNWs9GaOL67bEVW4wKUrk/O3/o0ojVE=; b=g0suXtJQ2ghFrt3BH/Uh8nYichj+ikkM+GqrY4J130RvESgszuPiAycFu/bS3/PJ99 AxASSZD2Z4WvbU49Rbfp+7verXD44ZX6uTL3aJY1T6piC3OldUbRZbUWO95QbW0FvT/P yWsEEclaRCnxq1Hgnvg8ZhyHkqL2X9IycoBrSsjoUvxTwIZpAGu9EomI8Li3V2eqGZw5 +jqlVfiozyZ9rIy2iEiUpfwqcnFLjZkVVyXLxrnAqCl0DoceEJcfvW+wXswpSjh+39tw dxQC7ZWHEcR8jeYzr6m/oH+O8v6cN/srSxG5xVZckNdYACQN7vej3+o3MlLBK5jLJRCo mszA== X-Forwarded-Encrypted: i=1; AJvYcCVs1k5slc2TrkOJ6I/LfJW8rEANDIhYCNTjq25rFbm9Rkr464WqxSKeF3RxenG92NeFPG8i2w==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yxb8S2iv4CDpQrU1cKnU6rShQDsVDlQ9srFwxFPfwHdIRCrxbQj /T/0hhLB04eSHkzFi12H2JJNZKD2OIaYq0xCYGPN7z4SzIDekln+ArHgRrcDV5lX3k+JAnlVPFk zDv0hXhPzKerzFUpx33EuBDyd6InXN10= X-Gm-Gg: ASbGncs6heJvRfwOt5rKjmktVXyWM3eYDeWXvjWQQ7ub3FSe1RF5fpwjGxAP0VKn1Bp Ot3Q7mSV7V0twveYL65xa5d76++5i5WCQfkhbOm0mL2PB4CllstH9zjQYNPoeeo/xCRaXok+mz5 IPrx/q3oz6HykoyObucEzI1osOGtRjtNfJBXy07L1zOEqoiHJ+sSRipOJUzozEak3N6eQZLQjvy +sC+A8= X-Google-Smtp-Source: AGHT+IGswQYwevS6XrUSVT6U8cB6Yag30y9cOaQ0wU0HT4SXQ2jlzVG92KbiCi9OTCOXh5K/WEYiILSlWBpJ1Q0I+5g= X-Received: by 2002:a05:6000:230e:b0:3b3:9cb4:43f9 with SMTP id ffacd0b85a97d-3b60e4d0135mr10152911f8f.16.1752885819242; Fri, 18 Jul 2025 17:43:39 -0700 (PDT) MIME-Version: 1.0 References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <87seith9jn.fsf@gmx.de> <86h5z9ft30.fsf@gnu.org> <86fretfrd1.fsf@gnu.org> In-Reply-To: <86fretfrd1.fsf@gnu.org> From: Liu Hui Date: Sat, 19 Jul 2025 08:43:28 +0800 X-Gm-Features: Ac12FXwTIpqYbf3yhIeIw2DDLGVgPqvuc3GjB7M5ur7lkMGLAUA63kbVF-zuFYk Message-ID: Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Fri, Jul 18, 2025 at 11:31 PM Eli Zaretskii wrote: > > > From: Liu Hui > > Date: Fri, 18 Jul 2025 23:19:49 +0800 > > Cc: Michael Albinus , kobarity@gmail.com, 79036@debbugs.gnu.org > > > > O [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (liuhui1610[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:42c listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (liuhui1610[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 1.0 FREEMAIL_REPLY From and body contain different freemails X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org, kobarity@gmail.com, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Fri, Jul 18, 2025 at 11:31=E2=80=AFPM Eli Zaretskii wrote= : > > > From: Liu Hui > > Date: Fri, 18 Jul 2025 23:19:49 +0800 > > Cc: Michael Albinus , kobarity@gmail.com, 79036= @debbugs.gnu.org > > > > On Fri, Jul 18, 2025 at 10:53=E2=80=AFPM Eli Zaretskii w= rote: > > > > > > > From: Michael Albinus > > > > Cc: Eli Zaretskii , kobarity@gmail.com, 79036@debbu= gs.gnu.org > > > > Date: Fri, 18 Jul 2025 16:13:00 +0200 > > > > > > > > Liu Hui writes: > > > > > > > > > For example, below is the pdb output in a remote python shell, an= d the > > > > > file-name "/tmp/test.py" is local. Because of the "from ... impor= t > > > > > ...", we can know the file is on the remote system. > > > > > > > > > > >>> from test import f; f() > > > > > > /tmp/test.py(3)f() > > > > > -> return 1 > > > > > (Pdb) > > > > > > > > > > However, with the following pdb output in a remote python shell > > > > > > > > > > >>> f() > > > > > > /tmp/test.py(3)f() > > > > > -> return 1 > > > > > (Pdb) > > > > > > > > > > The local filename "/tmp/test.py" may be on the remote system lik= e the > > > > > above case, or may be on the local host if we press C-c C-c to se= nd > > > > > its code to the remote process. > > > > > > > > > > Which file should python shell track? The simplest solution is to > > > > > check which file exists. > > > > > > > > No. The mature check is whether default-directory is remote. Everyt= hing > > > > else is voodoo. Can work, but no guarantee. > > > > > > Right. > > > > I agree Emacs should first find the file on the remote system when the > > python shell is remote. But if the file doesn't exist, I think it is > > reasonable to try finding local file (supposed behavior currently in > > python-pdbtrack-set-tracked-buffer but there is a bug) instead of > > opening an empty remote file (actual behavior) or doing nothing. I > > would like to add an option if you think Emacs should just find the > > remote file. > > If we decide that the file is local, the value of default-directory > should reflect that. Then all our infrastructure for handling files > will seamlessly work correctly. The discussion remind me of that in bug#78925. When ffap find a local file name in buffers with remote default directory, both you and Michael agree Emacs first finds the file in local host by default. In this thread, when pdbtrack find a local file name in the remote buffer, both you and Michael agree Emacs should find the file name according to the default-directory. Should Emacs set the default value of ffap-prefer-remote-file to t for consistency? From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 19 02:26:54 2025 Received: (at 79036) by debbugs.gnu.org; 19 Jul 2025 06:26:54 +0000 Received: from localhost ([127.0.0.1]:38903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ud125-0006T7-Om for submit@debbugs.gnu.org; Sat, 19 Jul 2025 02:26:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52708) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ud122-0006Sh-Ht for 79036@debbugs.gnu.org; Sat, 19 Jul 2025 02:26:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ud11w-0001F7-Qe; Sat, 19 Jul 2025 02:26:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=sTF9re0wzzectBDCOrMzPum94CIHnuSNDQK9U61KA3M=; b=T0jo+76f3Nf5P9mrUEKA ozkhgFb7KWeKP0cJHYCBZWy76gutNEAFEALIxKOmDc0nRM0tpqbCn3ld44vAXZe1kMZ5ds9gem9mm 7IJtfzy0OhleshxubcvFnwFZzTZ1aIAcTfXOjnsMw0pt17GIfleLn3hDplNO5F9BfdVk/mJUJ5gUU rUSXH6++/e/e8gzazB1g7MR/BMGIpvAPtzuBIMLA2sUS5jbP4xbtfeCfMb9/vRMTPmVrZSGCc7JT6 EcYMSZjLnUQgnQ03NF6eZrOwdw0U7Ax77XfLbmFQ0XsCmvV2yQLWQyLOrsIueRTWAdsEv9Ww5B5kA d/8lPq0wlkx3+Q==; Date: Sat, 19 Jul 2025 09:26:37 +0300 Message-Id: <86cy9wg0gy.fsf@gnu.org> From: Eli Zaretskii To: Liu Hui In-Reply-To: (message from Liu Hui on Sat, 19 Jul 2025 08:43:28 +0800) Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <87seith9jn.fsf@gmx.de> <86h5z9ft30.fsf@gnu.org> <86fretfrd1.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org, kobarity@gmail.com, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Liu Hui > Date: Sat, 19 Jul 2025 08:43:28 +0800 > Cc: michael.albinus@gmx.de, kobarity@gmail.com, 79036@debbugs.gnu.org > > On Fri, Jul 18, 2025 at 11:31 PM Eli Zaretskii wrote: > > > > > From: Liu Hui > > > Date: Fri, 18 Jul 2025 23:19:49 +0800 > > > Cc: Michael Albinus , kobarity@gmail.com, 79036@debbugs.gnu.org > > > > > > On Fri, Jul 18, 2025 at 10:53 PM Eli Zaretskii wrote: > > > > > > > > > From: Michael Albinus > > > > > Cc: Eli Zaretskii , kobarity@gmail.com, 79036@debbugs.gnu.org > > > > > Date: Fri, 18 Jul 2025 16:13:00 +0200 > > > > > > > > > > Liu Hui writes: > > > > > > > > > > > For example, below is the pdb output in a remote python shell, and the > > > > > > file-name "/tmp/test.py" is local. Because of the "from ... import > > > > > > ...", we can know the file is on the remote system. > > > > > > > > > > > > >>> from test import f; f() > > > > > > > /tmp/test.py(3)f() > > > > > > -> return 1 > > > > > > (Pdb) > > > > > > > > > > > > However, with the following pdb output in a remote python shell > > > > > > > > > > > > >>> f() > > > > > > > /tmp/test.py(3)f() > > > > > > -> return 1 > > > > > > (Pdb) > > > > > > > > > > > > The local filename "/tmp/test.py" may be on the remote system like the > > > > > > above case, or may be on the local host if we press C-c C-c to send > > > > > > its code to the remote process. > > > > > > > > > > > > Which file should python shell track? The simplest solution is to > > > > > > check which file exists. > > > > > > > > > > No. The mature check is whether default-directory is remote. Everything > > > > > else is voodoo. Can work, but no guarantee. > > > > > > > > Right. > > > > > > I agree Emacs should first find the file on the remote system when the > > > python shell is remote. But if the file doesn't exist, I think it is > > > reasonable to try finding local file (supposed behavior currently in > > > python-pdbtrack-set-tracked-buffer but there is a bug) instead of > > > opening an empty remote file (actual behavior) or doing nothing. I > > > would like to add an option if you think Emacs should just find the > > > remote file. > > > > If we decide that the file is local, the value of default-directory > > should reflect that. Then all our infrastructure for handling files > > will seamlessly work correctly. > > The discussion remind me of that in bug#78925. > > When ffap find a local file name in buffers with remote default > directory, both you and Michael agree Emacs first finds the file in > local host by default. > > In this thread, when pdbtrack find a local file name in the remote > buffer, both you and Michael agree Emacs should find the file name > according to the default-directory. > > Should Emacs set the default value of ffap-prefer-remote-file to t for > consistency? ffap-prefer-remote-file is a new option, and we are generally default those to values that preserve past behavior. From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 21 12:01:40 2025 Received: (at 79036) by debbugs.gnu.org; 21 Jul 2025 16:01:40 +0000 Received: from localhost ([127.0.0.1]:58388 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1udsxP-0002nb-7z for submit@debbugs.gnu.org; Mon, 21 Jul 2025 12:01:40 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:55757) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1udsxM-0002n4-EY for 79036@debbugs.gnu.org; Mon, 21 Jul 2025 12:01:37 -0400 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-235d6de331fso51844695ad.3 for <79036@debbugs.gnu.org>; Mon, 21 Jul 2025 09:01:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753113690; x=1753718490; darn=debbugs.gnu.org; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=Adu7v5yiUBqRS+pXavhOUUNg0nNP8rJc+5QVCTY5uLo=; b=aGN7zyLDm1TRiVPaej3jPO6YhhTJUJppHXI6iXoa5DVibySlZQsi6ZJBrYjHPE2oS9 7dw3Z9hcGJDa4adrfHSRviThHEQnNSvLqU27udaA+R8RNb1zWkoLIKJPwckpIkKVrsfm cidcg3vAQyDw49e/F969KBKyXtXHjKlV/rRyFKBm4FHaEorkPcZMnQA4OEAcuKPRl1JP sd3+GV/p3otSxpvG8Dvu123M9wMVT+OsJNPEDZLJZ+hfBxTpTpGIlytpORDQMO/NQGXA CABdBlW2vW8vZ+UCMkrzUTvDgP5zcKNlNYKhoIdlDX+57yIqzLGrmWrvs+GoMbWhd34S 8XrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753113690; x=1753718490; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Adu7v5yiUBqRS+pXavhOUUNg0nNP8rJc+5QVCTY5uLo=; b=v2rWsD3SjuNW6lhfxw1z+QntlR4qLN/lxLzf9ZBSLwp/E3MN9hL7zShNCiAq1+6i4R igZvYwMUvZearswC9wBG/skftae8m8idC6aBr4u2JgI5r9JgMSTLJhGFsuT4Wb2EjYRj qWsdYv1A/x5Ffnnp+aSr9FyRndMiDMKVHv5532hXfKJuMJ0ULnduuU473kZXHj7GiDPm 0ucbjT8aopfJkeK847AdsZvAvxlcPRRkx/dPMbjth+NzTCuS3PrBhtQAOWXI/Hg+PXzx LLuSmiRt27DlzM33rVJSOfb+0Z3544JsRMbzWJ+liVvtNC1ug8z9yKcoY4m6/RxIxMGL xqJQ== X-Gm-Message-State: AOJu0Yy2d9Z2CXmb0QDSFUr6G6uarwwbXxMn9zfNCbNw0fwew0ckDDuV TRPRrlGrUrrkZbAq8o6EWFyr49LRVHYV+rz2ziFSFo6C+U9kuOU0JoDX X-Gm-Gg: ASbGnctXO8VtPnNkMqzGNIUG2xqlKVYXW1/jD5uXQD+eTV1Zk1YClFusKLl3SZAx0Vd 9ZnVO7WpEgCoqnFYlUnwXh0s8ffeCS70byUDc9yjdWpec/5NyblYcZRSHLzc6tkJ3BBMOYJljTV chjMR9rR5ywxTNpAQYD7qHAUZKwzJAhkkPIurREr/5zr8PBNyyg5hnUT6hM2BEURYmFnlUzJ6K5 CVOnV5/aWIhck6FJtgQiBvObp2iBtX3b/4v/DubSuihM3iKc+YlkvL6AZy4XIFdAPYifbI8Ujan Uk3if6FmCEXQXwd3n+PkPb6LRV65ZLmT3kT3+h4buDLjB1WO4eCpmtkhvoOviuy96IU90tKhBNw OllXrQ++73oJ9LMckCo1/6eF4cZg9VpsULpm3EDIMXt6GTPR2mWHt X-Google-Smtp-Source: AGHT+IHPPp9b6QPSYqq0ipu/HdL6YTCAMKEB3I4j57dbpQb09nQfGsC0IckLD9T4pj96SC85A05WjA== X-Received: by 2002:a17:903:acc:b0:234:d778:13fa with SMTP id d9443c01a7336-23e2572b0b5mr304992035ad.26.1753113689785; Mon, 21 Jul 2025 09:01:29 -0700 (PDT) Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23f75d13bdfsm40048675ad.51.2025.07.21.09.01.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jul 2025 09:01:29 -0700 (PDT) Date: Tue, 22 Jul 2025 01:01:26 +0900 Message-ID: From: kobarity To: Eli Zaretskii , Liu Hui , michael.albinus@gmx.de Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames In-Reply-To: <86ecudfj9w.fsf@gnu.org> References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <86ikjpft4p.fsf@gnu.org> <86ecudfj9w.fsf@gnu.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/31.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: multipart/mixed; boundary="Multipart_Tue_Jul_22_01:01:26_2025-1" X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Multipart_Tue_Jul_22_01:01:26_2025-1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Eli Zaretskii wrote: >=20 > > From: Liu Hui > > Date: Fri, 18 Jul 2025 23:31:50 +0800 > > Cc: michael.albinus@gmx.de, kobarity@gmail.com, 79036@debbugs.gnu.org > >=20 > > On Fri, Jul 18, 2025 at 10:52=E2=80=AFPM Eli Zaretskii w= rote: > > > > > > > From: Liu Hui > > > > Date: Fri, 18 Jul 2025 22:06:56 +0800 > > > > Cc: michael.albinus@gmx.de, kobarity@gmail.com, 79036@debbugs.gnu.o= rg > > > > > > > > On Fri, Jul 18, 2025 at 8:08=E2=80=AFPM Eli Zaretskii wrote: > > > > > > > > > > > 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 sy= stem 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"? > > > > > > > > For example, below is the pdb output in a remote python shell, and = the > > > > file-name "/tmp/test.py" is local. Because of the "from ... import > > > > ...", we can know the file is on the remote system. > > > > > > > > >>> from test import f; f() > > > > > /tmp/test.py(3)f() > > > > -> return 1 > > > > (Pdb) > > > > > > > > However, with the following pdb output in a remote python shell > > > > > > > > >>> f() > > > > > /tmp/test.py(3)f() > > > > -> return 1 > > > > (Pdb) > > > > > > > > The local filename "/tmp/test.py" may be on the remote system like = the > > > > above case, or may be on the local host if we press C-c C-c to send > > > > its code to the remote process. > > > > > > > > Which file should python shell track? The simplest solution is to > > > > check which file exists. > > > > > > Doesn't the value of default-directory tells us whether it's a local > > > or a remote file? If not, why not? > >=20 > > In the example: > >=20 > > >>> f() > > > /tmp/test.py(3)f() > > -> return 1 > > (Pdb) > >=20 > > The current buffer is the Python shell buffer, default-directory is > > remote only means > > python process is remote. "/tmp/test.py" may be on the local host beca= use users > > may send code in local file "/tmp/test.py" to the remote process. >=20 > This cannot work reliably, and I don't think we should support it. > Please ignore this case in the following discussions. I agree that this method does not work reliably. However, I think we can take another approach. First, let me explain the problem. The inferior Python process is invoked on the remote host if the Python file buffer is remote. There are two buffers, both remote. 1. Python file buffer. 2. Inferior Python buffer. By default, the inferior Python buffer is shared among Python files. So if we open another local Python file, it uses the above remote inferior Python buffer. When we send the contents of the local file using C-c C-c to the inferior Python buffer, the local file name such as "/tmp/test.py" is passed. This results in the above problem. I think the file name without any prefix such as "/tmp/test.py" should be used when and only when the inferior Python process can handle it. When sending the local "/tmp/test.py" to the remote Python process, passing the file name "/tmp/test.py" is useless because there is no guarantee that the same "/tmp/test.py" exists on the remote host. Instead, I think it would be better to pass the file name with the prefix indicating that the file is local. The inferior Python process (PDB) itself still cannot handle that file name, but the PDB tracking feature can take advantage of it. If TRAMP supports a method such as "/local:" to access local files, we can use it. As TRAMP does not seem to have such a thing, I use "/ssh::" instead. The real "/ssh::" requires an SSH server to be running on the local host, but I'm just using it as a pseudo prefix to distinguish local files from remote files. i.e. SSH server is not required on local host. The case of multiple remote hosts should also be considered. In summary, it seems to me that it would be a good idea to pass the file names as shown in the following table. | | Local Python | Python on remote1 | |-------------------+---------------------+---------------------| | Local tmp.py | tmp.py | /ssh::tmp.py | | tmp.py on remote1 | /ssh:remote1:tmp.py | tmp.py | | tmp.py on remote2 | /ssh:remote2:tmp.py | /ssh:remote2:tmp.py | Local Python cases are already covered with current python.el. Attached is a PoC-level patch to support Remote Python cases. What do you think of this approach? --Multipart_Tue_Jul_22_01:01:26_2025-1 Content-Type: application/octet-stream; type=patch; name="79036.diff" Content-Disposition: attachment; filename="79036.diff" Content-Transfer-Encoding: 7bit diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index f4f0518dbfd..703d933992b 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3695,6 +3695,8 @@ python-shell-eval-file-setup-code "Code used to evaluate files in inferior Python processes. The coding cookie regexp is specified in PEP 263.") +(defconst python-shell-local-prefix "/ssh::") + (defun python-shell-comint-watch-for-first-prompt-output-filter (output) "Run `python-shell-first-prompt-hook' when first prompt is found in OUTPUT." (when (not python-shell--first-prompt-received) @@ -4013,6 +4015,24 @@ 'python-shell--encode-string (signal 'wrong-type-argument (list 'stringp text))))) "Encode TEXT as a valid Python string.") +(defun python-shell--file-name-to-send (process) + "Return the file name to send to inferior Python PROCESS." + (let ((file-name (buffer-file-name)) + (process-prefix + (file-remote-p + (with-current-buffer (process-buffer process) default-directory)))) + (if file-name + (if process-prefix + (let ((remote-p (file-remote-p file-name)) + (local-name (file-local-name file-name))) + (if remote-p + (if (string= remote-p process-prefix) + local-name + file-name) + (concat python-shell-local-prefix local-name))) + file-name) + ""))) + (defun python-shell-send-string (string &optional process msg) "Send STRING to inferior Python PROCESS. When optional argument MSG is non-nil, forces display of a @@ -4020,11 +4040,11 @@ python-shell-send-string t when called interactively." (interactive (list (read-string "Python command: ") nil t)) - (let ((process (or process (python-shell-get-process-or-error msg))) - (code (format "__PYTHON_EL_eval(%s, %s)\n" + (let* ((process (or process (python-shell-get-process-or-error msg))) + (code (format "__PYTHON_EL_eval(%s, %s)\n" (python-shell--encode-string string) - (python-shell--encode-string (or (buffer-file-name) - ""))))) + (python-shell--encode-string + (python-shell--file-name-to-send process))))) (unless python-shell-output-filter-in-progress (with-current-buffer (process-buffer process) (save-excursion @@ -5079,8 +5099,12 @@ python-pdbtrack-set-tracked-buffer "Set the buffer for FILE-NAME as the tracked buffer. Internally it uses the `python-pdbtrack-tracked-buffer' variable. Returns the tracked buffer." - (let* ((file-name-prospect (concat (file-remote-p default-directory) - file-name)) + (let* ((file-name-prospect + (if (file-remote-p file-name) + (if (string-prefix-p python-shell-local-prefix file-name) + (string-remove-prefix python-shell-local-prefix file-name) + file-name) + (concat (file-remote-p default-directory) file-name))) (file-buffer (get-file-buffer file-name-prospect))) (unless file-buffer (cond --Multipart_Tue_Jul_22_01:01:26_2025-1-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 21 13:47:42 2025 Received: (at 79036) by debbugs.gnu.org; 21 Jul 2025 17:47:42 +0000 Received: from localhost ([127.0.0.1]:58987 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uduc2-00021H-7x for submit@debbugs.gnu.org; Mon, 21 Jul 2025 13:47:42 -0400 Received: from mout.gmx.net ([212.227.15.18]:51643) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uduc0-000212-Pc for 79036@debbugs.gnu.org; Mon, 21 Jul 2025 13:47:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1753120046; x=1753724846; i=michael.albinus@gmx.de; bh=DU7iwaDJJ45heDLwBArPhnH4l+lGW9yqdDu5iJ6SfkE=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=YBqCl6K5v90CSrjSSdwBe+VsXMwu/8I/S6T7zMpbJaTaCUR0HYuTkWHFDjm1uWxL ouwmjTBw5GM0r5HafTZrDgQFg/4rCZKNsEnM8hkOtkXYo07vtFnp1Wqx/BI0LF/ei VSxzBjglyTbliIRbtfD5GJvZWzyljKquMDi7Uoxlcz44SCdpubHWNK3rV55Qbj8DC p6DkyqBVLeq6KSfHdYqCfOk4JCR/EpnizLpDQGZaQLBNvusP4Cew1u9DlFd4Wx3VQ 8hQgVNKSyW/Xj3m1CkMHdssC4ouN+3fzNl3Fy13R3V0qWXPBdGRvY20QSe3Iijwwh TW2qmqSinigcsMN0tQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.37.61]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MPXhA-1uHHQK0Zqk-00THqr; Mon, 21 Jul 2025 19:47:26 +0200 From: Michael Albinus To: kobarity Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames In-Reply-To: References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <86ikjpft4p.fsf@gnu.org> <86ecudfj9w.fsf@gnu.org> Date: Mon, 21 Jul 2025 19:47:25 +0200 Message-ID: <87tt35307m.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:qJmdunKQDZodsTeuFyun9vyyBpXivDJWkn4GxGH8Hz3c7/Bgq48 Fms1Pg5Jij3wSEagvIiQiMEYzem/o1DkTc2ordSqW2ZTah0krBWpzMnMU5rrvxgHF1ojjbv jU/cunkZCM7ijBz8VvcGAA+Tgg2I2Cys3mdaty+rE7f1H16JEl30B3iF9rjOI5OJkuNGN9w ueYPdSjP2TXW3+d5PVoXw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:gCZGS4luffU=;YYYy8DfhhHtc3yWzZeK79r1esUg XPsXnEhkN/aZGDShUm5UUwizqeK3lFEorjxlc3rQMFTpTWlM8kBX25awbAVvadWG3YfFBf6IH rd80jAgyByEH8GQLJvPaLGf3CRMh43Zr55H/S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+uWaTTb4g2Im5c+yZh0d4/nUha2DLED7ut9tLVHpS8WuIjjA8soexCPax dI4m4lw8Qc7hd9WKxL6f3qn9RFfuV9E8uWCcLSYaEhdSrSs633Pz+W5b3zVTR7IoH/7qSxKqk weCUafpKtl3zKeiKgjI1J73FV1wp+PCupVae8op7IlXjUGWQGh69MFzU9Rf+0gVAtxc0aR9MR 7cYl6CjMOZACILrnRKUfX7HwOvRtzDuprnzn7a4OZuGs7KdCA9J+D46yVM/cgS2uQ9j8i0qsu 14j7VjK4Run63qvuOY2dKSB8ZpLjUbKlWXLV4Y7WKjGJcS5YukiXU1TFFO0g0FicYw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79036 Cc: Liu Hui , Eli Zaretskii , 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) kobarity writes: Hi, > If TRAMP supports a method such as "/local:" to access local files, we > can use it. As TRAMP does not seem to have such a thing, I use > "/ssh::" instead. The real "/ssh::" requires an SSH server to be > running on the local host, but I'm just using it as a pseudo prefix to > distinguish local files from remote files. i.e. SSH server is not > required on local host. FTR, Tramp knows a method "local". It is used for internal purposes; I don't know whether it is worth to expose it to the outer world. Eshell has a similar problem. It must know, whether a command runs on the local host, or on the remote host as determined by default-directory. It uses the "/local:" prefix to force commands for the local host, even if they would run on the remote host otherwise. Perhaps you can adapt this approach to your needs. See (info "(eshell) Remote Access") Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 22 06:14:54 2025 Received: (at 79036) by debbugs.gnu.org; 22 Jul 2025 10:14:54 +0000 Received: from localhost ([127.0.0.1]:35222 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ueA1O-0004r4-4n for submit@debbugs.gnu.org; Tue, 22 Jul 2025 06:14:54 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:50524) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ueA1L-0004q9-2K for 79036@debbugs.gnu.org; Tue, 22 Jul 2025 06:14:51 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-45622a1829eso16559825e9.1 for <79036@debbugs.gnu.org>; Tue, 22 Jul 2025 03:14:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753179284; x=1753784084; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=xxnhGR+iII7mHZlg9XyXCI6SXo5UWpx2dqlCxcjHGjg=; b=mW49KMEgXnxl+mRRIRuX8XPVa5FRhf+4Ah2rNazMuiS/lOKq6o9U3r2Xzq+zAw/xdR ns1qiVKnsrx5dZKHj0uD1mAqYHPn6kLzk1m0Eup+4orwG2DqoRBaG9Wuj3da+jZcxwGp 1VaLtBot9UbJ2klNpQAvLJbVFtug4Xc/g7EMbdFdkclaIHZ7ZGRrHvhpezuftik8kmMQ 8T7gRLdm76gmGQwyERKzFxWRgIl8goUoQdyDUHF4Z95gfe3iG7CwzOi416JT0ADYEx/U XHEYlYbUhictQ3mCRqst0G1hDmIotPwJq4Mby0uNbQXoocbH/3r6RhmK3bnFixXM87dr k+eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753179284; x=1753784084; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xxnhGR+iII7mHZlg9XyXCI6SXo5UWpx2dqlCxcjHGjg=; b=MnXVu24QL9enXya3PnpdtmdDVylNO2F23rrloxg47hBzBxnLBHPllb65bpnPMyp16c i/maawF+MEo2MLX7caTZgERBpjYQ289kiFY5lA1TXlHf3gydW11mJPgs0Xm4cpJvwZw9 7/S0eZeLzx/vFTfzo+shpViQU8aEV3MIb3I4rCS6fdEGFhMAImGz7Lm0aR+4yoobLt5n mAq9JR7G27kFP8NG3J63AjWUQ3FkN3avGyKHQgSI5r5vl0xI+h9qtdI4sLJsacoC+Jcb bCsws4yTr+ttNotIk/PHmZY+K5m7s+37toXkrMZ5TagMLfRP0S58i4Keggy/dPE4PXnW FCqQ== X-Forwarded-Encrypted: i=1; AJvYcCW8DQjE8EV2BVIC89OT9rqJJGE7xs8z4Ch42CrehqmKZcvTejz4h3c0Gq+EH8zmY0V6sDUIQA==@debbugs.gnu.org X-Gm-Message-State: AOJu0YwryZfy07H6l+RNzJrlAcbohMxHBEe05peCXL0XqWVkQy23smQu Wrkfvk24E22V4ZpwlGshN+SXIbrS2K49wQzoGTXS32kXX0uaKkcrXqaGLwY2aMD5JnbGgDabd4q HfXNGwpcc6QOUtoDcIgroxtQ+0dTaLgI= X-Gm-Gg: ASbGncs5Gyfr7z1n3IhTelC/F+jj6TbuqDsyL65KJtx4hSZMb6g5Nt0kpJESf/e3cVd el71fdAmMKln0cBf2B2/ZhgYDgLGydXq3xO7tV3aOfqN5O9qYKsAdScFJ2ltdig8CiehlTuO3EF PTsqB8wB60slrP8NJcEtlYir10vFOt9ejVyI1gLEqkqFdX/PAy0DhdKM3KkmE4SRKQU5tIG+gh9 FPwUlw= X-Google-Smtp-Source: AGHT+IEQhK7/E186UKh73yUB8UOyIW1M9jBt+VGH4MKd/zkdr689rFor4RRmuqQvhx3NsjKOU6fVFd2GR7rdOPmrkzY= X-Received: by 2002:a05:600c:45d0:b0:456:11db:2f1e with SMTP id 5b1f17b1804b1-4563b8b3559mr159679705e9.15.1753179283844; Tue, 22 Jul 2025 03:14:43 -0700 (PDT) MIME-Version: 1.0 References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <86ikjpft4p.fsf@gnu.org> <86ecudfj9w.fsf@gnu.org> In-Reply-To: From: Liu Hui Date: Tue, 22 Jul 2025 18:14:31 +0800 X-Gm-Features: Ac12FXz8ClKzNJkgdXv2HMwhbBW7cN485X_Gnm4Wh1SK1Wx7XhuckSg4_8PCBDY Message-ID: Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames To: kobarity Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org, Eli Zaretskii , michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Tue, Jul 22, 2025 at 12:01=E2=80=AFAM kobarity wrot= e: > The case of multiple remote hosts should also be considered. In > summary, it seems to me that it would be a good idea to pass the file > names as shown in the following table. > > | | Local Python | Python on remote1 | > |-------------------+---------------------+---------------------| > | Local tmp.py | tmp.py | /ssh::tmp.py | > | tmp.py on remote1 | /ssh:remote1:tmp.py | tmp.py | > | tmp.py on remote2 | /ssh:remote2:tmp.py | /ssh:remote2:tmp.py | > > Local Python cases are already covered with current python.el. > Attached is a PoC-level patch to support Remote Python cases. > > What do you think of this approach? Hi, I think it is better since it explicitly identifies the source of code. Then there is no confusion and file-exists-p is not needed in python-pdbtrack-set-tracked-buffer. > +(defun python-shell--file-name-to-send (process) > + "Return the file name to send to inferior Python PROCESS." > + (let ((file-name (buffer-file-name)) > + (process-prefix > + (file-remote-p > + (with-current-buffer (process-buffer process) default-director= y)))) > + (if file-name > + (if process-prefix > + (let ((remote-p (file-remote-p file-name)) > + (local-name (file-local-name file-name))) > + (if remote-p > + (if (string=3D remote-p process-prefix) > + local-name > + file-name) > + (concat python-shell-local-prefix local-name))) > + file-name) > + ""))) For non-file buffers, could it return buffer name instead of ? e.g. # or # where NAME may need to be quoted. Then python-pdbtrack-set-tracked-buffer can find it by (get-buffer-create "NAME"). From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 22 07:42:01 2025 Received: (at 79036) by debbugs.gnu.org; 22 Jul 2025 11:42:01 +0000 Received: from localhost ([127.0.0.1]:35762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ueBNg-0000W3-G3 for submit@debbugs.gnu.org; Tue, 22 Jul 2025 07:42:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52158) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ueBNb-0000VM-HV for 79036@debbugs.gnu.org; Tue, 22 Jul 2025 07:41:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ueBNU-00042y-D4; Tue, 22 Jul 2025 07:41:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=US8RwwvS0y+lL+VJbrVl4n6Lfs/n4t8bywmOmXZq7VM=; b=EA6+M/YR5ubr Kgjo/AnvHEaUQGDcg1DOXERWbzy1gBOzZBdCVyA3sVMBz/uEBT3z4gLvF1dSKfBuAU4Zh0cpErhQL tnrlCfoiDmgSxX/qpVcvk0i6IUX620MqMvDiidfa6BqqJ+WUkvthEQBDPVs1Stsfti17dCVMNtPXK FiiPQ+5IaUkyGDubSdBG/MV3x39YRWxt32vQ4ezGG40U5H52+gViCwZ/OvB/GJVULGKx00iEomzQA zX+hGpirIIM4/ObxPY52eCATyfxABit5Gf1uBp5o+RZbvwU+KcXZsfQ+65QGotcQ9c/zbtm0fwHOY EfKRUpRyFofaa/bSzH2IFw==; Date: Tue, 22 Jul 2025 14:41:38 +0300 Message-Id: <861pq8bggd.fsf@gnu.org> From: Eli Zaretskii To: kobarity In-Reply-To: (message from kobarity on Tue, 22 Jul 2025 01:01:26 +0900) Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <86ikjpft4p.fsf@gnu.org> <86ecudfj9w.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79036 Cc: liuhui1610@gmail.com, michael.albinus@gmx.de, 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Tue, 22 Jul 2025 01:01:26 +0900 > From: kobarity > Cc: 79036@debbugs.gnu.org > > First, let me explain the problem. The inferior Python process is > invoked on the remote host if the Python file buffer is remote. There > are two buffers, both remote. > > 1. Python file buffer. > 2. Inferior Python buffer. > > By default, the inferior Python buffer is shared among Python files. > So if we open another local Python file, it uses the above remote > inferior Python buffer. When we send the contents of the local file > using C-c C-c to the inferior Python buffer, the local file name such > as "/tmp/test.py" is passed. This results in the above problem. I thought the problem was the opposite one: a file name such as "/tmp/test.py" in an inferior Python buffer refers to the file on the same host as the default-directory of the inferior Python buffer. Thus, if default-directory of the inferior Python buffer is on a remote host, the file "/tmp/test.py" there refers to a remote file, although its form is as that of a local file. You are describing an almost opposite problem. > If TRAMP supports a method such as "/local:" to access local files, we > can use it. We could use it, but I still don't see how this would solve the problem(s) discussed here. Please elaborate. From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 23 11:08:23 2025 Received: (at 79036) by debbugs.gnu.org; 23 Jul 2025 15:08:23 +0000 Received: from localhost ([127.0.0.1]:50842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ueb4x-00063f-6M for submit@debbugs.gnu.org; Wed, 23 Jul 2025 11:08:23 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]:57544) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ueb4v-000624-7W for 79036@debbugs.gnu.org; Wed, 23 Jul 2025 11:08:22 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-748e63d4b05so33237b3a.2 for <79036@debbugs.gnu.org>; Wed, 23 Jul 2025 08:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753283295; x=1753888095; darn=debbugs.gnu.org; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=XIHQUFYptvQK9jPq2czkRAByFfSLfqQWsCX7FYG0sOc=; b=UZY8eF8EsRxgshZnpI0xfRJfy5sOAGQhp92MSL+BNlBmkTp8RInMqbCRf91Tq0Z8j1 T7rrszghJDn28faJ758jhEshBTnEg3vqLe96KeoCfaE4iTxwk4JHuIFGO31d5zZ2Elml h6e9PdNjAgCvFPItgjY/wRkkvDNy5N6LZ2zXqA0K/zIYnGuVrUldYGn2xjCbMy/8RF6G NasRTQQx/nsvhAf9aXRCKqRaXIJZ977g0UIqArNRa+dtik2H+mjJW1AJGs7YB2YMi5ST GvkK0DKDtdWUwKurr7YOM69RYelVNkTLXkqYtkZR9bvwsdla8N0FcnD27XoM2bmdonyf nlBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753283295; x=1753888095; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=XIHQUFYptvQK9jPq2czkRAByFfSLfqQWsCX7FYG0sOc=; b=V2gDzT0UNp31G+c9HvaHO3Cr2QtfJ+RaT6Z25zTtSNLxqxlImZRf1/lCE+EnxIX4JD pd0tuglr5uergoR+stf5xOpf3C9w0opP8qVQECNBJLHMhsx37R/+KbiOsftbd5FM48x4 vBn6uUKuWvsOCmFi4Vs50Kr4JyFJ5z2tzHB+ftLy11JsRF9or7hBOk1ip86hOcXhdxMn RIbP8yDFAy9SdfeECJAcQc6v/rNH+2X19Om0X8Uh0hdUIy3P7a062shKN7mEvnd6XH7P QbHO5S2VGdwQeDPYVOHmy1roqOY4SFYkKeFNHArV5iYR9rWUS/vg8rXZxiJYrk1zJIxf pSGQ== X-Gm-Message-State: AOJu0YxUmVFq8oToD3c8DFCmDI2yXK2JnkLFRV0nqZ1GTdKN9n4s+pNq ZQRcfdAJ7gL6VUBFqvM9vD5p5iFT+9xPBV+pFoeX9sz3QNOI2qrogVTp X-Gm-Gg: ASbGncuMwpWD0BbZidp1aMjnHXs26YNLRtDYo5gIjr9RTXm4EE0KtZm1C/Zi3L5qAlQ r40N9j/cWtl6SJ0HLRiYS3ROy2ZpR6NRyz71HBycKlStHVf+GkixrjmzGNXwXQnh269sIg69mFU suxcW++BvrqvRYc2gShJFCKB2GAm+475Ov0n/uOsQ6RHaFe1MY3UmPsOLyhFC873dyYQ238fQq+ svHQcPXEhv4PL0YJ8ACYbUWbZyOadsMXUUSqXIawxqk40GNveF1CerHCi6y4a9/thWFyejLI0Ft FWKzZyjAt7ORUsZ2Cg6VO2UFGdM2Pgj/EIYMP9q0TBM0jKeKTQdpaF1CvMzs5Sn0vEolYQXJYuS 8bHiu9wyOJ5jHbBLaAUKCq3r6IS6C7gsuAnPxsZN9ke4LUSpKdjkDBVA0fDgl01g= X-Google-Smtp-Source: AGHT+IFElNvN2wyQMddsxbSQxVkd47HtX6Uo4haE79wZ/rnLdIAMLyU6hIdup5oDl6MM/CoHBHvzsA== X-Received: by 2002:a05:6a00:4f8b:b0:75e:bd57:59c4 with SMTP id d2e1a72fcca58-760348067fcmr4164898b3a.9.1753283294597; Wed, 23 Jul 2025 08:08:14 -0700 (PDT) Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-759cbc6c16esm9996225b3a.149.2025.07.23.08.08.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jul 2025 08:08:14 -0700 (PDT) Date: Thu, 24 Jul 2025 00:07:49 +0900 Message-ID: From: kobarity To: Eli Zaretskii , liuhui1610@gmail.com, michael.albinus@gmx.de Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames In-Reply-To: <861pq8bggd.fsf@gnu.org> <87tt35307m.fsf@gmx.de> References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <86ikjpft4p.fsf@gnu.org> <86ecudfj9w.fsf@gnu.org> <861pq8bggd.fsf@gnu.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/31.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: multipart/mixed; boundary="Multipart_Thu_Jul_24_00:07:47_2025-1" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Multipart_Thu_Jul_24_00:07:47_2025-1 Content-Type: text/plain; charset=US-ASCII Hi, Michael Albinus wrote: > FTR, Tramp knows a method "local". It is used for internal purposes; I > don't know whether it is worth to expose it to the outer world. > > Eshell has a similar problem. It must know, whether a command runs on > the local host, or on the remote host as determined by > default-directory. It uses the "/local:" prefix to force commands for > the local host, even if they would run on the remote host > otherwise. Perhaps you can adapt this approach to your needs. > > See (info "(eshell) Remote Access") Thanks! I updated my patch using "/local:". Liu Hui wrote: > For non-file buffers, could it return buffer name instead of ? > e.g. # or # where NAME may need to be quoted. Then > python-pdbtrack-set-tracked-buffer can find it by (get-buffer-create > "NAME"). That might be a good idea. Why is `get-buffer-create' is necessary rather than `get-buffer'? Eli Zaretskii wrote: > > > Date: Tue, 22 Jul 2025 01:01:26 +0900 > > From: kobarity > > Cc: 79036@debbugs.gnu.org > > > > First, let me explain the problem. The inferior Python process is > > invoked on the remote host if the Python file buffer is remote. There > > are two buffers, both remote. > > > > 1. Python file buffer. > > 2. Inferior Python buffer. > > > > By default, the inferior Python buffer is shared among Python files. > > So if we open another local Python file, it uses the above remote > > inferior Python buffer. When we send the contents of the local file > > using C-c C-c to the inferior Python buffer, the local file name such > > as "/tmp/test.py" is passed. This results in the above problem. > > I thought the problem was the opposite one: a file name such as > "/tmp/test.py" in an inferior Python buffer refers to the file on the > same host as the default-directory of the inferior Python buffer. > Thus, if default-directory of the inferior Python buffer is on a > remote host, the file "/tmp/test.py" there refers to a remote file, > although its form is as that of a local file. You are correct, but I do not believe that this behavior itself is the problem. For example, this happens when executing "from test import f" in the remote Python buffer. The problem is that the same file name "/tmp/test.py" is used when sending a local file using `python-shell-send-buffer' (C-c C-c). I will explain it later. > You are describing an almost opposite problem. > > > If TRAMP supports a method such as "/local:" to access local files, we > > can use it. > > We could use it, but I still don't see how this would solve the > problem(s) discussed here. Please elaborate. `python-shell-send-buffer' (C-c C-c) does not actually send files. It only sends the contents of the buffer and the associated file name to the Inferior Python process. For example, when sending "/tmp/test.py" to the remote Python process, "test.py" file is not created on the remote host at all. The Python process evaluates the sent contents and build Python objects such as functions. The file name is only used in this evaluation and embedded in the Python objects. We can see it as follows. >>> f.__code__.co_filename '/tmp/test.py' PDB uses this information to show the file name and the line number where it breaks. If the file is accessible, PDB also shows the contents of the line of the file. PDB tracking feature of python.el parses the output of PDB and tries to show the corresponding file. Thus, TRAMP filenames such as "/ssh:remote1:/tmp/test.py" or "/local:/tmp/test.py" is useless for PDB but helpful for PDB tracking. This file name is used only for this purpose, and has nothing to do with Emacs's buffer/file management. The current behavior and my proposal for sending the file name to remote Python (on remote1) are summarized in the following table. | | Current | My proposal | |-------------------------+---------------------------+---------------------------| | Local /tmp/test.py | /tmp/test.py | /local:/tmp/test.py | | /tmp/test.py on remote1 | /ssh:remote1:/tmp/test.py | /tmp/test.py | | /tmp/test.py on remote2 | /ssh:remote2:/tmp/test.py | /ssh:remote2:/tmp/test.py | There are two problems with the current behavior. 1. Using "/tmp/test.py" when sending local file is wrong, because that path may not exist on the remote, or the contents may be completely different. It is possible that PDB shows the wrong line if "/tmp/test.py" exists on the remote but the contents is different. 2. Using "/ssh:remote1:/tmp/test.py" when sending remote file contents to the same remote host is OK for PDB tracking, but makes it impossible for PDB to show the contents of the line while the file exists on the remote host and PDB can access it. --Multipart_Thu_Jul_24_00:07:47_2025-1 Content-Type: application/octet-stream; type=patch; name="79036.diff" Content-Disposition: attachment; filename="79036.diff" Content-Transfer-Encoding: 7bit diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index f4f0518dbfd..088b9777d93 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3695,6 +3695,8 @@ python-shell-eval-file-setup-code "Code used to evaluate files in inferior Python processes. The coding cookie regexp is specified in PEP 263.") +(defconst python-shell-local-prefix "/local:") + (defun python-shell-comint-watch-for-first-prompt-output-filter (output) "Run `python-shell-first-prompt-hook' when first prompt is found in OUTPUT." (when (not python-shell--first-prompt-received) @@ -4013,6 +4015,24 @@ 'python-shell--encode-string (signal 'wrong-type-argument (list 'stringp text))))) "Encode TEXT as a valid Python string.") +(defun python-shell--file-name-to-send (process) + "Return the file name to send to inferior Python PROCESS." + (let ((file-name (buffer-file-name)) + (process-prefix + (file-remote-p + (with-current-buffer (process-buffer process) default-directory)))) + (if file-name + (if process-prefix + (let ((remote-p (file-remote-p file-name)) + (local-name (file-local-name file-name))) + (if remote-p + (if (string= remote-p process-prefix) + local-name + file-name) + (concat python-shell-local-prefix local-name))) + file-name) + ""))) + (defun python-shell-send-string (string &optional process msg) "Send STRING to inferior Python PROCESS. When optional argument MSG is non-nil, forces display of a @@ -4020,11 +4040,11 @@ python-shell-send-string t when called interactively." (interactive (list (read-string "Python command: ") nil t)) - (let ((process (or process (python-shell-get-process-or-error msg))) - (code (format "__PYTHON_EL_eval(%s, %s)\n" + (let* ((process (or process (python-shell-get-process-or-error msg))) + (code (format "__PYTHON_EL_eval(%s, %s)\n" (python-shell--encode-string string) - (python-shell--encode-string (or (buffer-file-name) - ""))))) + (python-shell--encode-string + (python-shell--file-name-to-send process))))) (unless python-shell-output-filter-in-progress (with-current-buffer (process-buffer process) (save-excursion @@ -5079,8 +5099,12 @@ python-pdbtrack-set-tracked-buffer "Set the buffer for FILE-NAME as the tracked buffer. Internally it uses the `python-pdbtrack-tracked-buffer' variable. Returns the tracked buffer." - (let* ((file-name-prospect (concat (file-remote-p default-directory) - file-name)) + (let* ((file-name-prospect + (if (file-remote-p file-name) + file-name + (if (string-prefix-p python-shell-local-prefix file-name) + (string-remove-prefix python-shell-local-prefix file-name) + (concat (file-remote-p default-directory) file-name)))) (file-buffer (get-file-buffer file-name-prospect))) (unless file-buffer (cond --Multipart_Thu_Jul_24_00:07:47_2025-1-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 23 12:02:33 2025 Received: (at 79036) by debbugs.gnu.org; 23 Jul 2025 16:02:33 +0000 Received: from localhost ([127.0.0.1]:51079 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uebvN-0001LP-0u for submit@debbugs.gnu.org; Wed, 23 Jul 2025 12:02:33 -0400 Received: from mout.gmx.net ([212.227.15.15]:45185) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uebvJ-0001Kx-AD for 79036@debbugs.gnu.org; Wed, 23 Jul 2025 12:02:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1753286534; x=1753891334; i=michael.albinus@gmx.de; bh=K6ZeDAe9hFBfOy7xJB3YhVnx/EcjHeipkVi+S261HI4=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=AhOdd+SSciEjOnO1kAChvQMC1hBY2aht/WiQkfZLrahK/vxdqt7rF+PZ4IagDFxo wV1w6GnJRhhCsOk4SbN/qpZ40rntTr+OVoQGKTItyao8RcACooA8CZ+bSCG3y9cuT yXaYJ5yf3HCfAk/FZDQV+ntVjQOKgivRnLm2a6i5Hth30kcM+ADqfv024NdSMwYTH gnL7HuPltGASXQr/vQ6AzO+WscKdvKGvJL0OCmkSjWEThRn1ay83M3cp4L11lRbyb 0SElUE7ukCpB19ZVfmWHIAdxOQC9GRsWYLz4HpcmSLUyV8MzGEMHJ5BDSuIf1QF0D YD3qdSFWoQ/GCdlS5Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from gandalf.gmx.de ([185.89.37.61]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MSKyI-1v7JxW1B9M-00MCRe; Wed, 23 Jul 2025 18:02:14 +0200 From: Michael Albinus To: kobarity Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames In-Reply-To: References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <86ikjpft4p.fsf@gnu.org> <86ecudfj9w.fsf@gnu.org> <861pq8bggd.fsf@gnu.org> Date: Wed, 23 Jul 2025 18:02:13 +0200 Message-ID: <87cy9qhp4q.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:fiqawosj/0o5GXMejlHOEmRnVcJVq3Rkv3D7Aum/VyZioTilcxq eC9qfr5ss1VBIVAUPYIVtsmEV9BMp+AFgN1j0j5KJ1WrmmB+zkGft7xvSpDzuNfNnoeD6m/ Ac1DRxm/jV6vWjydG5lQm53V4esKB7gDocbR3s51gG9V4HpzqocZYeynhYmPnRZBxL3QOpP jVa7ml1naVMAUpTbVa2/A== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:3NCeOpEZOJE=;zOIGzh4JxGQQdzA1aU7ZbT1kbvi f9dblu06cLuWAGa/I8w2NAwnZ13hdojiiKE7NzTuIucrY1L2LH7ssw0ttFFYmWr1gPX06Mt4Q ZsDWW1witMORlcT8XcNqrBLDDoUTzu7gOqv7LjeOJO/5VTfqYsR5xAZ2iSoicddPCY/CYyze+ W9sCTpUDbJ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vagsNf4vkaE92RZJwBrePHjWNBc0NmtxLa8Yh9fUmNQpnmR+f8 P7qMPiWldHp4bkxvprxCqh4UR9RTRTUOBuzgqouiiSNECxx6GC1rwy61MHdw/JGX3yAFGf0Jl pa61egFiZSBWCJscbxAx7y2apefwqFCyT9K5fgJ2PWfc3nC+0bE6W X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 79036 Cc: liuhui1610@gmail.com, Eli Zaretskii , 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) kobarity writes: > Hi, Hi, > Thus, TRAMP filenames such as "/ssh:remote1:/tmp/test.py" or > "/local:/tmp/test.py" is useless for PDB but helpful for PDB tracking. JFTR: "/local:/tmp/test.py" is NOT a Tramp file name. It uses just the prefix "/local:" for internal purposes. Best regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 23 20:46:16 2025 Received: (at 79036) by debbugs.gnu.org; 24 Jul 2025 00:46:16 +0000 Received: from localhost ([127.0.0.1]:52969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uek6B-0005fQ-Pn for submit@debbugs.gnu.org; Wed, 23 Jul 2025 20:46:16 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:60474) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uek68-0005ez-MQ for 79036@debbugs.gnu.org; Wed, 23 Jul 2025 20:46:13 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3a510432236so298016f8f.0 for <79036@debbugs.gnu.org>; Wed, 23 Jul 2025 17:46:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753317966; x=1753922766; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=krbK5ngIfWwlDpPqzQiLsQ+LmtzjxzEh1rDu9yq9Gxw=; b=ecmumAVTIafPVEWgVHZaTYpKGuA2t69bLqoS3ZjZ5y3zsvr1Zl1p97Yi5GUu+4iiSr sKZTF9MzW8Jmjyb3eF4OXnEU9SqHYmtXQPZtSnGF1RvIZzPBdDw0nSry72hQD6SXwJEc BR8F/VEyHAp3k6jjK2KT9DeHYVp8X5vijAbuf9GA1I8RplIb1MoGFP0wGeslrEkmJ2pX 0gdZjiVr6B7qeN7KwCgw2rEqh/r1ScTF/fRnldIOikXw/TBzVIqBRJPnhdjyf6p8RXmo 19OFRPhMoNokTcQarU0CZoCAG9ka8NN/FsmKJEY7tK3aK16uHyz/nty+59v1iXvSKQD7 tAdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753317966; x=1753922766; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=krbK5ngIfWwlDpPqzQiLsQ+LmtzjxzEh1rDu9yq9Gxw=; b=PSrL5imK6TiGwB5amacpkOjTHvpt/o0s6nfic3L90+D5BZbPgCuW+cxcgIEdVo4Dmf VFgc8wyiP0Hqfa2AI8J9RCkgKnTXelZZNPzIGWo3PIsMcU3LZYd7TcG7ItP2jUS0EHqa fUQZZDnOuy+U/uEtDNDtJRIafZRhzFNQWdHU+vwFw7hEaOyKw7jgAL8wwTyUOWeionLb 23aakev+kKudMPIZYp15Ojh+MThbHgW9H4NUrNsG4Qu8ERN55oc9MnYwu7kdWYK8IlFp GmkWYrR9Sn7smPlYSCrNlp8gt5bkVsaJw596HDpN0eYi25g4Qxk8Q6mgBFW9u/XZjwSB oKdA== X-Forwarded-Encrypted: i=1; AJvYcCUropwjv61HNXk0GBvNU9e9iu+WQhJWF/ePJAyCc2T76MDjiEop0ROmXDms/tkA1ZNCb2tTNA==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yzz32b6jp5dVZ6EilEZeFPU6sXDIDa/k4Y3Llu+F3aXeXKppO/t ZIoXTDrRgp2NRKFLsM0LUKAAYoqeVwF1tq9FlKew6WHhioh1qxuNx2ipIQ30WIuLhk8b+95gf5r 5LyJW6sH+cdp16qYuReBPPKSSmRgY1zI= X-Gm-Gg: ASbGncuMMo85eBhMPQTwBxlxuFVJFugWlynmqUO84neeqOaBmfvVXuAQg35Ry5DxGgE sWMGo/t9PwLjCXdaV7LMtwxn/YMFd5XonaGIGVusWalYEv4eVCvkPppsOdLxznRVAdzUdcn9ATo tXOr5yyTC2okmHryuD9dJDSrKOHCfvU4LnFHpd6Slyy7v5VZlhdtnMF5lftny6BlDcVg/B5Lxvd 8o+BbM= X-Google-Smtp-Source: AGHT+IF3YdNVpa4kz2oG82gVDilBo4tVT9/9H5T7jQjvlRNa59WKfgerTmC2vBHEean3ARM0iq6Sh9kZezW8904XGeA= X-Received: by 2002:a5d:5d85:0:b0:3b7:5cd3:fc44 with SMTP id ffacd0b85a97d-3b768ee04b1mr3465958f8f.4.1753317966227; Wed, 23 Jul 2025 17:46:06 -0700 (PDT) MIME-Version: 1.0 References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <86ikjpft4p.fsf@gnu.org> <86ecudfj9w.fsf@gnu.org> <861pq8bggd.fsf@gnu.org> <87tt35307m.fsf@gmx.de> In-Reply-To: From: Liu Hui Date: Thu, 24 Jul 2025 08:45:54 +0800 X-Gm-Features: Ac12FXxgKTGlxBpXO6svn-R4VLozGQ25GvvJ9dhBZf8yi1vkNSU0uO67ryhUeGw Message-ID: Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames To: kobarity Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org, Eli Zaretskii , michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Wed, Jul 23, 2025 at 11:08=E2=80=AFPM kobarity wrot= e: > > For non-file buffers, could it return buffer name instead of ? > > e.g. # or # where NAME may need to be quoted. Then > > python-pdbtrack-set-tracked-buffer can find it by (get-buffer-create > > "NAME"). > > That might be a good idea. Why is `get-buffer-create' is necessary > rather than `get-buffer'? Thanks for pointing it out. get-buffer should be used here. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 02 10:01:48 2025 Received: (at 79036) by debbugs.gnu.org; 2 Aug 2025 14:01:48 +0000 Received: from localhost ([127.0.0.1]:36742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uiCo0-0002Tr-0R for submit@debbugs.gnu.org; Sat, 02 Aug 2025 10:01:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56352) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uiCny-0002TT-IE for 79036@debbugs.gnu.org; Sat, 02 Aug 2025 10:01:47 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uiCnt-0006OA-2f; Sat, 02 Aug 2025 10:01:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=O4KoQaFOxmjD2E7NlqNFJeKB3OZa7ithbwEoyspNpPM=; b=mpsBfFo70XCksJP+dv8Z 0L+yWQwUsRds6eC3VU5OY+PfoqOLpAaE5EORT5+DXPGH4xWnF1ntIchfWaPgefUiw/GGmqgawDu/s steST6MxwWywHBcP+sZnZNxyDmveeEZceF91A1AYUzyuJwK57jnpQ51JPIEFIMn2kk7twBQrJ/4jd Yqh2KMskUOiycmEXWdX1sVsandvtUwmieXU2qwXmt+ZvB0+b53VqOtgkXDcKFwbAHmNr2DCJphrAt MqXoT9QDZm1OMkmzUOXS/mZhadab9GkgOU1GxDWQQmZHeHAu1u6rLU1zI2PEsJXzzknokVKNu+ShU 2Z8o0gVp6aB70g==; Date: Sat, 02 Aug 2025 17:01:37 +0300 Message-Id: <86qzxtrfem.fsf@gnu.org> From: Eli Zaretskii To: Liu Hui In-Reply-To: (message from Liu Hui on Thu, 24 Jul 2025 08:45:54 +0800) Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <86ikjpft4p.fsf@gnu.org> <86ecudfj9w.fsf@gnu.org> <861pq8bggd.fsf@gnu.org> <87tt35307m.fsf@gmx.de> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org, kobarity@gmail.com, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Liu Hui > Date: Thu, 24 Jul 2025 08:45:54 +0800 > Cc: Eli Zaretskii , michael.albinus@gmx.de, 79036@debbugs.gnu.org > > On Wed, Jul 23, 2025 at 11:08 PM kobarity wrote: > > > > For non-file buffers, could it return buffer name instead of ? > > > e.g. # or # where NAME may need to be quoted. Then > > > python-pdbtrack-set-tracked-buffer can find it by (get-buffer-create > > > "NAME"). > > > > That might be a good idea. Why is `get-buffer-create' is necessary > > rather than `get-buffer'? > > Thanks for pointing it out. get-buffer should be used here. So can we please have an updated patch for this? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 03 07:47:23 2025 Received: (at 79036) by debbugs.gnu.org; 3 Aug 2025 11:47:23 +0000 Received: from localhost ([127.0.0.1]:42965 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uiXBT-00073q-Be for submit@debbugs.gnu.org; Sun, 03 Aug 2025 07:47:23 -0400 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]:45318) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uiXBP-00073P-QT for 79036@debbugs.gnu.org; Sun, 03 Aug 2025 07:47:21 -0400 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-7426c44e014so3206266b3a.3 for <79036@debbugs.gnu.org>; Sun, 03 Aug 2025 04:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754221634; x=1754826434; darn=debbugs.gnu.org; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=jsZ4QGgyexCdqCoRu3llYSBaorJlN54E2JuJ9AeKQJ8=; b=AjlBhBypkdqaOvgfpKUU7Pbxl95FBEC/VDybsZaHNm/lO8x5vG8KSa2nZO2HBu2BvM mhzP/IzENh4TFb8UXOcTqjfZq1xtNmgv2R+B+RjbMDEtkW08Lc1yXVNsFpMqmljKSHIY o9Psnr2qN8eECMD8xSb5tLvcEXl3+6dP1zalIhFPfvd1GsYB9HSET073y6llYXzTL90a 0sKDQEs4QJ+MQVNuiZWRJ+vBi6JCHq8aT7ZneGXbHILiKfQyyWSuPiBsxrNXkaOzEPi9 0Xaajs4N8IDKTO2WLFoBvN7iRwMQxlS13xDNuNuS8EEwRu0tYoXaD+utj5I4jJloSIq2 0Nqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754221634; x=1754826434; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jsZ4QGgyexCdqCoRu3llYSBaorJlN54E2JuJ9AeKQJ8=; b=mk36L5JeKa8qwJ+P3NFL+mFL9UxfFFjuOlQMX78NU3xNz+l8/UqVifZWw+K66paTgJ KU/pCAWc3SX75Uc5cq0ijx1ObjBG4hasLYpwkk+Llf58sWHwtRTBevIqI63kX/4UdBZ5 +ee6yPJLqZDfcMkOFZjxJqSpjri2bEQJmll2kS5NA7OlQTv9kvzSmj4FgceVlUxP1Nis vH9V38b0Pjp70RGwksL1HIqzfWZZkLaixNW8PNuqtoK5ofNhCdqjnc3R8XNJ9EMEo6hM 5V8QrcIKSkM70FSVam1XsO9zUypUa5592DxCCItiyDBfcRPzVr+go8KR2X4brjM4CISa 27+w== X-Gm-Message-State: AOJu0YyaOjbH+wDC3VGbovTsybX9ZRyDWzZy6YHvQSWgh2UNaRPwqDy1 2TM/OrfOWQFflQ18/LRKZP10aOPWeRUvZpIePbbAtSWc+eUxUbnDe7VN X-Gm-Gg: ASbGncuU+qwT9Jgr2wOwJ3JHtnfsPaml8AArW9OFwGzs+W0x85/Z3BGda0Zw9xvHDhJ LA1fQkMUw3dKfy3u0gT8yPMIltk/pq9udi48I6ZE7WjNzAQVLimRWsinMfQnuV3TsBE/9Ko8tCm yGOleyzy9Puc++c09vQi01i0/pkpANfiCBxDZ9MbShHlT++L3OnCcHRlmeNIfFiIA6T1b5YqS83 npvqFJm71qB85ldv3Uz+Ie4cxH1Kfzblj1vsOrDTg02k4cpPJdLJrkj3R+yWt5nu8gD7SIMT1iu 9MFX1A0T2lizO9HMlkgFhPwX4Xs91NImKbR9xjnT5X/mvBy5HB4t/zuuo4t/KdjY2fFoh6k06Me PhnzIw8mHQLEfn1lZavayyZTWG6yBhvRflIDXs0Rd9kyJpeUG7bPB X-Google-Smtp-Source: AGHT+IFK2KhLGRLEFMQNkhqazW5AtEfBPQ48/SxCLis0Xe2CtiMC5JSUVUoZt5YyJyMk7JVhFgHpRw== X-Received: by 2002:a05:6a00:84ca:b0:76b:ef44:1fa6 with SMTP id d2e1a72fcca58-76bef443244mr4340310b3a.4.1754221633603; Sun, 03 Aug 2025 04:47:13 -0700 (PDT) Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-76bfcb26905sm1347645b3a.123.2025.08.03.04.47.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Aug 2025 04:47:12 -0700 (PDT) Date: Sun, 03 Aug 2025 20:47:05 +0900 Message-ID: From: kobarity To: Eli Zaretskii , Liu Hui , michael.albinus@gmx.de Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames In-Reply-To: <86qzxtrfem.fsf@gnu.org> <87cy9qhp4q.fsf@gmx.de> References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <86ikjpft4p.fsf@gnu.org> <86ecudfj9w.fsf@gnu.org> <861pq8bggd.fsf@gnu.org> <87tt35307m.fsf@gmx.de> <86qzxtrfem.fsf@gnu.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/31.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: multipart/mixed; boundary="Multipart_Sun_Aug__3_20:47:05_2025-1" X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Multipart_Sun_Aug__3_20:47:05_2025-1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Michael Albinus wrote: > kobarity writes: > > Thus, TRAMP filenames such as "/ssh:remote1:/tmp/test.py" or > > "/local:/tmp/test.py" is useless for PDB but helpful for PDB tracking. >=20 > JFTR: "/local:/tmp/test.py" is NOT a Tramp file name. It uses just the > prefix "/local:" for internal purposes. Understood. I revised the patch to perform checking and removing the prefix "/local:" first. Eli Zaretskii wrote: >=20 > > From: Liu Hui > > Date: Thu, 24 Jul 2025 08:45:54 +0800 > > Cc: Eli Zaretskii , michael.albinus@gmx.de, 79036@debbugs= .gnu.org > >=20 > > On Wed, Jul 23, 2025 at 11:08=E2=80=AFPM kobarity = wrote: > >=20 > > > > For non-file buffers, could it return buffer name instead of ? > > > > e.g. # or # where NAME may need to be quoted. Th= en > > > > python-pdbtrack-set-tracked-buffer can find it by (get-buffer-create > > > > "NAME"). > > > > > > That might be a good idea. Why is `get-buffer-create' is necessary > > > rather than `get-buffer'? > >=20 > > Thanks for pointing it out. get-buffer should be used here. >=20 > So can we please have an updated patch for this? Since it is an improvement to add a new feature and not a fix for #79036, I think it would be better to separate the patches. Attached is my proposed patch to fix #79036. --Multipart_Sun_Aug__3_20:47:05_2025-1 Content-Type: application/octet-stream; type=patch; name="0001-Fix-Python-PDB-tracking-for-remote-inferior-Python.patch" Content-Disposition: attachment; filename="0001-Fix-Python-PDB-tracking-for-remote-inferior-Python.patch" Content-Transfer-Encoding: 7bit >From 99cd483cf0535dc0d265a1060e0bb1dfca94d801 Mon Sep 17 00:00:00 2001 From: kobarity Date: Sun, 3 Aug 2025 20:19:37 +0900 Subject: [PATCH] Fix Python PDB tracking for remote inferior Python * lisp/progmodes/python.el (python-shell-local-prefix): New constant. (python-shell--file-name-to-send): New function to add/remove prefix. (python-shell-send-string): Changed to use 'python-shell--file-name-to-send'. (python-pdbtrack-set-tracked-buffer): Changed to add/remove prefix. * test/lisp/progmodes/python-tests.el (python-shell--file-name-to-send-1): New test. (Bug#79036) --- lisp/progmodes/python.el | 46 ++++++++++++++++++++++++----- test/lisp/progmodes/python-tests.el | 24 +++++++++++++++ 2 files changed, 63 insertions(+), 7 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 8b5ffae57d6..cc3348e15cf 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3698,6 +3698,10 @@ python-shell-eval-file-setup-code "Code used to evaluate files in inferior Python processes. The coding cookie regexp is specified in PEP 263.") +(defconst python-shell-local-prefix "/local:" + "A prefix used to indicate that a file is local. +It is used when sending file names to remote Python processes.") + (defun python-shell-comint-watch-for-first-prompt-output-filter (output) "Run `python-shell-first-prompt-hook' when first prompt is found in OUTPUT." (when (not python-shell--first-prompt-received) @@ -4016,6 +4020,30 @@ 'python-shell--encode-string (signal 'wrong-type-argument (list 'stringp text))))) "Encode TEXT as a valid Python string.") +(defun python-shell--file-name-to-send (process) + "Return the file name to be sent to the inferior Python PROCESS. +First, call the function `buffer-file-name' to get the file name. If +the file name is nil, return \"\". If PROCESS is remote and the +file is local, add `python-shell-local-prefix' to the file name. If +PROCESS is remote and the file is on the same remote host, remove the +remote prefix from the file name. Otherwise, return the file name as +is." + (let ((file-name (buffer-file-name)) + (process-prefix + (file-remote-p + (with-current-buffer (process-buffer process) default-directory)))) + (if file-name + (if process-prefix + (let ((remote-p (file-remote-p file-name)) + (local-name (file-local-name file-name))) + (if remote-p + (if (string= remote-p process-prefix) + local-name + file-name) + (concat python-shell-local-prefix local-name))) + file-name) + ""))) + (defun python-shell-send-string (string &optional process msg) "Send STRING to inferior Python PROCESS. When optional argument MSG is non-nil, forces display of a @@ -4023,11 +4051,11 @@ python-shell-send-string t when called interactively." (interactive (list (read-string "Python command: ") nil t)) - (let ((process (or process (python-shell-get-process-or-error msg))) - (code (format "__PYTHON_EL_eval(%s, %s)\n" - (python-shell--encode-string string) - (python-shell--encode-string (or (buffer-file-name) - ""))))) + (let* ((process (or process (python-shell-get-process-or-error msg))) + (code (format "__PYTHON_EL_eval(%s, %s)\n" + (python-shell--encode-string string) + (python-shell--encode-string + (python-shell--file-name-to-send process))))) (unless python-shell-output-filter-in-progress (with-current-buffer (process-buffer process) (save-excursion @@ -5082,8 +5110,12 @@ python-pdbtrack-set-tracked-buffer "Set the buffer for FILE-NAME as the tracked buffer. Internally it uses the `python-pdbtrack-tracked-buffer' variable. Returns the tracked buffer." - (let* ((file-name-prospect (concat (file-remote-p default-directory) - file-name)) + (let* ((file-name-prospect + (if (string-prefix-p python-shell-local-prefix file-name) + (string-remove-prefix python-shell-local-prefix file-name) + (if (file-remote-p file-name) + file-name + (concat (file-remote-p default-directory) file-name)))) (file-buffer (get-file-buffer file-name-prospect))) (unless file-buffer (cond diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index d65ef39abb4..7475ddb007e 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -4602,6 +4602,30 @@ python-shell-prompt-set-calculated-regexps-6 "^\\(o\\.t \\|\\)"))) (ignore-errors (delete-file startup-file)))))) +(ert-deftest python-shell--file-name-to-send-1 () + "Test the return value of `python-shell--file-name-to-send'. +The test parameters consist of a list of the following three elements. +1. The variable `default-directory' of the process. +2. The return value of the function `buffer-file-name'. +3. The expected return value of `python-shell--file-name-to-send'." + (python-tests-with-temp-buffer-with-shell + "" + (let ((process (python-shell-get-process))) + (dolist + (test `(("/tmp" nil "") + ("/tmp" "/tmp/tmp.py" "/tmp/tmp.py") + ("/ssh:remote1:/tmp" "/tmp/tmp.py" + ,(concat python-shell-local-prefix "/tmp/tmp.py")) + ("/ssh:remote1:/tmp" "/ssh:remote1:/tmp/tmp.py" "/tmp/tmp.py") + ("/ssh:remote1:/tmp" "/ssh:remote2:/tmp/tmp.py" + "/ssh:remote2:/tmp/tmp.py"))) + (with-current-buffer (process-buffer process) + (setq default-directory (nth 0 test))) + (cl-letf (((symbol-function 'buffer-file-name) + (lambda () (nth 1 test)))) + (should (string= (python-shell--file-name-to-send process) + (nth 2 test)))))))) + (ert-deftest python-shell-buffer-substring-1 () "Selecting a substring of the whole buffer must match its contents." (python-tests-with-temp-buffer -- 2.43.0 --Multipart_Sun_Aug__3_20:47:05_2025-1-- From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 04 07:52:18 2025 Received: (at 79036) by debbugs.gnu.org; 4 Aug 2025 11:52:18 +0000 Received: from localhost ([127.0.0.1]:49521 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uitjl-0000Br-R0 for submit@debbugs.gnu.org; Mon, 04 Aug 2025 07:52:18 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:44501) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uitjh-0000BU-2L for 79036@debbugs.gnu.org; Mon, 04 Aug 2025 07:52:15 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3b7892609a5so2833932f8f.1 for <79036@debbugs.gnu.org>; Mon, 04 Aug 2025 04:52:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754308327; x=1754913127; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=UA8v+UPr48oScRvLJkG2DAD10PTeMeM+ZkIqs65oCKM=; b=MawXl8mrVhh8h/BmQt+iyD22diUP12knJriY/RAHGOV71g3yFJvtYnKMKCMa/UxK8m sUM6sj0QnLr3vf78wFgYbSmJQ/wh7v5l0+BI0yD2Es9jPbG6gdgwmqlyPURIRnYuCV82 TmuLcudj4cgWGDrenAyswcqEA2Bs1q3oks+x0WCEECfL4e0m33HtmGGDeecqAX/f994m WO6cU18M0YLrnSz4W5fJ3FOt34IzURKAA6C4c0GZA9sHtwboCtVxL/Zl+nFrlksImV9h 2Mri7KoYjHmaZUoAhSHekbKHSiP9g/piIymB7hA/u0T45KUPvi77qdYEEj+cjAiSf+YH 3aqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754308327; x=1754913127; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UA8v+UPr48oScRvLJkG2DAD10PTeMeM+ZkIqs65oCKM=; b=jC/WhoWkH4vPYfaKPPXw945+2LgkdPJr+VJnD6K72ByocdYr4qNOZXn8QHNPRNqMob GzgNn7A0oJaNo8hLae4O8oT+jbQ3+JaTOcy6b9U/UfHktlHlEnmJFfoEGDLCDLezgJYy AM62J5PdhBzce3iKCWTurhOTAe4lpghSkI18zl5tubNqzTW/rJid6EaQwgYIxE1ISx/Y nHEsMiGmVNtApRR7dsKn5HEaAHMJmntb0XjrP0NJnHANnLTsghAHkWypiL3+NDbCWv9J ghRLlDOnOqSlM7n6bPONVuUn8hgEdk5krEf41bpLsT3UWcXmVeW1GhLgodV2Wj10k/r0 YC3Q== X-Forwarded-Encrypted: i=1; AJvYcCU4hVJqEj0UfhtC49FHbchHoz2vFRo6puvE6JBSRzRRDe25dw88YxMFOvT49pPGMP6wpRLy7g==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyeNFqXGt2Ku7PZJT9w2jdbIS+UJsbAJ/dP1qLRucmzFRJaQP3I P0mKdoRQmeja5XF9eOvibWKQrZUChdrx6rNRkJnJRE7gxhI8G4Cp6M9R76Qe448VJ1W4qRidvtX AUswu+qf4weXmvykAiwGGJpkTzgtXKAg= X-Gm-Gg: ASbGnctepvyBid+GZn6jip0Hz+0pWzPdBK5tMHMmSKrnXgjOHHuNj8lVlEZtmmz7xDv MyPCMdBupuqie0lxfVSsJzaeZqMVAHR3Fg1XAKdxsXgXQ0MW5OYL4E5hcIbW/4IfG70KAjQTJZK 7/VfH0hrsIO/u9a5RKb0ySH55XmzOEkyROobXiEK64/3F392WZTmyjUDdrkAU2rg5xlba4aE24f okoV6E27wBHLAvmLTY= X-Google-Smtp-Source: AGHT+IG8rcdUtqCG9RJCVC5OqvBGHRPzii7k1dUTRSf/zuAFvwJ3kgAPSxo2MEXTeWFbkfqEw0iztvyDsjWjFna/2eE= X-Received: by 2002:a05:6000:40cb:b0:3b7:8f49:94f7 with SMTP id ffacd0b85a97d-3b8d94c137dmr6938978f8f.31.1754308326532; Mon, 04 Aug 2025 04:52:06 -0700 (PDT) MIME-Version: 1.0 References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <86ikjpft4p.fsf@gnu.org> <86ecudfj9w.fsf@gnu.org> <861pq8bggd.fsf@gnu.org> <87tt35307m.fsf@gmx.de> <86qzxtrfem.fsf@gnu.org> <87cy9qhp4q.fsf@gmx.de> In-Reply-To: From: Liu Hui Date: Mon, 4 Aug 2025 19:51:54 +0800 X-Gm-Features: Ac12FXwEBGTe4mCZV0Z8EYlJYYQfh3ZdVWnlWziFZRpyaCNyHMpy3XhGG1KSdFI Message-ID: Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames To: kobarity Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Sun, Aug 3, 2025 at 7:47 PM kobarity wrote: > Eli Zaretskii wrote: > > > > > From: Liu Hui > > > Date: Thu, 24 Jul 2025 08:45:54 +0800 > > > Cc: Eli Zaretskii , michael.albinus@gmx.de, 79036@debbugs.gnu.org > > > > > > On Wed, Jul 23, 2025 a [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (liuhui1610[at]gmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (liuhui1610[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:42a listed in] [list.dnswl.org] 1.0 FREEMAIL_REPLY From and body contain different freemails X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org, Eli Zaretskii , michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Sun, Aug 3, 2025 at 7:47=E2=80=AFPM kobarity wrote: > Eli Zaretskii wrote: > > > > > From: Liu Hui > > > Date: Thu, 24 Jul 2025 08:45:54 +0800 > > > Cc: Eli Zaretskii , michael.albinus@gmx.de, 79036@debbu= gs.gnu.org > > > > > > On Wed, Jul 23, 2025 at 11:08=E2=80=AFPM kobarity wrote: > > > > > > > > For non-file buffers, could it return buffer name instead of ? > > > > > e.g. # or # where NAME may need to be quoted. = Then > > > > > python-pdbtrack-set-tracked-buffer can find it by (get-buffer-cre= ate > > > > > "NAME"). > > > > > > > > That might be a good idea. Why is `get-buffer-create' is necessary > > > > rather than `get-buffer'? > > > > > > Thanks for pointing it out. get-buffer should be used here. > > > > So can we please have an updated patch for this? > > Since it is an improvement to add a new feature and not a fix for > #79036, I think it would be better to separate the patches. > > Attached is my proposed patch to fix #79036. Hi, I find python-shell-send-file has the same issue as python-shell-send-string, and needs to use correct file-name too. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 04 10:56:44 2025 Received: (at 79036) by debbugs.gnu.org; 4 Aug 2025 14:56:44 +0000 Received: from localhost ([127.0.0.1]:52347 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uiwcG-000299-DI for submit@debbugs.gnu.org; Mon, 04 Aug 2025 10:56:44 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:54696) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uiwcA-00028k-ND for 79036@debbugs.gnu.org; Mon, 04 Aug 2025 10:56:42 -0400 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-31f4e49dca0so3973688a91.1 for <79036@debbugs.gnu.org>; Mon, 04 Aug 2025 07:56:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754319392; x=1754924192; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date:from:to:cc:subject :date:message-id:reply-to; bh=xfZAK75iiR1HQIOMEnATy2soMLIYj73WIY+99p0yj/o=; b=g73CUkDy3Kq3Pf6A9onNssXEnvdFomr7hQdLxiJao5+Rv+l8ltfN/94yKsejJf1uKK Kjjz0T5CFy1ESdfm6vNKhA3BmO5Zv3IkvR/dTRQtpuFVhdM8Mo4ekEKzP4F5m1dkqLpb m8XoojFJruQ0QzlxfGBTRtHVvnCFVL6iTdyMdcro7i194ue5TaPG/zk6DVrD0x2M2m9L tkJ2AXYHkEkxbp1j4a5PAqjf74ASaNjg2s5qP+38W5vNcepHLlZ3FCOMmfSuaT8PFx94 EEhmzUU9xzTLtytEQig/oPbWKIbvvL9BCi5+uDXBdLFVo+HOsAixHyjWSIwvVoKgpD4D v5JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754319392; x=1754924192; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=xfZAK75iiR1HQIOMEnATy2soMLIYj73WIY+99p0yj/o=; b=aYjh/a3qm54b0G+CeP1mWDJYQZdWINkgb5TI/nshT+66l9Ee95jjKlIreO5/Xgf/HX 1hTAoR2cVWxTkVOSyWGp5l7rlrEQqv/LuZoyrSBD6kosm3OzN5fQ9dKxeVlMYjPcX35M 0WJfHQyCQoMSzORrmqzWQr7hSEMCs8cqmt02ysW+6yvoJphl6Y0S6GeKZ+GOCvI/DIMl hZcBhMJByANRSGt1Bz/QWr6ezyuMIHr9Kr0df1KaBz5l5MWLzH/6jJzrAHp7HY7YcWk+ 24Ts1hq+dxe0Q71kxqQtj364VwCAg/fKBiKWZUDz6Ze/HbVaSPO6SO074Or6OHEq2tfI lmjA== X-Forwarded-Encrypted: i=1; AJvYcCVlOvfPl6ADt95WQ7Kyodv169RtRpYVKUJoyp15DnxaMMyn+lPd/8gcrVp0zR6L4ySAThxHig==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yz5kXhW6FppOuIV2kAT3L76DcLJ4tZUaFG7mscjKZuj+ZMsoV1s X8wXiLMzxiiH1h5+FJs0CmrO2J7hEJDFxM9GHwyJ3QPBdHRez0Fd1fqq X-Gm-Gg: ASbGncvzqkWHlxLFYWneNEpGCKSZKy3NswOeEip0ca9z3PatJ+cdm0qQDIquxGyw7P9 CpWd/+gUndjr28teoaOwbLKS5pEpMsKaVCHGn/fKrNvDDWfsGA5PdzJtP1qHm/CzL93EtEcn1GX PxOklzYTQwxQN56rEdrwLpG4UhZIYhh3WxPmSlAph5JgtAgx/unF4Y2xvqcpMKhqweB//m2/r/7 5oA2SKpJmZW7EawbFNnYmLylTIKfeHlSu1IjVSx6L+t0+iKEvAaeNbYfGEyHt3I/jYMdM1E3yI+ l2koDasO4wSoJbsFgXONFFe+rQDKGXy5QnMSciCyyEC/u0S/it5UROLq2Uphfl9PR8qBoGw+GCq b+cOSx59QOwh2c2iiGIXEej+eJD9lhyhv2Gz6rjyB31ERuq9ersUmZWIfcRibTCE= X-Google-Smtp-Source: AGHT+IHJzFaTLoJFEG9Pawq2ymbOkCRYDQGZTvPAxSurzIE4aC9NTbhGE7s9kTq8lW1cWfxSg0pRtQ== X-Received: by 2002:a17:90b:384c:b0:31f:ad:aa1b with SMTP id 98e67ed59e1d1-321161d6ddcmr12451677a91.3.1754319392335; Mon, 04 Aug 2025 07:56:32 -0700 (PDT) Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3207edb5884sm11833133a91.28.2025.08.04.07.56.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Aug 2025 07:56:31 -0700 (PDT) Date: Mon, 04 Aug 2025 23:56:23 +0900 Message-ID: From: kobarity To: Liu Hui Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames In-Reply-To: References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <86ikjpft4p.fsf@gnu.org> <86ecudfj9w.fsf@gnu.org> <861pq8bggd.fsf@gnu.org> <87tt35307m.fsf@gmx.de> <86qzxtrfem.fsf@gnu.org> <87cy9qhp4q.fsf@gmx.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/31.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org, Eli Zaretskii , michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Liu Hui wrote: >=20 > On Sun, Aug 3, 2025 at 7:47=E2=80=AFPM kobarity wrot= e: >=20 > > Eli Zaretskii wrote: > > > > > > > From: Liu Hui > > > > Date: Thu, 24 Jul 2025 08:45:54 +0800 > > > > Cc: Eli Zaretskii , michael.albinus@gmx.de, 79036@deb= bugs.gnu.org > > > > > > > > On Wed, Jul 23, 2025 at 11:08=E2=80=AFPM kobarity wrote: > > > > > > > > > > For non-file buffers, could it return buffer name instead of ? > > > > > > e.g. # or # where NAME may need to be quoted= . Then > > > > > > python-pdbtrack-set-tracked-buffer can find it by (get-buffer-c= reate > > > > > > "NAME"). > > > > > > > > > > That might be a good idea. Why is `get-buffer-create' is necessa= ry > > > > > rather than `get-buffer'? > > > > > > > > Thanks for pointing it out. get-buffer should be used here. > > > > > > So can we please have an updated patch for this? > > > > Since it is an improvement to add a new feature and not a fix for > > #79036, I think it would be better to separate the patches. > > > > Attached is my proposed patch to fix #79036. >=20 > Hi, >=20 > I find python-shell-send-file has the same issue as > python-shell-send-string, and > needs to use correct file-name too. Thanks, I will update the patch. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 06 10:15:08 2025 Received: (at 79036) by debbugs.gnu.org; 6 Aug 2025 14:15:08 +0000 Received: from localhost ([127.0.0.1]:59579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ujev5-0001Q9-RE for submit@debbugs.gnu.org; Wed, 06 Aug 2025 10:15:08 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:43268) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ujeuw-0001P6-8T for 79036@debbugs.gnu.org; Wed, 06 Aug 2025 10:15:00 -0400 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-76aea119891so1044521b3a.1 for <79036@debbugs.gnu.org>; Wed, 06 Aug 2025 07:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754489691; x=1755094491; darn=debbugs.gnu.org; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=tiabbe/IeDEqqZ9fZ0Ipte/b2kK4nf9jdPhy1yMs12c=; b=hoX5kdS2wFsm3ipMi67Rb2JNIN+HXEUhWCW12QuP2S4POoE1Xnoxl6PYGnwdBW2f5c MikgLzuUFLw4Ux4tmoLZq8GBqcwXAUF6jbqJWHnVKcmT9FDYgSFSHvpMTFgQD6UIP5RP YeB38cLugMLwZnuwX+T3P2NVDi/IjG1ImvIxbCHfCqXARQyj8+Pw5rzwJzVJv9WbpI+7 PV3POL8tyZSrO2yiAjthL8liQys+Au5i+ZGjRQaXYcRv/XfLTVOeDxm0zj6K+N6em9ca PT4w8qqWMODpiQHaZcmcU1VmiuPgzZBtOde9bUjviRHx+SQrghrp00vgStwrl591UVBS NuXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754489691; x=1755094491; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=tiabbe/IeDEqqZ9fZ0Ipte/b2kK4nf9jdPhy1yMs12c=; b=igcAj75KtcYdXCdkxkxUvXvE5Evo+Ab0bc3PGlN8Iv+OENwfqN2WgPqmZTFrTklmCZ i2DxK1wK8U9bNpsWeN5EpmxbAwII/2WBgn3/eK2fnttdBNvWYK0GMEbP6FXLcfrC+VAe IIgMu903fGNHLKrfCavf5B7su0moGChz+tV61gspPcpBzMKSvDIT6aPhIY3r+20xoS7S LWbONLwbGvuAxg4+iqeE/8gQAKEHmGxkFs5dRrpH/PQAwl2WRgIRwPyhC8UUbfFzH7HC VpMfh5b064k8exepn1d3nnYPZmDJ+nH7s2qrT2VNnNohTxZaLfdpsiLiNwb8TnBufY1z svnw== X-Gm-Message-State: AOJu0Yy0aK7x5OqlJR4pXLbAoRekDsKLjxN7UnZq/95cmcP0h2jr/33Q WjpScsIfTXHjz9o8ogBgK0UyuqcaGdxfuFl17h3+V7q6fakwPHuZKOrx X-Gm-Gg: ASbGncvxYtmgaRrN3GLuIh1dY5ku+d6w452awBcN+vv69DQydF9IfjT0cAHetnos+Va ox/F5CbB+rJmAfztouzkNiPe4vK2KTDAJ96f+YX7syWZhFeShycHEhfe5rND+Lau6rjnM8DORE1 TtpSD7f+fSnwYNRphA6pFOSmVO8LrQeB9BOESvrBS2NbISjR4kQHrvjdsyEzV8tYRNVqa3eyjGM TQp3+FaFp3hOgnYjQW7JB5fu/VWxRr9oD7E5pno0X5Sdu8J/WEpEMZFtXW9zEcZjnUv0LfPc8CI MCcmj4g4Mlu0Iam+jKaFxLjvupa+nS9S5YZzaS9acuJ3kunVsOO7GYQyIuqVWdN33r0MQt6HybB SlusiD6fZQZFPs8UJfPa4BcfZdtvY/Gg6jhonWM7/bWNtD0qyqH4d X-Google-Smtp-Source: AGHT+IG/KUdMLoIxs3S7mewC3JPGLO5o9xUCYbGK92prICkkBw6XVTUjai59D3B1TTN3aHktDz9GJg== X-Received: by 2002:a05:6a20:7f99:b0:240:17b3:3838 with SMTP id adf61e73a8af0-24031b01b5bmr4517974637.20.1754489691197; Wed, 06 Aug 2025 07:14:51 -0700 (PDT) Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-76bccfe9003sm15583491b3a.125.2025.08.06.07.14.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Aug 2025 07:14:50 -0700 (PDT) Date: Wed, 06 Aug 2025 23:14:47 +0900 Message-ID: From: kobarity To: Liu Hui , Eli Zaretskii , michael.albinus@gmx.de Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames In-Reply-To: References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <86ikjpft4p.fsf@gnu.org> <86ecudfj9w.fsf@gnu.org> <861pq8bggd.fsf@gnu.org> <87tt35307m.fsf@gmx.de> <86qzxtrfem.fsf@gnu.org> <87cy9qhp4q.fsf@gmx.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/31.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: multipart/mixed; boundary="Multipart_Wed_Aug__6_23:14:46_2025-1" X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Multipart_Wed_Aug__6_23:14:46_2025-1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable kobarity wrote: >=20 > Liu Hui wrote: > >=20 > > On Sun, Aug 3, 2025 at 7:47=E2=80=AFPM kobarity wr= ote: > >=20 > > > Eli Zaretskii wrote: > > > > > > > > > From: Liu Hui > > > > > Date: Thu, 24 Jul 2025 08:45:54 +0800 > > > > > Cc: Eli Zaretskii , michael.albinus@gmx.de, 79036@d= ebbugs.gnu.org > > > > > > > > > > On Wed, Jul 23, 2025 at 11:08=E2=80=AFPM kobarity wrote: > > > > > > > > > > > > For non-file buffers, could it return buffer name instead of = ? > > > > > > > e.g. # or # where NAME may need to be quot= ed. Then > > > > > > > python-pdbtrack-set-tracked-buffer can find it by (get-buffer= -create > > > > > > > "NAME"). > > > > > > > > > > > > That might be a good idea. Why is `get-buffer-create' is neces= sary > > > > > > rather than `get-buffer'? > > > > > > > > > > Thanks for pointing it out. get-buffer should be used here. > > > > > > > > So can we please have an updated patch for this? > > > > > > Since it is an improvement to add a new feature and not a fix for > > > #79036, I think it would be better to separate the patches. > > > > > > Attached is my proposed patch to fix #79036. > >=20 > > Hi, > >=20 > > I find python-shell-send-file has the same issue as > > python-shell-send-string, and > > needs to use correct file-name too. >=20 > Thanks, I will update the patch. Attached is the revised patch to fix #79036. --Multipart_Wed_Aug__6_23:14:46_2025-1 Content-Type: application/octet-stream; type=patch; name="0001-Fix-Python-PDB-tracking-for-remote-inferior-Python.patch" Content-Disposition: attachment; filename="0001-Fix-Python-PDB-tracking-for-remote-inferior-Python.patch" Content-Transfer-Encoding: 7bit >From 0c60b87cf9cfc6994219c08eae189f78c4e0d6ff Mon Sep 17 00:00:00 2001 From: kobarity Date: Wed, 6 Aug 2025 23:08:49 +0900 Subject: [PATCH] Fix Python PDB tracking for remote inferior Python * lisp/progmodes/python.el (python-shell-local-prefix): New constant. (python-shell--convert-file-name-to-send): New function to add/remove prefix. (python-shell-send-string, python-shell-send-file): Changed to use 'python-shell--convert-file-name-to-send'. (python-pdbtrack-set-tracked-buffer): Changed to add/remove prefix. * test/lisp/progmodes/python-tests.el (python-shell--convert-file-name-to-send-1): New test. (Bug#79036) --- lisp/progmodes/python.el | 48 ++++++++++++++++++++++++----- test/lisp/progmodes/python-tests.el | 26 ++++++++++++++++ 2 files changed, 66 insertions(+), 8 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 8b5ffae57d6..3cd20d6babf 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3698,6 +3698,10 @@ python-shell-eval-file-setup-code "Code used to evaluate files in inferior Python processes. The coding cookie regexp is specified in PEP 263.") +(defconst python-shell-local-prefix "/local:" + "A prefix used to indicate that a file is local. +It is used when sending file names to remote Python processes.") + (defun python-shell-comint-watch-for-first-prompt-output-filter (output) "Run `python-shell-first-prompt-hook' when first prompt is found in OUTPUT." (when (not python-shell--first-prompt-received) @@ -4016,6 +4020,27 @@ 'python-shell--encode-string (signal 'wrong-type-argument (list 'stringp text))))) "Encode TEXT as a valid Python string.") +(defun python-shell--convert-file-name-to-send (process file-name) + "Convert the FILE-NAME for sending to the inferior Python PROCESS. +If PROCESS is local and FILE-NAME is prefixed with +`python-shell-local-prefix', remove the prefix. If PROCESS is remote +and the FILE-NAME is not prefixed, prepend `python-shell-local-prefix'. +If PROCESS is remote and the file is on the same remote host, remove the +remote prefix. Otherwise, return the file name as is." + (when file-name + (let ((process-prefix + (file-remote-p + (with-current-buffer (process-buffer process) default-directory))) + (local-prefix (string-prefix-p python-shell-local-prefix file-name))) + (cond + ((and (not process-prefix) local-prefix) + (string-remove-prefix python-shell-local-prefix file-name)) + ((and process-prefix (not (or local-prefix (file-remote-p file-name)))) + (concat python-shell-local-prefix (file-local-name file-name))) + ((and process-prefix (string= (file-remote-p file-name) process-prefix)) + (file-local-name file-name)) + (t file-name))))) + (defun python-shell-send-string (string &optional process msg) "Send STRING to inferior Python PROCESS. When optional argument MSG is non-nil, forces display of a @@ -4023,11 +4048,13 @@ python-shell-send-string t when called interactively." (interactive (list (read-string "Python command: ") nil t)) - (let ((process (or process (python-shell-get-process-or-error msg))) - (code (format "__PYTHON_EL_eval(%s, %s)\n" - (python-shell--encode-string string) - (python-shell--encode-string (or (buffer-file-name) - ""))))) + (let* ((process (or process (python-shell-get-process-or-error msg))) + (code (format "__PYTHON_EL_eval(%s, %s)\n" + (python-shell--encode-string string) + (python-shell--encode-string + (or (python-shell--convert-file-name-to-send + process (buffer-file-name)) + ""))))) (unless python-shell-output-filter-in-progress (with-current-buffer (process-buffer process) (save-excursion @@ -4358,7 +4385,8 @@ python-shell-send-file temp-file-name (with-temp-buffer (insert-file-contents file-name) (python-shell--save-temp-file (current-buffer)))))) - (let* ((file-name (file-local-name (expand-file-name file-name))) + (let* ((file-name (python-shell--convert-file-name-to-send + process (expand-file-name file-name))) (temp-file-name (when temp-file-name (file-local-name (expand-file-name temp-file-name))))) @@ -5082,8 +5110,12 @@ python-pdbtrack-set-tracked-buffer "Set the buffer for FILE-NAME as the tracked buffer. Internally it uses the `python-pdbtrack-tracked-buffer' variable. Returns the tracked buffer." - (let* ((file-name-prospect (concat (file-remote-p default-directory) - file-name)) + (let* ((file-name-prospect + (if (string-prefix-p python-shell-local-prefix file-name) + (string-remove-prefix python-shell-local-prefix file-name) + (if (file-remote-p file-name) + file-name + (concat (file-remote-p default-directory) file-name)))) (file-buffer (get-file-buffer file-name-prospect))) (unless file-buffer (cond diff --git a/test/lisp/progmodes/python-tests.el b/test/lisp/progmodes/python-tests.el index d65ef39abb4..b9130da495d 100644 --- a/test/lisp/progmodes/python-tests.el +++ b/test/lisp/progmodes/python-tests.el @@ -4602,6 +4602,32 @@ python-shell-prompt-set-calculated-regexps-6 "^\\(o\\.t \\|\\)"))) (ignore-errors (delete-file startup-file)))))) +(ert-deftest python-shell--convert-file-name-to-send-1 () + "Test parameters consist of a list of the following three elements. +1. The variable `default-directory' of the process. +2. FILE-NAME argument. +3. The expected return value." + (python-tests-with-temp-buffer-with-shell + "" + (let* ((path "/tmp/tmp.py") + (local-path (concat python-shell-local-prefix path)) + (remote1-path (concat "/ssh:remote1:" path)) + (remote2-path (concat "/ssh:remote2:" path)) + (process (python-shell-get-process))) + (dolist + (test (list (list "/tmp" nil nil) + (list "/tmp" path path) + (list "/tmp" local-path path) + (list "/ssh:remote1:/tmp" path local-path) + (list "/ssh:remote1:/tmp" local-path local-path) + (list "/ssh:remote1:/tmp" remote1-path path) + (list "/ssh:remote1:/tmp" remote2-path remote2-path))) + (with-current-buffer (process-buffer process) + (setq default-directory (nth 0 test))) + (should (string= (python-shell--convert-file-name-to-send + process (nth 1 test)) + (nth 2 test))))))) + (ert-deftest python-shell-buffer-substring-1 () "Selecting a substring of the whole buffer must match its contents." (python-tests-with-temp-buffer -- 2.43.0 --Multipart_Wed_Aug__6_23:14:46_2025-1-- From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 07 04:12:58 2025 Received: (at 79036) by debbugs.gnu.org; 7 Aug 2025 08:12:58 +0000 Received: from localhost ([127.0.0.1]:33506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ujvkA-0006ZK-8E for submit@debbugs.gnu.org; Thu, 07 Aug 2025 04:12:58 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:55791) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1ujvk7-0006Yu-6d for 79036@debbugs.gnu.org; Thu, 07 Aug 2025 04:12:56 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-3b78127c5d1so371068f8f.3 for <79036@debbugs.gnu.org>; Thu, 07 Aug 2025 01:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754554369; x=1755159169; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=XoCBq9QrA8vgVIc0dYQ0rgh001UEfr085gCw2T+9Pho=; b=fb/EKVQCmnQ8q0q1t2qmgJLm9gArM4LHDnON6eEGHtnhcw0e9mqc2JTEzC6sV7q9Cn mt/pEfYao6+lsDKgCwtKvN7nUJL6gLiicOUyNczlvN4VzO+p3jBlp1rk+yBh+WgCyX5N p13pG0HR3HMQF2/Hutfx24OZHgO5iJwvADcyDKneaJNLCMZej2Jm1wAYOYr9mfdCdQVt xTN8ZcXTeaAksLRvTJEf9UpgUGW6VBH7ibEbXhVgDmGXfNZpxdJ3wLnPTLGZtxkDSGD2 wzlfUXkIu78iHHPD+Tlr+PahjudFjM/oyJbLgr96eSCtVzPL3/Bw3G6nhy23eeb8Rg5i fikQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754554369; x=1755159169; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XoCBq9QrA8vgVIc0dYQ0rgh001UEfr085gCw2T+9Pho=; b=uoZN4FEATBJyqgIMlg+O32gyWoz4AIqjNUJwTGjRFMvb+Sq9tU+NDl0+EfQUQalvV/ CFZCEHXmIk6DHS4dL/LD1EMPbNXb7dE3PMKZswCpcRIlsJpOj12fza+CH/e6Nl8b+83C MiopvKaaqxgLZbvus/7ALpGosui3PGJ85/n8aieuDroVnheV8F2hkp499+4rI/sCDtuJ Cjisjh5Cr4KUg1+H7vUKy2Vkt1LjsuS5aNURerN0hMQTH0jXv97aB0Hn3KlYC4U1sIqF +mSi5+H7/MDF1l98ppJNaJLwx1fMyLA9tZ++P03ACMnj6Vx+TRKDrAYeQUKGQtdQNTas kBlw== X-Forwarded-Encrypted: i=1; AJvYcCVxCYNwHt32Vf1pt5d9rT6ffMe8XSVSCOmm92xtIA3Ptv2xZTaMkuB8Svx38hPARA2KTJpqOg==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yxqb0pdH8hCGWplY4NxSQLVapAYLmjTtUlguXNbuPn+f9T5iCSx usZlJdzexebcrYIRPWBCLoHRiJ6UR5Vsjcl82MocepYQmqAz4/rVq+T8N+QsRPy0VnO2+7+C6Fy 3C36SLcxQwBwXEue9UxnOkzHTV0V3Ggo= X-Gm-Gg: ASbGncv4SuWhdOnNZnmXVfBOIvTphf6jVFRCFEIsLLaVU0+YKxaGCsPv5n4XE0vL0nn 7VFIhTc2iX9xVWV2XtLWWsdR0VRLc0VL4ObvIAuL+BMNY7jRP0AUhVsVXi9/8sZv07vnoOydyp6 tFPt9pNCO8mnbVKIDTTbyFUR7DSNbiatDajiWCCH3LvK5y6WgrwSMkbHgN0t6yCxQFG3BAqwdmc P6N1ODj X-Google-Smtp-Source: AGHT+IH76edBkUyjGGMXdee06l319k16skjz3Uuh7MSFwRP/9bc+cxydnTJIcK3+2tqy7+9gfHwg6F6t08/Pn1+X3T4= X-Received: by 2002:adf:fe8b:0:b0:3b8:fa8c:f1b3 with SMTP id ffacd0b85a97d-3b8fa8cf3a0mr1009838f8f.53.1754554368507; Thu, 07 Aug 2025 01:12:48 -0700 (PDT) MIME-Version: 1.0 References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <86ikjpft4p.fsf@gnu.org> <86ecudfj9w.fsf@gnu.org> <861pq8bggd.fsf@gnu.org> <87tt35307m.fsf@gmx.de> <86qzxtrfem.fsf@gnu.org> <87cy9qhp4q.fsf@gmx.de> In-Reply-To: From: Liu Hui Date: Thu, 7 Aug 2025 16:12:37 +0800 X-Gm-Features: Ac12FXwoDOsdXHFvdl70XKWm4SNn2iZAiRI7tdNBheySuVdTDhjuDQMUvExNMMo Message-ID: Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames To: kobarity Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On Wed, Aug 6, 2025 at 10:14 PM kobarity wrote: > > kobarity wrote: > > > > Liu Hui wrote: > > > > > > On Sun, Aug 3, 2025 at 7:47 PM kobarity wrote: > > > > > > > Eli Zaretskii wrote: > > > > [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (liuhui1610[at]gmail.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (liuhui1610[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:435 listed in] [list.dnswl.org] 1.0 FREEMAIL_REPLY From and body contain different freemails X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org, Eli Zaretskii , michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Wed, Aug 6, 2025 at 10:14=E2=80=AFPM kobarity wrote= : > > kobarity wrote: > > > > Liu Hui wrote: > > > > > > On Sun, Aug 3, 2025 at 7:47=E2=80=AFPM kobarity = wrote: > > > > > > > Eli Zaretskii wrote: > > > > > > > > > > > From: Liu Hui > > > > > > Date: Thu, 24 Jul 2025 08:45:54 +0800 > > > > > > Cc: Eli Zaretskii , michael.albinus@gmx.de, 79036= @debbugs.gnu.org > > > > > > > > > > > > On Wed, Jul 23, 2025 at 11:08=E2=80=AFPM kobarity wrote: > > > > > > > > > > > > > > For non-file buffers, could it return buffer name instead o= f ? > > > > > > > > e.g. # or # where NAME may need to be qu= oted. Then > > > > > > > > python-pdbtrack-set-tracked-buffer can find it by (get-buff= er-create > > > > > > > > "NAME"). > > > > > > > > > > > > > > That might be a good idea. Why is `get-buffer-create' is nec= essary > > > > > > > rather than `get-buffer'? > > > > > > > > > > > > Thanks for pointing it out. get-buffer should be used here. > > > > > > > > > > So can we please have an updated patch for this? > > > > > > > > Since it is an improvement to add a new feature and not a fix for > > > > #79036, I think it would be better to separate the patches. > > > > > > > > Attached is my proposed patch to fix #79036. > > > > > > Hi, > > > > > > I find python-shell-send-file has the same issue as > > > python-shell-send-string, and > > > needs to use correct file-name too. > > > > Thanks, I will update the patch. > > Attached is the revised patch to fix #79036. Thanks! I confirm it works. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 07 09:08:10 2025 Received: (at 79036) by debbugs.gnu.org; 7 Aug 2025 13:08:10 +0000 Received: from localhost ([127.0.0.1]:34031 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uk0Lp-0006kE-RT for submit@debbugs.gnu.org; Thu, 07 Aug 2025 09:08:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50930) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uk0Ln-0006jm-2u for 79036@debbugs.gnu.org; Thu, 07 Aug 2025 09:08:07 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uk0Lh-00087x-PC; Thu, 07 Aug 2025 09:08:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=VpBK4GvKN/GPrv2aWg4mwdTI/gi8LFFlhxyA6fQjFNs=; b=LC1W7zJNzwzE 3f4CyoBxaWdbpya6g1kGGgIlt9dNWfpJAxBix96/CXw6uIlXMQd1SJvK1v9STO/S0wldAnPGI36tp K/Vnmq3g69G4eoQf6qVNX0hwk6FUkC9skwMgBCDvfPLBO9cii2J+K+9p1aovHiQBxBSs9elz6Jg5X ejZTPiqit2+XijQT5uWcIfmIrL4tkSYCiYXbWaNilrr7MNdPPA/NA2Mosx+DzsODYyi3XKUBuDwbs 3uEqiPc8HMZEUIOReEEl1p0uOgTbE57PFMb86Qmk+e+FwFpBzOq3LKa9lc7WnF4F1riCeS0V2pp9A pLZj/3UvsXCIBqYK7j3TWQ==; Date: Thu, 07 Aug 2025 16:07:57 +0300 Message-Id: <86ikizqnyq.fsf@gnu.org> From: Eli Zaretskii To: kobarity In-Reply-To: (message from kobarity on Wed, 06 Aug 2025 23:14:47 +0900) Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <86ikjpft4p.fsf@gnu.org> <86ecudfj9w.fsf@gnu.org> <861pq8bggd.fsf@gnu.org> <87tt35307m.fsf@gmx.de> <86qzxtrfem.fsf@gnu.org> <87cy9qhp4q.fsf@gmx.de> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79036 Cc: liuhui1610@gmail.com, michael.albinus@gmx.de, 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Wed, 06 Aug 2025 23:14:47 +0900 > From: kobarity > Cc: 79036@debbugs.gnu.org > > Attached is the revised patch to fix #79036. Thanks, now installed on master. Should we close this bug now, or is there anything else left to do here? From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 07 09:52:29 2025 Received: (at 79036) by debbugs.gnu.org; 7 Aug 2025 13:52:29 +0000 Received: from localhost ([127.0.0.1]:34149 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uk12i-0000bl-Jc for submit@debbugs.gnu.org; Thu, 07 Aug 2025 09:52:28 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:52600) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1uk12f-0000bS-5Z for 79036@debbugs.gnu.org; Thu, 07 Aug 2025 09:52:26 -0400 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-b4233978326so547513a12.1 for <79036@debbugs.gnu.org>; Thu, 07 Aug 2025 06:52:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754574739; x=1755179539; darn=debbugs.gnu.org; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:from:to:cc:subject:date:message-id:reply-to; bh=f/SPDRef0lueUBS0AYtSOHs2KJeLV8VH9+PQjhIrF5U=; b=DSMEkUEToS3lkfMqcIit1TsaAmyhfCdkfieZLxYHfYXX3AOfUpOwrqyf0xdSyA9TED og+XI/EvexWd+rJcXnIKO/wRmAVdYDbJrvh8JRIDYR6j/gnnM8JXWM2ItZtOZsLpo0Mc qV181G6FoloEP3qHvz9cB8kR7vQh/LLAkzf+MWIg4Vch5VyvAHzTCk2bTIsyGUB9YsO8 /rmhrZLViVNTOHkH5SqbPwBRuQReDlcEOJhtS7FVFsd9GUU5wUCoKtkBpztggEnXKy6e XwPOQm3AEYnFggioBIFWodEeGte+7b8axDBzcj/9FQSPQ+2CTtPrx/VPOIzi4CsFgZ+L f8tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754574739; x=1755179539; h=mime-version:user-agent:references:in-reply-to:subject:cc:to:from :message-id:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=f/SPDRef0lueUBS0AYtSOHs2KJeLV8VH9+PQjhIrF5U=; b=kRtTrWrrspnYC+REFfFpleUGECLs3T2QgZrt/9bgNVxvEw2mi5JMqL9bH216BnCJU3 KVd0HY6L9Mg8DTa3XzCZy7kXZT/HU16wdybpnM7b4p16IxJ7W26ndZ8WDcwwfQrs14tL xmau+2XYbhp8JAiJ6X9mx64H9B9dhf1JR9ggCwWi6L7PH1TufXq1nxX8pLbDaRqpWDZA xVhNUIkaJmYGtasO3OqptZeGzWWmwMqDEpiURxBxJhhExOZYqBt+MgMGdN9dlG4kuaxG 7Tt9ruRfoE3TZcwkSTpCH9dgn14/AcFeD7DyaXinHuTWD2kdvv6Dzx/H+a29H3JuKw9+ NRWQ== X-Gm-Message-State: AOJu0YyWf/DSzPdQ/Lp9bkhAfLvM3yzf2/1dyHdV6MLfjU67w4vdmPcg cSuhOyYsWc0GG90jiKR99XGtCdZzS1SvWm+lkGnQREqKgKLP23ONBz32 X-Gm-Gg: ASbGnctkIGyp8xz6CBoh0raKWkoWywE1FvMXsl0MrmkeLljd6uFWHjQi+jDiIrrOBfW bg77XlbS+gw/80o5w1Tg4QPznBiWDjqX9aw3HPHUhEUNNRrcOtkT+EH2ShDiy6kMplopOazDVl1 5LD5dsPmQ0lAc7EvBxHWJsERLT5IjUb+v704yU1ZHmdEyoxaGlERXae3UA2AKiEeLE4LfwCDrnH i2BLd4RQHMy62Db5FXwdb0ovNCXtCJ88CCWREpiJmU5w+3hBOhq9HIdOzduxVmhhkMftJoVdg4P V/1s2w17mB8ZadNWdhUhHU82wRaLTo9p+ZtyVTrTZWR+OFOUlWz78BYpktb7xRkqN6QXDh1CXEf 5xDYvMyN3atX31TB+DmEDfjLt/lZRGo12H6CRTFPtcu5tthwobr65 X-Google-Smtp-Source: AGHT+IGep5Ag5PrLqJmcvT9fdTdGAAZbkpVkHiSO6WX/4unzbJssnKFg0IxykZ3zf1D0DvIDhibM5w== X-Received: by 2002:a17:903:1b30:b0:240:11be:4dd3 with SMTP id d9443c01a7336-2429f521ac4mr94186275ad.3.1754574738663; Thu, 07 Aug 2025 06:52:18 -0700 (PDT) Received: from localhost (58x12x133x161.ap58.ftth.ucom.ne.jp. [58.12.133.161]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-241e8976ad3sm185307705ad.92.2025.08.07.06.52.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Aug 2025 06:52:18 -0700 (PDT) Date: Thu, 07 Aug 2025 22:52:13 +0900 Message-ID: From: kobarity To: Eli Zaretskii , liuhui1610@gmail.com, michael.albinus@gmx.de Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames In-Reply-To: <86ikizqnyq.fsf@gnu.org> References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <86ikjpft4p.fsf@gnu.org> <86ecudfj9w.fsf@gnu.org> <861pq8bggd.fsf@gnu.org> <87tt35307m.fsf@gmx.de> <86qzxtrfem.fsf@gnu.org> <87cy9qhp4q.fsf@gmx.de> <86ikizqnyq.fsf@gnu.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/31.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 79036 Cc: 79036@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii wrote: > > > Date: Wed, 06 Aug 2025 23:14:47 +0900 > > From: kobarity > > Cc: 79036@debbugs.gnu.org > > > > Attached is the revised patch to fix #79036. > > Thanks, now installed on master. > > Should we close this bug now, or is there anything else left to do > here? Thanks. I think we can close this bug. It would be best for Liu to send a patch as a separate bug ID for the improvement using the buffer name. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 07 10:46:24 2025 Received: (at 79036-done) by debbugs.gnu.org; 7 Aug 2025 14:46:24 +0000 Received: from localhost ([127.0.0.1]:35441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uk1su-0003Z4-4O for submit@debbugs.gnu.org; Thu, 07 Aug 2025 10:46:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56172) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uk1sr-0003Yj-7A for 79036-done@debbugs.gnu.org; Thu, 07 Aug 2025 10:46:21 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uk1sl-00028p-S2; Thu, 07 Aug 2025 10:46:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=k4hYnSTfl4LBUWhRxKos9FvWkzldns37/0YZnBOPtEc=; b=KXq+QO0kTz4O 0GGaKDKIJt3f/czlXW2vDMPDwqPqL9kS6msJAxW/eeTbGjjR9q/bhQXmODAIXqnzzCMMCfrvDmjod 95fJx3yc1TixSwXZqiydG7AvsrpRLTan9OkwaYlp9Ud6dUlUkKZISooBjlfz4/jz6ZwkdOPZpt5R2 svVEkopOK/9LB4bNhB5wS0st8RU17WyMxpSGTtodkPhPiDoVjwsTsWa/cUiHjr501M4h6O2deZ09O SgOyDLOWdIC0jD7xeMsUl2sJug1uIPk/K70Dn/aiwoYZAdudwXAZlztI8AB19ZpshO0Ehi45Qyeih M48W4jDIA8CEs4HRPQqW7w==; Date: Thu, 07 Aug 2025 17:46:09 +0300 Message-Id: <86qzxnp4um.fsf@gnu.org> From: Eli Zaretskii To: kobarity In-Reply-To: (message from kobarity on Thu, 07 Aug 2025 22:52:13 +0900) Subject: Re: bug#79036: [PATCH] Fix pdb tracking for remote filenames References: <86tt3bgvyv.fsf@gnu.org> <87zfd3iaab.fsf@gmx.de> <86pldzgswm.fsf@gnu.org> <87v7nri61q.fsf@gmx.de> <86ms93gq7w.fsf@gnu.org> <86ecufggtr.fsf@gnu.org> <8634auhotq.fsf@gnu.org> <86jz45g0qi.fsf@gnu.org> <86ikjpft4p.fsf@gnu.org> <86ecudfj9w.fsf@gnu.org> <861pq8bggd.fsf@gnu.org> <87tt35307m.fsf@gmx.de> <86qzxtrfem.fsf@gnu.org> <87cy9qhp4q.fsf@gmx.de> <86ikizqnyq.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79036-done Cc: liuhui1610@gmail.com, 79036-done@debbugs.gnu.org, michael.albinus@gmx.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Thu, 07 Aug 2025 22:52:13 +0900 > From: kobarity > Cc: 79036@debbugs.gnu.org > > Eli Zaretskii wrote: > > > > > Date: Wed, 06 Aug 2025 23:14:47 +0900 > > > From: kobarity > > > Cc: 79036@debbugs.gnu.org > > > > > > Attached is the revised patch to fix #79036. > > > > Thanks, now installed on master. > > > > Should we close this bug now, or is there anything else left to do > > here? > > Thanks. I think we can close this bug. It would be best for Liu to > send a patch as a separate bug ID for the improvement using the buffer > name. Thanks, closing.