Subject: Re: bug#34489: 25.2; pdb fails if directory contains '++'

From: Stefan Kangas <[email-masked]>
Date: Fri, 5 Jul 2019 17:51:00 +0200

Eli Zaretskii <[email-masked]> writes:

> I think both [:print:] and .* would be too radical, as I'm not sure
> including control characters and arbitrary whitespace will not break
> something.  But maybe [:graph:] is better than [:alnum:].
>
> In any case, I think we want a comment there saying that this is to
> allow more characters in file names shown in the prompt.

How about the attached patch?

Thanks,
Stefan Kangas
From 1e78d0abd4bc1d9475265c3b87718266fe5e9c92 Mon Sep 17 00:00:00 2001
From: Stefan Kangas <[email-masked]>
Date: Sun, 30 Jun 2019 19:17:52 +0200
Subject: [PATCH] Make "M-x pdb" use "[:graph:]" to match file names

* lisp/progmodes/gud.el (gud-pdb-marker-regexp): Use "[:graph:]" to
match file name in prompt.  (Bug#34489)
---
 lisp/progmodes/gud.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el
index 4306f5daa0..6b152b7b90 100644
--- a/lisp/progmodes/gud.el
+++ b/lisp/progmodes/gud.el
@@ -1605,8 +1605,12 @@ gud-pdb-history
 
 ;; Last group is for return value, e.g. "> test.py(2)foo()->None"
 ;; Either file or function name may be omitted: "> <string>(0)?()"
+;;
+;; We use [:graph:] to be very allowing with regards to which
+;; characters we match in the file name shown in the prompt.
+;; (Of course, this matches the "<string>" case too.)
 (defvar gud-pdb-marker-regexp
-  "^> \\([-a-zA-Z0-9_/.:@ \\]*\\|<string>\\)(\\([0-9]+\\))\\([a-zA-Z0-9_]*\\|\\?\\|<module>\\)()\\(->[^\n\r]*\\)?[\n\r]")
+  "^> \\([[:graph:] \\]*\\)(\\([0-9]+\\))\\([a-zA-Z0-9_]*\\|\\?\\|<module>\\)()\\(->[^\n\r]*\\)?[\n\r]")
 
 (defvar gud-pdb-marker-regexp-file-group 1)
 (defvar gud-pdb-marker-regexp-line-group 2)
-- 
2.11.0