emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [PATCH] New: auto display inline images under subtree when `org-cycl


From: Ihor Radchenko
Subject: Re: [PATCH] New: auto display inline images under subtree when `org-cycle'.
Date: Mon, 12 Sep 2022 18:51:55 +0800

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

> Ihor Radchenko <yantar92@gmail.com> writes:
>
>> "Christopher M. Miles" <numbchild@gmail.com> writes:
>>
>>>> When I put it on beginning of org document, then preview inline images, 
>>>> but those global attributes
>>>> not affected. The inline images still display in actual image size. I want 
>>>> to specify image size
>>>> under headline properties. Is it possible to do this?
>>>
>>> I implemented this feature by written a hook. Hope this can be helpful
>>> for someone who also has this needs. Here is the code:
>>
>> This looks useful.
>> Would you be interested to write a patch?
>
> The is the new patch which updated the defcustom variable docstring has 
> correct description.

Thanks for the patch!
Before extending org-cycle functionality, let's first try to sort out
subtree-level setting of the image size.

In the patch, you are suggesting to use INLINE-IMAGE-WIDTH property.
However, if we apply the patch as is, this property will only be useful
when calling a single function -
`org-display-subtree-with-inline-images'.
It is not ideal.

If we introduce subtree-level setting for inline image size, it should
also work when displaying inline images by other existing means
(org-toggle-inline-images).

Instead of working around the existing code of
`org-display-inline-images' and setting a custom
`org-image-actual-width' variable in buffer, it is much better to change
`org-display-inline-images' directly. At the end, the patch is not bound
to your personal config - feel free to alter the existing Org functions.

Similarly, you do not need to do
(add-to-list 'org-default-properties "INLINE-IMAGE-WIDTH")
Simply change the default value of `org-default-properties'.

Finally, it will be more consistent to name the property closer to the
variable name: ORG-IMAGE-ACTUAL-WIDTH.

-- 
Ihor Radchenko,
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]