diff options
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/progmodes/python.el | 17 |
2 files changed, 16 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 81313efc69b..55df33b4d30 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-04-25 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * progmodes/python.el (python-pdbtrack-get-source-buffer): Use | ||
| 4 | compilation-message if available to find real filename. | ||
| 5 | |||
| 1 | 2012-04-25 Chong Yidong <cyd@gnu.org> | 6 | 2012-04-25 Chong Yidong <cyd@gnu.org> |
| 2 | 7 | ||
| 3 | * vc/diff-mode.el (diff-setup-whitespace): New function. | 8 | * vc/diff-mode.el (diff-setup-whitespace): New function. |
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index b00e42db4b7..620ea8cd519 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -2606,9 +2606,17 @@ problem." | |||
| 2606 | (let* ((filename (match-string 1 block)) | 2606 | (let* ((filename (match-string 1 block)) |
| 2607 | (lineno (string-to-number (match-string 2 block))) | 2607 | (lineno (string-to-number (match-string 2 block))) |
| 2608 | (funcname (match-string 3 block)) | 2608 | (funcname (match-string 3 block)) |
| 2609 | (msg (get-text-property 0 'compilation-message filename)) | ||
| 2610 | (loc (and msg (compilation--message->loc msg))) | ||
| 2609 | funcbuffer) | 2611 | funcbuffer) |
| 2610 | 2612 | ||
| 2611 | (cond ((file-exists-p filename) | 2613 | (cond ((and loc (markerp (compilation--loc->marker loc))) |
| 2614 | (setq funcbuffer (marker-buffer (compilation--loc->marker loc))) | ||
| 2615 | (list (with-current-buffer funcbuffer | ||
| 2616 | (line-number-at-pos (compilation--loc->marker loc))) | ||
| 2617 | funcbuffer)) | ||
| 2618 | |||
| 2619 | ((file-exists-p filename) | ||
| 2612 | (list lineno (find-file-noselect filename))) | 2620 | (list lineno (find-file-noselect filename))) |
| 2613 | 2621 | ||
| 2614 | ((setq funcbuffer (python-pdbtrack-grub-for-buffer funcname lineno)) | 2622 | ((setq funcbuffer (python-pdbtrack-grub-for-buffer funcname lineno)) |
| @@ -2626,15 +2634,12 @@ problem." | |||
| 2626 | (buffer-substring | 2634 | (buffer-substring |
| 2627 | (point-min) (point-max))) | 2635 | (point-min) (point-max))) |
| 2628 | ))))))) | 2636 | ))))))) |
| 2629 | (list lineno funcbuffer)) | 2637 | (list lineno funcbuffer)) |
| 2630 | 2638 | ||
| 2631 | ((= (elt filename 0) ?\<) | 2639 | ((= (elt filename 0) ?\<) |
| 2632 | (format "(Non-file source: '%s')" filename)) | 2640 | (format "(Non-file source: '%s')" filename)) |
| 2633 | 2641 | ||
| 2634 | (t (format "Not found: %s(), %s" funcname filename))) | 2642 | (t (format "Not found: %s(), %s" funcname filename)))))) |
| 2635 | ) | ||
| 2636 | ) | ||
| 2637 | ) | ||
| 2638 | 2643 | ||
| 2639 | (defun python-pdbtrack-grub-for-buffer (funcname _lineno) | 2644 | (defun python-pdbtrack-grub-for-buffer (funcname _lineno) |
| 2640 | "Find recent Python mode buffer named, or having function named FUNCNAME." | 2645 | "Find recent Python mode buffer named, or having function named FUNCNAME." |