Subject: Re: bug#57813: Icon images are non-functional

From: Juri Linkov <[email-masked]>
Date: Thu, 15 Sep 2022 22:46:56 +0300

>>   With something like:
>>
>>   (setq outline-minor-mode-use-buttons '(derived-mode . special-mode))
>
> I still cannot reproduce this, after evaluating the above and visiting
> NEWS.  Neither do I see buttons in NEWS.  What else is needed?  Can
> you show a recipe starting from "emacs -Q"?

1. Eval: (setq outline-minor-mode-use-buttons '(derived-mode . special-mode))
2. Type 'C-h n'.
3. 'S-TAB' on a heading.

> And if you load outline.el (not .elc or .eln)?  How does the profile
> before optimization look then?

        5236  87% - command-execute
        5178  86%  - funcall-interactively
        5166  86%   - outline-cycle-buffer
        5166  86%    - let
        5166  86%     - outline--fix-up-all-buttons
        5166  86%      - if
        5166  86%       - progn
        5166  86%        - outline-map-region
        5166  86%         - save-excursion
        5166  86%          - if
        5166  86%           - progn
        5162  86%            - while
        5150  86%             - funcall
        5150  86%              - #<lambda 0x1c5f63c054af8dba>
        5150  86%               - if
        5142  86%                - eq
        5142  86%                 - condition-case
        5142  86%                  - progn
        5142  86%                   - outline--cycle-state
        5138  86%                    - save-excursion
        5138  86%                     - let
        3718  62%                      + outline-back-to-heading
         824  13%                      + outline-end-of-subtree
         314   5%                      + cond
         274   4%                      + setq
           8   0%                      + outline-end-of-heading

The patch removes the problematic outline-back-to-heading and
outline-end-of-subtree.