emacs-diffs
[Top][All Lists]
Advanced

[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: Stefan Monnier
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r112315: New defun movement commands.
Date: Wed, 17 Apr 2013 10:28:11 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> +  (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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]