Re: [PATCH] org.el: inline display of attached images in link descriptions

2023-06-02 Thread Steven Allen

You're right and now I have no idea what I was testing. I'm
apologize for that.

The attached patch should actually work this time. It's not great (setq
in a let), but anything else would likely be a much larger change.

>From 6ca24ca705fc3856c68957cfa50dfce77c9148c9 Mon Sep 17 00:00:00 2001
From: Steven Allen 
Date: Thu, 1 Jun 2023 11:49:19 -0700
Subject: [PATCH] org.el: inline display of attached images in link
 descriptions

* lisp/org.el (org-display-inline-images): inline display of attached
images in link descriptions.

Previously, `org-display-inline-images' only inlined images in link
descriptions when they were explicit "file:" links. This change adds
support for "attachment:" links. E.g.:

[[https://orgmode.org][attachment:emacs-screenshot.png]]
---
 lisp/org.el | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 0e5740412..405cae9a5 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16301,7 +16301,8 @@ defun org-create-formula-image
 
   2. Its description consists in a single link of the previous
  type.  In this case, that link must be a well-formed plain
- or angle link, i.e., it must have an explicit \"file\" type.
+ or angle link, i.e., it must have an explicit \"file\" or
+ \"attachment\" type.
 
 Equip each image with the key-map `image-map'.
 
@@ -16332,7 +16333,7 @@ defun org-create-formula-image
 	   ;; "file:" links.  Also check link abbreviations since
 	   ;; some might expand to "file" links.
 	   (file-types-re
-		(format "\\[\\[\\(?:file%s:\\|attachment:\\|[./~]\\)\\|\\]\\[\\(

Re: [PATCH] org.el: inline display of attached images in link descriptions

2023-06-02 Thread Ihor Radchenko
Steven Allen  writes:

> * lisp/org.el (org-display-inline-images): inline display of attached
> images in link descriptions.
>
> Previously, `org-display-inline-images' only inlined images in link
> descriptions when they were explicit "file:" links. This change adds
> support for "attachment:" links. E.g.:
>
> [[https://orgmode.org][attachment:emacs-screenshot.png]]

Thanks for the patch, but it does not actually make Org display the
example link from the commit message.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



[PATCH] org.el: inline display of attached images in link descriptions

2023-06-01 Thread Steven Allen
* lisp/org.el (org-display-inline-images): inline display of attached
images in link descriptions.

Previously, `org-display-inline-images' only inlined images in link
descriptions when they were explicit "file:" links. This change adds
support for "attachment:" links. E.g.:

[[https://orgmode.org][attachment:emacs-screenshot.png]]
---
 lisp/org.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 0e5740412..3e1b757c4 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -16301,7 +16301,8 @@ defun org-create-formula-image
 
   2. Its description consists in a single link of the previous
  type.  In this case, that link must be a well-formed plain
- or angle link, i.e., it must have an explicit \"file\" type.
+ or angle link, i.e., it must have an explicit \"file\" or
+ \"attachment\" type.
 
 Equip each image with the key-map `image-map'.
 
@@ -16332,7 +16333,7 @@ defun org-create-formula-image
   ;; "file:" links.  Also check link abbreviations since
   ;; some might expand to "file" links.
   (file-types-re
-   (format 
"\\[\\[\\(?:file%s:\\|attachment:\\|[./~]\\)\\|\\]\\[\\(