emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Fix regex for determining image width from attribute
@ 2021-11-21 19:08 Matt Huszagh
  2021-11-21 19:20 ` Timothy
  0 siblings, 1 reply; 32+ messages in thread
From: Matt Huszagh @ 2021-11-21 19:08 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 259 bytes --]

Hi,

A recent patch started computing the inline image width from any attr_
line. This is incorrect, as it matches settings like attr_latex, or
attr_html. We only want to look for settings specifically for the org
buffer. This patch fixes that.

Thanks
Matt


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-org.el-Fix-regex-for-determining-image-width-fr.patch --]
[-- Type: text/x-patch, Size: 1121 bytes --]

From b9b8fb9b31dbb9145c2fe73af04eccd59f7a9973 Mon Sep 17 00:00:00 2001
From: Matt Huszagh <huszaghmatt@gmail.com>
Date: Sun, 21 Nov 2021 11:02:37 -0800
Subject: [PATCH] lisp/org.el: Fix regex for determining image width from
 attribute

	* lisp/org.el (org-display-inline-image--width): The regex
	should only match attr_org, not any attr_.  This would match
	attributes set for all export backends, such as latex and
	HTML, which is incorrect.
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index eeefb4af3..92e765373 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16853,7 +16853,7 @@ buffer boundaries with possible narrowing."
    ((listp org-image-actual-width)
     (let* ((case-fold-search t)
            (par (org-element-lineage link '(paragraph)))
-           (attr-re "^[ \t]*#\\+attr_.*?: +.*?:width +\\(\\S-+\\)")
+           (attr-re "^[ \t]*#\\+attr_org: +.*?:width +\\(\\S-+\\)")
            (par-end (org-element-property :post-affiliated par))
            ;; Try to find an attribute providing a :width.
            (attr-width
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2024-05-13 12:42 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-21 19:08 [PATCH] Fix regex for determining image width from attribute Matt Huszagh
2021-11-21 19:20 ` Timothy
2021-11-21 19:51   ` Matt Huszagh
2021-11-22  8:29     ` Timothy
2021-11-22 16:11       ` Matt Huszagh
2021-11-22 17:54         ` Timothy
2021-11-22 20:53           ` Matt Huszagh
2021-11-23  4:59             ` Kyle Meyer
2021-11-23  5:14             ` Timothy
2021-11-23  5:38               ` Matt Huszagh
2021-11-23  5:39                 ` Timothy
2021-11-23  7:46                   ` Matt Huszagh
2021-11-23 16:44                     ` Max Nikulin
2021-11-24  1:57                       ` Matt Huszagh
2021-11-24 14:48                         ` Max Nikulin
2021-11-24 15:59                           ` Matt Huszagh
2021-11-24 17:00                             ` Max Nikulin
2021-11-25 16:43                               ` Max Nikulin
2021-11-29  0:23                                 ` Matt Huszagh
2021-11-29  5:13                                   ` Timothy
2021-12-01  3:24                                     ` Matt Huszagh
2021-12-01  4:54                                       ` Timothy
2021-12-03  2:06                                         ` Matt Huszagh
2024-05-02 16:28                                           ` Ihor Radchenko
2024-05-07  4:59                                             ` Karthik Chikmagalur
2024-05-08 10:36                                             ` Max Nikulin
2024-05-08 10:54                                               ` Ihor Radchenko
2024-05-09 10:47                                                 ` Max Nikulin
2024-05-13 12:42                                                   ` Ihor Radchenko
2024-05-13 12:42                                               ` Ihor Radchenko
2021-11-29 12:15                                   ` Max Nikulin
2021-11-22 14:30     ` Max Nikulin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).