org-image-max-width: Allow floating point value as fraction of window width

* lisp/org.el (org--create-inline-image): Allow `org-image-max-width'
to be a floating point value - fraction of window width.
(org-image-max-width): Update the docstring and type specification.
This commit is contained in:
Ihor Radchenko 2023-06-02 14:55:36 +03:00
parent 1cb5de6211
commit 07521331c3
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 5 additions and 2 deletions

View File

@ -15136,7 +15136,8 @@ t or when #+ATTR* is set to t.
Possible values:
- `fill-column' :: limit width to `fill-column'
- `window' :: limit width to window width
- number :: limit width to number in pixels
- integer :: limit width to number in pixels
- float :: limit width to that fraction of window width
- nil :: do not limit image width"
:group 'org-appearance
:package-version '(Org . "9.7")
@ -15144,7 +15145,8 @@ Possible values:
(const :tag "Do not limit image width" nil)
(const :tag "Limit to `fill-column'" fill-column)
(const :tag "Limit to window width" window)
(integer :tag "Limit to a number of pixels")))
(integer :tag "Limit to a number of pixels")
(float :tag "Limit to a fraction of window width")))
(defcustom org-agenda-inhibit-startup nil
"Inhibit startup when preparing agenda buffers.
@ -16285,6 +16287,7 @@ according to the value of `org-display-remote-inline-images'."
(`fill-column (* fill-column (frame-char-width (selected-frame))))
(`window (window-width nil t))
((pred integerp) org-image-max-width)
((pred floatp) (floor (* org-image-max-width (window-width nil t))))
(`nil nil)
(_ (error "Unsupported value of `org-image-max-width': %S"
org-image-max-width)))