emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: which-function => DEFUN?


From: Juanma Barranquero
Subject: Re: which-function => DEFUN?
Date: Mon, 10 May 2010 19:34:26 +0200

On Mon, May 10, 2010 at 17:42, Stefan Monnier <address@hidden> wrote:

> The rule for where to place a save-match-data is:
>
>  around the code run between "looking-at" and
>  "match-string-no-properties".
>
> In this case (as in 99% of the cases) this code is empty, so the
> save-match-data can be dropped.

The save-match-data is not there to protect the code between
`looking-at' and `match-string-no-properties', because as you point
out, that is an empty set. It is there to protect the caller of
which-func-identify-DEFUN.

> If your save-match-data were needed, which-func-functions should say
> so explicitly.

Yes, I know. As I said, in code for my own use I tend to err on the
side of caution.

    Juanma



reply via email to

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