|
From: | stardiviner |
Subject: | Re: [PATCH v4.0] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer |
Date: | Wed, 14 Aug 2024 10:04:52 +0800 |
"Christopher M. Miles" <numbchild@gmail.com> writes:
>> What about the following treatment of ARG:
>>
>> 1. No argument, no region selected :: toggle (display or hide dwim) images in current section
>> 2. No argument, region selected: toggle images in region
>> 3. C-u argument :: toggle images in the whole buffer
>> 4. C-u C-u argument, no region selected :: unconditionally hide images in the buffer
>> 5. M-1 argument, no region selected :: display images in current section with INCLUDE-LINKED
>> 6. M-1 argument, region selected :: ... in region ...
>> 7. M-11 argument :: ... in the whole buffer ...
>> 8. Any other argument :: treat as INCLUDE-LINKED = t
>>
>> And please document all the new arguments in the manual and etc/ORG-NEWS file.
>
> I followed you upper 8 conditions to re-write my patch.
> Except the 8. condition I'm not sure I understand correctly.
> And I extend 1. condition to support the inline image link at point toggle displaying.
> ...
I do not like the code repetitions in the patch and relying upon
`use-region-p' even for non-interactive use.
I am attaching a complete rewrite of your idea.
Please let me know if my patch does everything you want to include into
the command.
Note that I went with a new idea of introducing a branch new function
instead of changing `org-toggle-inline-images'. This way, existing
users of `org-toggle-inline-images' will not be affected at all. We are
just changing the default C-c C-x C-v binding. This way, the breakage
is a little as possible.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
[Prev in Thread] | Current Thread | [Next in Thread] |