[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: which-function => DEFUN?
From: |
Stefan Monnier |
Subject: |
Re: which-function => DEFUN? |
Date: |
Mon, 10 May 2010 13:34:29 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
>> 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.
>>
>>> (add-hook 'which-func-functions 'which-func-identify-DEFUN nil t)
>>
>> If your save-match-data were needed, which-func-functions should say
>> so explicitly.
> Yes, but what is the rule for WHEN to use save-match-data. I just
> looked in the elisp manual and could not find anything.
The "where":
around the code run between "looking-at" and
"match-string-no-properties".
also tells you "when": just look at the code around which to place
save-match-data and if it's clear that the save-match-data is not needed
(as in your case), then don't bother putting it there.
Stefan
- which-function => DEFUN?, Lennart Borgman, 2010/05/10
- Re: which-function => DEFUN?, Stefan Monnier, 2010/05/10
- Re: which-function => DEFUN?, Juanma Barranquero, 2010/05/10
- Global match data considered harmful, Stephen J. Turnbull, 2010/05/10
- Re: Global match data considered harmful, Stefan Monnier, 2010/05/11
- Re: Global match data considered harmful, Stephen J. Turnbull, 2010/05/11
- Re: Global match data considered harmful, tomas, 2010/05/12