emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [PATCH] add a function to only refresh inline images under current h


From: Ihor Radchenko
Subject: Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer
Date: Mon, 15 May 2023 11:08:29 +0000

"Christopher M. Miles" <numbchild@gmail.com> writes:

> The `org-redisplay-inline-images' will refresh whole buffer inline
> images. When the buffer is a big Org file, and not all inline images are
> display already by default (still image file links under fold status).
> Invoking `org-redisplay-inline-images' will cause Emacs suspend a long
> time.
>
> So I suggest to add an variant local function of
> `org-redisplay-inline-images' which named
> `org-redisplay-inline-images-under-headline' that only redisplay inline
> images under current headline to solve the issue.
>
> Here is the diff code prototype, Ihor, can you review it? If it's ok, I
> will send patch update then.

I'd prefer something more closely resembling `org-latex-preview'
approach with prefix arguments:

    Toggle preview of the LaTeX fragment at point.
    
    If the cursor is on a LaTeX fragment, create the image and
    overlay it over the source code, if there is none.  Remove it
    otherwise.  If there is no fragment at point, display images for
    all fragments in the current section.  With an active region,
    display images for all fragments in the region.
    
    With a C-u prefix argument ARG, clear images for all fragments
    in the current section.
    
    With a C-u C-u prefix argument ARG, display image for all
    fragments in the buffer.
    
    With a C-u C-u C-u prefix argument ARG, clear image for all
    fragments in the buffer.

`org-toggle-inline-images' should also be changed.

-- 
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>



reply via email to

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