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 >>> >>> [[https://orgmode.org/resources/img/org-mode-unicorn.svg][description]] >>> >>> I will need to think more how to approach this. >>> >> >> Indeed. > > Another problem with your change is that the order of arguments changed. > If there is some Elisp doing something like > (org-toggle-inline-images INCLUDE-LINKED), your patch will break the > code. > > 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 default, but only interactively. > I don't think so, the patch main purpose is for improve image refreshing after babel result image displaying. Because the function is hooked by other ob-* packages. Another purpose is headline level images displaying. So modifying this function is the only way. > As for displaying linked images, what about something like > > > C-1 C-c C-x C-v being equivalent of > C-c C-x C-v + INCLUDE-LINKED=t > (display in current section/region, with linked) > > and > > C-11 C-c C-x C-v being equivalent of > C-u C-u C-c C-x C-v + INCLUDE-LINKED=t > (display in the whole buffer, with linked) > Don't know, I have not use it this way. I think INCLUDE-LINKED is just a option argument for function org-display-inline-images. No need to be available for toggle in interactive command. An option like org-inline-images-include-linked is enough. >> +(defun org-toggle-inline-images (&optional arg include-linked beg end) >> + "Toggle the display of inline images at point. >> +INCLUDE-LINKED is passed to `org-display-inline-images'. >> + >> +If cursor is on an inline image link, display the inline image. >> +If there is none, remove it otherwise. > > I do not quite understand what the last line is trying to say. Emmm, I forget the meaning of it. I read the docstring again, seems it can be deleted. I will delete it in my patch. -- [ stardiviner ] I try to make every word tell the meaning that I want to express without misunderstanding. Blog: https://stardiviner.github.io/ IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3