Re: [PATCH v3.1] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer

2023-08-04 Thread Ihor Radchenko
"Christopher M. Miles" writes: >> I think that instead of changing the existing function, we can convert >> your patch into a new function `org-toggle-inline-images-command' that >> will be free to alter the argument order. We can then re-bind that >> function in org-keys to make it used by

Re: [PATCH v3.1] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer

2023-08-04 Thread Christopher M. Miles
Ihor Radchenko writes: > "Christopher M. Miles" writes: > >>> With your patch, it will become impossible to display linked images >>> using interactive command. >> >> Does this code match the needs? > > Please check my latest reply >

Re: [PATCH v3.1] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer

2023-08-04 Thread Christopher M. Miles
Ihor Radchenko writes: > "Christopher M. Miles" writes: > >>> The problem here is backwards compatibility. `org-toggle-inline-images' >>> is bound to C-c C-x C-v and people may be used to C-u C-c C-x C-v >>> displaying linked images like >>> >>>

Re: [PATCH v3.1] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer

2023-08-02 Thread Ihor Radchenko
"Christopher M. Miles" writes: >> With your patch, it will become impossible to display linked images >> using interactive command. > > Does this code match the needs? Please check my latest reply (https://list.orgmode.org/87o7jpoqfl.fsf@localhost/T/#m25fbb254635512a7bf86d368bf93a24a1c2fb3f1).

Re: [PATCH v3.1] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer

2023-08-02 Thread Christopher M. Miles
Ihor Radchenko writes: > "Christopher M. Miles" writes: > >> I think current patch is ready for merging now. WDYT? > > No, unfortunately. > With your patch, it will become impossible to display linked images > using interactive command. Does this code match the needs? #+begin_src emacs-lisp

Re: [PATCH v3.1] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer

2023-08-02 Thread Christopher M. Miles
Ihor Radchenko writes: > "Christopher M. Miles" writes: > >> I think current patch is ready for merging now. WDYT? > > No, unfortunately. > With your patch, it will become impossible to display linked images > using interactive command. I still need time to study how to add support for this.

Re: [PATCH v3.1] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer

2023-08-02 Thread Ihor Radchenko
"Christopher M. Miles" writes: >> The problem here is backwards compatibility. `org-toggle-inline-images' >> is bound to C-c C-x C-v and people may be used to C-u C-c C-x C-v >> displaying linked images like >> >> [[https://orgmode.org/resources/img/org-mode-unicorn.svg][description]] >> >> I

Re: [PATCH v3.1] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer

2023-08-01 Thread Ihor Radchenko
"Christopher M. Miles" writes: > I think current patch is ready for merging now. WDYT? No, unfortunately. With your patch, it will become impossible to display linked images using interactive command. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at

[PATCH v3.1] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer

2023-08-01 Thread Christopher M. Miles
Ihor Radchenko writes: > "Christopher M. Miles" writes: > >>> This is not a toggle. This is unconditional refresh. >>> >> Yes, indeed it's a unconditional refresh. It does not match the meaning of >> word "toggle". >> >> Seems need to detect whether has image overlays in region. I added this

Re: [PATCH v3] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer

2023-08-01 Thread Ihor Radchenko
"Christopher M. Miles" writes: >> This is not a toggle. This is unconditional refresh. >> > Yes, indeed it's a unconditional refresh. It does not match the meaning of > word "toggle". > > Seems need to detect whether has image overlays in region. I added this > detection in new patch. Like

[PATCH v3] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer

2023-08-01 Thread Christopher M. Miles
Ihor Radchenko writes: > "Christopher M. Miles" writes: > >>> Unlike `org-latex-preview', here we need to (1) respect active region; >>> (2) keep the backward compatibility for INCLUDE-LINKED. >>> >>> For (1), for example, it would make sense to respect region when prefix >>> argument is C-u

Re: [PATCH v2] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer

2023-07-24 Thread Ihor Radchenko
"Christopher M. Miles" writes: >> Unlike `org-latex-preview', here we need to (1) respect active region; >> (2) keep the backward compatibility for INCLUDE-LINKED. >> >> For (1), for example, it would make sense to respect region when prefix >> argument is C-u and clear images only there. For

Re: [PATCH v2] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer

2023-05-16 Thread Christopher M. Miles
Ihor Radchenko writes: > "Christopher M. Miles" writes: > >>> I'd prefer something more closely resembling `org-latex-preview' >>> approach with prefix arguments: >>> ... >>> `org-toggle-inline-images' should also be changed. >> >> Here is the source code of `org-toggle-inline-images'. I

Re: [PATCH v2] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer

2023-05-16 Thread Ihor Radchenko
"Christopher M. Miles" writes: >> I'd prefer something more closely resembling `org-latex-preview' >> approach with prefix arguments: >> ... >> `org-toggle-inline-images' should also be changed. > > Here is the source code of `org-toggle-inline-images'. I implement this > by reference

Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer

2023-05-15 Thread Christopher M. Miles
Ihor Radchenko writes: > "Christopher M. Miles" 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

[PATCH v2] Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer

2023-05-15 Thread Christopher M. Miles
Ihor Radchenko writes: > "Christopher M. Miles" 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

Re: [PATCH] add a function to only refresh inline images under current headline instead of global buffer

2023-05-15 Thread Ihor Radchenko
"Christopher M. Miles" 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

[PATCH] add a function to only refresh inline images under current headline instead of global buffer

2023-05-14 Thread Christopher M. Miles
I found a lot of third-part Emacs packages refresh Org source block image result using the API function like this: #+begin_src emacs-lisp ;; Automatically refresh inline images. (add-hook 'org-babel-after-execute-hook (defun ob-dall-e--refresh-inline-images () (when