[Top][All Lists]

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

Re: tags for functions

From: Lennart Borgman
Subject: Re: tags for functions
Date: Thu, 29 Jan 2009 21:32:59 +0100

On Thu, Jan 29, 2009 at 2:43 AM, Stefan Monnier
<address@hidden> wrote:
>> Juri's solution is slow, as Lennart noted, due to the `documentation'
>> issue you mentioned.  I said I think a defun-after-hook would be the
>> best solution.  Maybe it should be combined with a etc/DOC scan to find
>> all the existing keywords quickly.
> In any case, we don't want to collect/store this info all the time: we
> only want to pay for it when this data is actually used.

Is there really any reason not to just collect it while compiling
(using :keywords)? Beside the human work needed ... ;-)

(let ((n 0))
  (defun my-keyw ()
    (let (keywordlist docstr)
       (lambda (symbol)
         (when (functionp symbol)
           (setq n (1+ n))
           (put symbol 'my-keyw (list 'test 'ing)))))))

  (benchmark 1 '(my-keyw))
  (message "n=%s" n))

This takes 0.2 s for 12000 functions.

reply via email to

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