emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r111207: * progmodes/python.el


From: Fabián Ezequiel Gallina
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r111207: * progmodes/python.el
Date: Wed, 30 Jan 2013 12:02:58 -0300
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111207
committer: Fabián Ezequiel Gallina <address@hidden>
branch nick: emacs-24
timestamp: Wed 2013-01-30 12:02:58 -0300
message:
  * progmodes/python.el
  (python-pdbtrack-comint-output-filter-function): Enhancements on
  stacktrace detection.  (thanks @gnovak)
modified:
  lisp/ChangeLog
  lisp/progmodes/python.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-01-30 07:47:11 +0000
+++ b/lisp/ChangeLog    2013-01-30 15:02:58 +0000
@@ -1,3 +1,9 @@
+2013-01-30  Fabián Ezequiel Gallina  <address@hidden>
+
+       * progmodes/python.el
+       (python-pdbtrack-comint-output-filter-function): Enhancements on
+       stacktrace detection.  (thanks @gnovak)
+
 2013-01-30  Glenn Morris  <address@hidden>
 
        * imenu.el (imenu-default-create-index-function):

=== modified file 'lisp/progmodes/python.el'
--- a/lisp/progmodes/python.el  2013-01-28 21:59:42 +0000
+++ b/lisp/progmodes/python.el  2013-01-30 15:02:58 +0000
@@ -2317,15 +2317,17 @@
            (file-name
             (with-temp-buffer
               (insert full-output)
-              (goto-char (point-min))
-              ;; OK, this sucked but now it became a cool hack. The
-              ;; stacktrace information normally is on the first line
-              ;; but in some cases (like when doing a step-in) it is
-              ;; on the second.
-              (when (or (looking-at python-pdbtrack-stacktrace-info-regexp)
-                        (and
-                         (forward-line)
-                         (looking-at python-pdbtrack-stacktrace-info-regexp)))
+              ;; When the debugger encounters a pdb.set_trace()
+              ;; command, it prints a single stack frame.  Sometimes
+              ;; it prints a bit of extra information about the
+              ;; arguments of the present function.  When ipdb
+              ;; encounters an exception, it prints the _entire_ stack
+              ;; trace.  To handle all of these cases, we want to find
+              ;; the _last_ stack frame printed in the most recent
+              ;; batch of output, then jump to the corrsponding
+              ;; file/line number.
+              (goto-char (point-max))
+              (when (re-search-backward python-pdbtrack-stacktrace-info-regexp 
nil t)
                 (setq line-number (string-to-number
                                    (match-string-no-properties 2)))
                 (match-string-no-properties 1)))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]