[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org c90f96c 77/85: org: Support displaying X% width ima
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org c90f96c 77/85: org: Support displaying X% width images |
Date: |
Mon, 27 Sep 2021 15:57:55 -0400 (EDT) |
branch: externals/org
commit c90f96c00de99a4ab399d3308d096c834d9879ec
Author: TEC <tec@tecosaur.com>
Commit: TEC <tec@tecosaur.com>
org: Support displaying X% width images
* lisp/org.el (org-display-inline-image--width): Instead of interpreting
an image :width of X% as X pixels, take it as X% of the text width of
the buffer.
---
lisp/org.el | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index 8e4826a..6add6e4 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16642,7 +16642,8 @@ buffer boundaries with possible narrowing."
- When `org-image-actual-width' is t, the image's pixel width is used.
- When `org-image-actual-width' is a number, that value will is used.
- When `org-image-actual-width' is nil or a list, the first :width attribute
- set (if it exists) is used to set the image width.
+ set (if it exists) is used to set the image width. A width of X% is
+ divided by 100.
If no :width attribute is given and `org-image-actual-width' is a list with
a number as the car, then that number is used as the default value.
If the value is a float between 0 and 2, it interpreted as that proportion
@@ -16662,7 +16663,11 @@ buffer boundaries with possible narrowing."
(re-search-forward attr-re par-end t)))
(match-string 1)))
(attr-width-val
- (when attr-width (string-to-number attr-width)))
+ (cond
+ ((null attr-width) nil)
+ ((string-match-p "\\`[0-9.]+%" attr-width)
+ (/ (string-to-number attr-width) 100.0))
+ (t (string-to-number attr-width))))
;; Fallback to `org-image-actual-width' if no explicit width is
given.
(width (or attr-width-val (car org-image-actual-width))))
(if (and (floatp width) (<= 0.0 width 2.0))
- [elpa] externals/org 2aa2615 59/85: Document new agenda faces in the ORG-NEWS, (continued)
- [elpa] externals/org 2aa2615 59/85: Document new agenda faces in the ORG-NEWS, ELPA Syncer, 2021/09/27
- [elpa] externals/org b80b0a5 51/85: org-clock.el: Make org-notify support macOS notification, ELPA Syncer, 2021/09/27
- [elpa] externals/org 78783f4 48/85: ob-core.el: Add ability to use closures as default header arguments, ELPA Syncer, 2021/09/27
- [elpa] externals/org b2da9ea 64/85: Backport commit 0da8118dc from Emacs, ELPA Syncer, 2021/09/27
- [elpa] externals/org 7d67719 68/85: org-manual: comment about latex code-block export, ELPA Syncer, 2021/09/27
- [elpa] externals/org 80798fc 72/85: oc.el (org-cite-register-processor): Silence a compiler warning, ELPA Syncer, 2021/09/27
- [elpa] externals/org 593740c 74/85: etc/ORG-NEWS: Mention the citation engine and reorder items, ELPA Syncer, 2021/09/27
- [elpa] externals/org c76a7ee 76/85: org: Refactor width in `org-display-inline-images', ELPA Syncer, 2021/09/27
- [elpa] externals/org e816ae1 75/85: org: Display proportional image widths, ELPA Syncer, 2021/09/27
- [elpa] externals/org 981bcbf 80/85: Merge branch 'bugfix', ELPA Syncer, 2021/09/27
- [elpa] externals/org c90f96c 77/85: org: Support displaying X% width images,
ELPA Syncer <=
- [elpa] externals/org 4594423 79/85: doc/org-manual.org: Fix typo, ELPA Syncer, 2021/09/27
- [elpa] externals/org 09dc3fa 83/85: org-protocol.el: decode "+" in query part as space, ELPA Syncer, 2021/09/27
- [elpa] externals/org 663255e 85/85: org: Remove obsolete default LaTeX packages, ELPA Syncer, 2021/09/27
- [elpa] externals/org 3d35718 44/85: Merge branch 'bugfix', ELPA Syncer, 2021/09/27
- [elpa] externals/org 69850c1 58/85: ob-core.el (org-babel--file-desc): Remove unused condition, ELPA Syncer, 2021/09/27
- [elpa] externals/org ee0fd1e 37/85: Revert "org-src.el (org-src--contents-for-write-back): Do not indent blank lines", ELPA Syncer, 2021/09/27
- [elpa] externals/org 70e65a2 38/85: org-src.el: Do not indent blank lines, except current one, ELPA Syncer, 2021/09/27
- [elpa] externals/org fb75741 09/85: lisp/ob-gnuplot.el: Add Ihor Radchenko as maintainer, ELPA Syncer, 2021/09/27
- [elpa] externals/org e64d5bc 17/85: Merge branch 'bugfix', ELPA Syncer, 2021/09/27
- [elpa] externals/org 9364b2d 35/85: lisp/ox-html.el: Restore org-svg class., ELPA Syncer, 2021/09/27