[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] /srv/bzr/emacs/trunk r112315: New defun movement comma
From: |
fgallina |
Subject: |
Re: [Emacs-diffs] /srv/bzr/emacs/trunk r112315: New defun movement commands. |
Date: |
Thu, 18 Apr 2013 16:07:36 -0300 |
User-agent: |
mu4e 0.9.9.5; emacs 24.3.1 |
Stefan Monnier <address@hidden> writes:
>> + (let* ((newpos
>> + (and (funcall fn)
>> + (save-match-data
>> + (and
>> + (not (python-syntax-context-type))
>> + (point-marker)))))
>> + (current-match-data (match-data)))
>> + (cond ((or (and (not pos) newpos)
>> + (and pos newpos (funcall poscompfn newpos pos)))
>> + (set-match-data current-match-data)
>> + (point-marker))
>> + ((and (not pos) (not newpos)) nil)
>> + (t (python-nav--syntactically
>> + fn poscompfn (point-marker))))))
>
> match-data, set-match-data, and save-match-data are somewhat expensive
> operations, so I suggest you rethink their use here. Especially since
> AFAIK the only existing uses of python-nav--syntactically don't care
> about the match-data.
>
>
> Stefan
I changed this in revno 112319. I had in mind the possibility of doing
movement while keeping the match data, in order to use this in the new
imenu implementation I am about to push. But after some tought I rather
grab the current defun in another way (with looking-at).
Regards,
Fabián.