From: Dima Kogan <dima@secretsauce.net>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: 13304@debbugs.gnu.org
Subject: bug#13304: [PATCH] full-path gud breakpoints now don't get confused by tramp
Date: Mon, 31 Dec 2012 11:53:13 -0800 [thread overview]
Message-ID: <20121231115313.3be6b7ea@fatty> (raw)
In-Reply-To: <87mwwup6tl.fsf@gmx.de>
[-- Attachment #1: Type: text/plain, Size: 460 bytes --]
> On Mon, 31 Dec 2012 16:41:42 +0100
> Michael Albinus <michael.albinus@gmx.de> wrote:
>
> Dima Kogan <dima@secretsauce.net> writes:
>
> > + (tramp-file-name-localname (tramp-dissect-file-name
> > + (buffer-file-name) t))
>
> Don't use Tramp internal functions, they are not documented by
> intention. You could use instead
>
> (file-remote-p (buffer-file-name) 'localname)
Great point; this is really much better. I'm attaching an updated patch.
[-- Attachment #2: 0001-full-path-gud-breakpoints-now-don-t-get-confused-by-.patch --]
[-- Type: text/x-patch, Size: 1978 bytes --]
From f27e176b58dc9fd813ad5f9228066d3fcc2c226c Mon Sep 17 00:00:00 2001
From: Dima Kogan <dima@secretsauce.net>
Date: Sat, 29 Dec 2012 02:54:40 -0800
Subject: [PATCH] full-path gud breakpoints now don't get confused by tramp
prior to this patch if gud used a path to set a breakpoint, the FULL
path would be sent to the backend debugger, including the tramp
pieces. The backends don't know anything about tramp, so they were
naturally confused by this. Most notably, it was impossible to set
from-source breakpoints in pdb, the python debugger.
---
lisp/progmodes/gud.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 13eac83..c178a53 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -2743,6 +2743,9 @@ Obeying it means displaying in another window the specified file and line."
(defun gud-format-command (str arg)
(let ((insource (not (eq (current-buffer) gud-comint-buffer)))
(frame (or gud-last-frame gud-last-last-frame))
+ (buffer-file-name-localized
+ (and (buffer-file-name) (or (file-remote-p (buffer-file-name) 'localname)
+ (buffer-file-name))))
result)
(while (and str
(let ((case-fold-search nil))
@@ -2752,15 +2755,15 @@ Obeying it means displaying in another window the specified file and line."
(cond
((eq key ?f)
(setq subst (file-name-nondirectory (if insource
- (buffer-file-name)
+ buffer-file-name-localized
(car frame)))))
((eq key ?F)
(setq subst (file-name-base (if insource
- (buffer-file-name)
+ buffer-file-name-localized
(car frame)))))
((eq key ?d)
(setq subst (file-name-directory (if insource
- (buffer-file-name)
+ buffer-file-name-localized
(car frame)))))
((eq key ?l)
(setq subst (int-to-string
--
1.7.10.4
next prev parent reply other threads:[~2012-12-31 19:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-29 11:00 bug#13304: [PATCH] full-path gud breakpoints now don't get confused by tramp Dima Kogan
[not found] ` <handler.13304.B.13567788884884.ack@debbugs.gnu.org>
2012-12-29 20:23 ` bug#13304: Acknowledgement ([PATCH] full-path gud breakpoints now don't get confused by tramp) Dima Kogan
2012-12-31 15:41 ` bug#13304: [PATCH] full-path gud breakpoints now don't get confused by tramp Michael Albinus
2012-12-31 19:53 ` Dima Kogan [this message]
2015-09-21 2:37 ` bug#13304: ping Dima Kogan
2015-09-21 10:56 ` Eli Zaretskii
2015-09-21 18:38 ` Dima Kogan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121231115313.3be6b7ea@fatty \
--to=dima@secretsauce.net \
--cc=13304@debbugs.gnu.org \
--cc=michael.albinus@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.