[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r111281: * progmodes/python.el
Fabián Ezequiel Gallina
Re: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r111281: * progmodes/python.el (python-info-current-defun): Fix failed
Wed, 20 Feb 2013 02:24:31 -0300
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130109 Thunderbird/17.0.2
On 02/19/2013 06:37 PM, Stefan Monnier wrote:
+ ;; FIXME: avoid cluttering match-data
+ ;; where's not wanted.
(if (>= (current-indentation) min-indent)
I suspect this is not The Right Place for the save-match-data, since we
should not assume that current-indentation won't also mess up the
FWIW this very small change corrected the python-info-current-defun
behavior and was able to pass the test suite I've been working on. So
far my local test/automated/python-tests.el is covering indentation,
movement and python-info-* functions completely. Would it be OK to
introduce these tests into the emacs-24 branch?
Now, I certainly wasn't expecting current-indentation could change
match-data (could it?). If so, I feel that functions not expected to
mess with match-data should at least document it.
In this regard, I have a change in the works that will cause python.el
to stop messing with match-data so much (use of looking-at-p instead of
looking-at and such), and document those functions that are intended to.
If everyone agrees I could get this to the emacs-24 branch.
 By "functions not expected to mess with match-data" I mean
functions that are not receiving a regexp as argument.