diff options
author | Ken Manheimer <klm@digicool.com> | 2003-06-17 19:18:57 (GMT) |
---|---|---|
committer | Ken Manheimer <klm@digicool.com> | 2003-06-17 19:18:57 (GMT) |
commit | 8e9b80fd561e68574ee313f32d3fd6cde59d7723 (patch) | |
tree | c22ae528b39cf5f505a3052441ecddf7d0a78986 /Misc | |
parent | 0887c732e7d6e162b4b78004af8546b739c77ca7 (diff) | |
download | cpython-8e9b80fd561e68574ee313f32d3fd6cde59d7723.zip cpython-8e9b80fd561e68574ee313f32d3fd6cde59d7723.tar.gz cpython-8e9b80fd561e68574ee313f32d3fd6cde59d7723.tar.bz2 |
Remove short-circuitying grubbing by using last grubbed buffer. It's
evil - if the last grubbed buffer didn't happen to be the right one,
you couldn't remedy.
Mainline emacs compat - don't use third arg to buffer-substring (which
was for explicitly identifying the buffer in which to seek the
substring, and which turns out to be unnecessary).
Diffstat (limited to 'Misc')
-rw-r--r-- | Misc/python-mode.el | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/Misc/python-mode.el b/Misc/python-mode.el index 61e4f46..ba4f88a 100644 --- a/Misc/python-mode.el +++ b/Misc/python-mode.el @@ -1370,8 +1370,7 @@ problem as best as we can determine." (max (point-min) (string-match "^\\([^#]\\|#[^#]\\|#$\\)" (buffer-substring (point-min) - (point-max) - funcbuffer)) + (point-max))) )))))) (list lineno funcbuffer)) @@ -1392,10 +1391,6 @@ named for funcname or define a function funcname." (let ((buffers (buffer-list)) curbuf got) - (if (and py-pdbtrack-last-grubbed-buffer - (member py-pdbtrack-last-grubbed-buffer buffers)) - ; Prefer last grubbed buffer by putting it at the front of the list: - (setq buffers (cons py-pdbtrack-last-grubbed-buffer buffers))) (while (and buffers (not got)) (setq buf (car buffers) buffers (cdr buffers)) @@ -1404,9 +1399,10 @@ named for funcname or define a function funcname." (or (string-match funcname (buffer-name buf)) (string-match (concat "^\\s-*\\(def\\|class\\)\\s-+" funcname "\\s-*(") - (buffer-substring (point-min buf) - (point-max buf) - buf)))) + (save-excursion + (set-buffer buf) + (buffer-substring (point-min) + (point-max)))))) (setq got buf))) (setq py-pdbtrack-last-grubbed-buffer got))) |