diff options
author | Leo Liu <sdl.web@gmail.com> | 2012-04-26 00:46:01 +0800 |
---|---|---|
committer | Leo Liu <sdl.web@gmail.com> | 2012-04-26 00:46:01 +0800 |
commit | 784e7d6eebb4ac47d1f7b4e724b7aa843bc02f81 (patch) | |
tree | 497df3b8e2f213ce358a4aab7ae337359a976652 /lisp | |
parent | daf75653c2f1301332eb6c8af830050794ae0877 (diff) | |
download | emacs-784e7d6eebb4ac47d1f7b4e724b7aa843bc02f81.tar.gz emacs-784e7d6eebb4ac47d1f7b4e724b7aa843bc02f81.tar.bz2 emacs-784e7d6eebb4ac47d1f7b4e724b7aa843bc02f81.zip |
* lisp/progmodes/python.el (python-pdbtrack-get-source-buffer): Use
compilation-message if available to find real filename.
Diffstat (limited to 'lisp')
-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 @@ +2012-04-25 Leo Liu <sdl.web@gmail.com> + + * progmodes/python.el (python-pdbtrack-get-source-buffer): Use + compilation-message if available to find real filename. + 2012-04-25 Chong Yidong <cyd@gnu.org> * 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." (let* ((filename (match-string 1 block)) (lineno (string-to-number (match-string 2 block))) (funcname (match-string 3 block)) + (msg (get-text-property 0 'compilation-message filename)) + (loc (and msg (compilation--message->loc msg))) funcbuffer) - (cond ((file-exists-p filename) + (cond ((and loc (markerp (compilation--loc->marker loc))) + (setq funcbuffer (marker-buffer (compilation--loc->marker loc))) + (list (with-current-buffer funcbuffer + (line-number-at-pos (compilation--loc->marker loc))) + funcbuffer)) + + ((file-exists-p filename) (list lineno (find-file-noselect filename))) ((setq funcbuffer (python-pdbtrack-grub-for-buffer funcname lineno)) @@ -2626,15 +2634,12 @@ problem." (buffer-substring (point-min) (point-max))) ))))))) - (list lineno funcbuffer)) + (list lineno funcbuffer)) ((= (elt filename 0) ?\<) (format "(Non-file source: '%s')" filename)) - (t (format "Not found: %s(), %s" funcname filename))) - ) - ) - ) + (t (format "Not found: %s(), %s" funcname filename)))))) (defun python-pdbtrack-grub-for-buffer (funcname _lineno) "Find recent Python mode buffer named, or having function named FUNCNAME." |