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).
This commit is contained in:
parent
0887c732e7
commit
8e9b80fd56
@ -1370,8 +1370,7 @@ problem as best as we can determine."
|
|||||||
(max (point-min)
|
(max (point-min)
|
||||||
(string-match "^\\([^#]\\|#[^#]\\|#$\\)"
|
(string-match "^\\([^#]\\|#[^#]\\|#$\\)"
|
||||||
(buffer-substring (point-min)
|
(buffer-substring (point-min)
|
||||||
(point-max)
|
(point-max)))
|
||||||
funcbuffer))
|
|
||||||
))))))
|
))))))
|
||||||
(list lineno funcbuffer))
|
(list lineno funcbuffer))
|
||||||
|
|
||||||
@ -1392,10 +1391,6 @@ named for funcname or define a function funcname."
|
|||||||
(let ((buffers (buffer-list))
|
(let ((buffers (buffer-list))
|
||||||
curbuf
|
curbuf
|
||||||
got)
|
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))
|
(while (and buffers (not got))
|
||||||
(setq buf (car buffers)
|
(setq buf (car buffers)
|
||||||
buffers (cdr buffers))
|
buffers (cdr buffers))
|
||||||
@ -1404,9 +1399,10 @@ named for funcname or define a function funcname."
|
|||||||
(or (string-match funcname (buffer-name buf))
|
(or (string-match funcname (buffer-name buf))
|
||||||
(string-match (concat "^\\s-*\\(def\\|class\\)\\s-+"
|
(string-match (concat "^\\s-*\\(def\\|class\\)\\s-+"
|
||||||
funcname "\\s-*(")
|
funcname "\\s-*(")
|
||||||
(buffer-substring (point-min buf)
|
(save-excursion
|
||||||
(point-max buf)
|
(set-buffer buf)
|
||||||
buf))))
|
(buffer-substring (point-min)
|
||||||
|
(point-max))))))
|
||||||
(setq got buf)))
|
(setq got buf)))
|
||||||
(setq py-pdbtrack-last-grubbed-buffer got)))
|
(setq py-pdbtrack-last-grubbed-buffer got)))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user