From 90132c14854a1b92cc2141ea2a863bc0cbdcfcff Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 9 Nov 2011 10:00:32 -0500 Subject: * lisp/progmodes/python.el (python-beginning-of-statement): Rewrite. Fixes: debbugs:2703 --- lisp/progmodes/python.el | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'lisp/progmodes/python.el') diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 38bf9552b2a..8615400bf6a 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -948,22 +948,12 @@ Finds end of innermost nested class or method definition." "Go to start of current statement. Accounts for continuation lines, multi-line strings, and multi-line bracketed expressions." - (beginning-of-line) - (python-beginning-of-string) - (let (point) - (while (and (python-continuation-line-p) - (if point - (< (point) point) - t)) - (beginning-of-line) + (while (if (python-backslash-continuation-line-p) - (progn - (forward-line -1) - (while (python-backslash-continuation-line-p) - (forward-line -1))) - (python-beginning-of-string) - (python-skip-out)) - (setq point (point)))) + (progn (forward-line -1) t) + (beginning-of-line) + (or (python-beginning-of-string) + (python-skip-out)))) (back-to-indentation)) (defun python-skip-out (&optional forward syntax) @@ -971,6 +961,7 @@ multi-line bracketed expressions." Skip forward if FORWARD is non-nil, else backward. If SYNTAX is non-nil it is the state returned by `syntax-ppss' at point. Return non-nil if and only if skipping was done." + ;; FIXME: Use syntax-ppss-toplevel-pos. (let ((depth (syntax-ppss-depth (or syntax (syntax-ppss)))) (forward (if forward -1 1))) (unless (zerop depth) -- cgit v1.2.1 From 8642c2163e9b0dfcf2aa4e0a6a7850b322faddc0 Mon Sep 17 00:00:00 2001 From: Ken Manheimer Date: Wed, 16 Nov 2011 11:37:48 -0500 Subject: * python.el (python-pdbtrack-stack-entry-regexp) (python-pdbtrack-input-prompt, python-pdbtrack-track-stack-file): Adjust to recognize ipdb as well as regular python pdb prompts. Adjustments shamelessly taken exactly as suggested in EmacsWiki page: http://www.emacswiki.org/PythonProgrammingInEmacs#toc14 --- lisp/progmodes/python.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/progmodes/python.el') diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 8615400bf6a..fe6bab0160d 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -550,7 +550,7 @@ element matches `python-python-command'." "^> \\(.*\\)(\\([0-9]+\\))\\([?a-zA-Z0-9_<>]+\\)()" "Regular expression pdbtrack uses to find a stack trace entry.") -(defconst python-pdbtrack-input-prompt "\n[(<]*[Pp]db[>)]+ " +(defconst python-pdbtrack-input-prompt "\n[(<]*[Ii]?[Pp]db[>)]+ " "Regular expression pdbtrack uses to recognize a pdb prompt.") (defconst python-pdbtrack-track-range 10000 @@ -2583,6 +2583,7 @@ find it." (if (not (string-match (concat python-pdbtrack-input-prompt "$") block)) (python-pdbtrack-overlay-arrow nil) + (setq block (ansi-color-filter-apply block)) (setq target (python-pdbtrack-get-source-buffer block)) (if (stringp target) -- cgit v1.2.1 From 4c36be58ca2b4777a5e7bf0d3e692cfd9fa1aea3 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 17 Nov 2011 01:09:20 -0800 Subject: Spelling fixes. --- lisp/progmodes/python.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/progmodes/python.el') diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index fe6bab0160d..8d2e6715444 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -119,7 +119,7 @@ (1 font-lock-type-face)) ;; Built-ins. (The next three blocks are from ;; `__builtin__.__dict__.keys()' in Python 2.7) These patterns - ;; are debateable, but they at least help to spot possible + ;; are debatable, but they at least help to spot possible ;; shadowing of builtins. (,(rx symbol-start (or ;; exceptions -- cgit v1.2.1 From c5e87d104b7342f35459c7513d6b4cefea1e968e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 17 Nov 2011 09:40:48 -0800 Subject: Spelling fixes. --- lisp/progmodes/python.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lisp/progmodes/python.el') diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 8d2e6715444..a0a368777e7 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2553,7 +2553,7 @@ If the traceback target file path is invalid, we look for the most recently visited python-mode buffer which either has the name of the current function or class, or which defines the function or class. This is to provide for scripts not in the -local filesytem (e.g., Zope's 'Script \(Python)', but it's not +local file system (e.g., Zope's 'Script \(Python)', but it's not Zope specific). If you put a copy of the script in a buffer named for the script and activate python-mode, then pdbtrack will find it." -- cgit v1.2.1