Merge lp:~nyergler/python-mode/pdbtrack-mapping into lp:python-mode

Proposed by Andreas Roehler
Status: Merged
Approved by: Andreas Roehler
Approved revision: 938
Merged at revision: 938
Proposed branch: lp:~nyergler/python-mode/pdbtrack-mapping
Merge into: lp:python-mode
Diff against target: 48 lines (+24/-0)
1 file modified
python-mode.el (+24/-0)
To merge this branch: bzr merge lp:~nyergler/python-mode/pdbtrack-mapping
Reviewer Review Type Date Requested Status
python-mode.el developers Pending
Review via email: mp+102149@code.launchpad.net

Description of the change

Hi Nathan,

thanks. Your code looks pretty clean. Consider merging it when the recent completion bugs being fixed.

Cheers,

Andreas

To post a comment you must log in.
Revision history for this message
Nathan R. Yergler (nyergler) wrote :

Thanks, Andreas. I'm not sure what "recent completion bugs" are... is that a problem with my code or something someone else is working on?

Revision history for this message
Andreas Roehler (a-roehler) wrote :

Am 16.04.2012 20:08, schrieb Nathan R. Yergler:
> Thanks, Andreas. I'm not sure what "recent completion bugs" are... is that a problem with my code or something someone else is working on?

it refers to latest bug reports,

https://bugs.launchpad.net/python-mode/+bug/981991

and the like. Which should be fixed soon BTW.

sorry, not being precise obviously...

Best,

Andreas

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'python-mode.el'
2--- python-mode.el 2012-04-14 08:01:10 +0000
3+++ python-mode.el 2012-04-16 17:49:18 +0000
4@@ -479,6 +479,13 @@
5 :group 'python-mode)
6 (make-variable-buffer-local 'py-pdbtrack-do-tracking-p)
7
8+(defcustom py-pdbtrack-filename-mapping nil
9+ "Supports mapping file paths when opening file buffers in pdbtrack.
10+When non-nil this is an alist mapping paths in the Python interpreter
11+to paths in Emacs."
12+ :type 'alist
13+ :group 'python-mode)
14+
15 (defcustom py-pdbtrack-minor-mode-string " PDB"
16 "*String to use in the minor mode list when pdbtrack is enabled."
17 :type 'string
18@@ -8069,6 +8076,20 @@
19 (py-pdbtrack-overlay-arrow t)
20 (pop-to-buffer origbuf t)))))))
21
22+(defun py-pdbtrack-map-filename (filename)
23+
24+ (let
25+ ((replacement-val (assoc-default
26+ filename py-pdbtrack-filename-mapping
27+ (lambda (mapkey path)
28+ (string-match
29+ (concat "^" (regexp-quote mapkey))
30+ path)))
31+ ))
32+ (if (not (eq replacement-val nil))
33+ (replace-match replacement-val 't 't filename)
34+ filename)))
35+
36 (defun py-pdbtrack-get-source-buffer (block)
37 "Return line number and buffer of code indicated by block's traceback text.
38
39@@ -8096,6 +8117,9 @@
40 (cond ((file-exists-p filename)
41 (list lineno (find-file-noselect filename)))
42
43+ ((file-exists-p (py-pdbtrack-map-filename filename))
44+ (list lineno (find-file-noselect (py-pdbtrack-map-filename filename))))
45+
46 ((setq funcbuffer (py-pdbtrack-grub-for-buffer funcname lineno))
47 (if (string-match "/Script (Python)$" filename)
48 ;; Add in number of lines for leading '##' comments:

Subscribers

People subscribed via source and target branches

to status/vote changes: