emacs-devel
[Top][All Lists]
Advanced

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

Re: Add user customization fido-completion-styles


From: João Távora
Subject: Re: Add user customization fido-completion-styles
Date: Tue, 02 Jun 2020 19:24:45 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.91 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: João Távora <joaotavora@gmail.com>
>> Date: Tue, 02 Jun 2020 18:51:31 +0100
>> Cc: emacs-devel@gnu.org
>> 
>>        - icomplete-post-command-hook                             2032  86%
>>         - icomplete-exhibit                                      2032  86%
>>          - icomplete-completions                                 2009  85%
>>           - icomplete--sorted-completions                        1986  84%
>>            - completion-all-sorted-completions                   1986  84%
>>             - completion-all-completions                         1982  84%
>>              - completion--nth-completion                        1982  84%
>>               - completion--some                                 1982  84%
>>                - #<compiled 0x15809f8924ad>                      1982  84%
>>                 - completion-flex-all-completions                1965  84%
>>                  - completion-substring--all-completions         1935  82%
>>                   - completion-pcm--all-completions              1932  82%
>>                    - all-completions                             1929  82%
>>                     - #<compiled 0x1fe57a0ac19d>                 1929  82%
>>                      - complete-with-action                      1929  82%
>>                       - all-completions                            37   1%
>
> This actually says that the time sink is complete-with-action, not
> all-completions.
>
>> As you know, all-completions is a C function.  The 1% is suspicious, I
>> don't know if I should trust it.
>
> You should trust the profile.  It works the same whether it's a C
> function or a Lisp function.

OK that's good to know, but then, I don't know where the time is going:
Shouldn't I be seeing some callee of this function using up the time??

This is complete-with-action minus docstring, can you help me understand
what's going on?

(defun complete-with-action (action collection string predicate)
  (cond
   ((functionp collection) (funcall collection string predicate action))
   ((eq (car-safe action) 'boundaries) nil)
   ((eq action 'metadata) nil)
   (t
    (funcall
     (cond
      ((null action) 'try-completion)
      ((eq action t) 'all-completions)
      (t 'test-completion))
     string collection predicate))))

João




reply via email to

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