Re: [PATCH] Justify/align image previews in org-mode

2023-12-25 Thread Bastien Guerry
Ihor Radchenko writes: >> From eb1b287c009c2f7eb83e7e31d64980ba79f44527 Mon Sep 17 00:00:00 2001 >> From: Karthik Chikmagalur >> Date: Mon, 18 Dec 2023 12:56:33 -0800 >> Subject: [PATCH] org: Add image alignment > > Bastien, may you please confirm that Karthik's FSF assignment is in > order?

Re: [PATCH] Justify/align image previews in org-mode

2023-12-21 Thread Ihor Radchenko
Karthik Chikmagalur writes: > Patch v2 attached. > > Karthik > From 7176f43282749c06daf2756360633cc47d79b63c Mon Sep 17 00:00:00 2001 > From: Karthik Chikmagalur > Date: Mon, 18 Dec 2023 12:56:33 -0800 > Subject: [PATCH] org: Add image alignment Thanks! Applied, onto main, after resolving

Re: [PATCH] Justify/align image previews in org-mode

2023-12-19 Thread Karthik Chikmagalur
>> I've incorporated the following suggestions: >> >> - Order of precedence: >> + #+attr_org overrides #+attr_html and #+attr_latex >> + `:center t' overrides `:align ...' > > Why only html and latex? I think that it will be more consistent to > follow what we do in

Re: [PATCH] Justify/align image previews in org-mode

2023-12-19 Thread Ihor Radchenko
Karthik Chikmagalur writes: > From eb1b287c009c2f7eb83e7e31d64980ba79f44527 Mon Sep 17 00:00:00 2001 > From: Karthik Chikmagalur > Date: Mon, 18 Dec 2023 12:56:33 -0800 > Subject: [PATCH] org: Add image alignment Bastien, may you please confirm that Karthik's FSF assignment is in order? --

Re: [PATCH] Justify/align image previews in org-mode

2023-12-19 Thread Ihor Radchenko
Karthik Chikmagalur writes: > I've incorporated the following suggestions: > > - Order of precedence: > + #+attr_org overrides #+attr_html and #+attr_latex > + `:center t' overrides `:align ...' Why only html and latex? I think that it will be more consistent to follow what we do in

Re: [PATCH] Justify/align image previews in org-mode

2023-12-18 Thread Karthik Chikmagalur
I've incorporated the following suggestions: - Order of precedence: + #+attr_org overrides #+attr_html and #+attr_latex + `:center t' overrides `:align ...' - Update doc/org-manual.org under the images section. - Add a checker for `:align nil' to org-lint. `:align nil' is not supported.

Re: [PATCH] Justify/align image previews in org-mode

2023-12-18 Thread Karthik Chikmagalur
> I can only suggest something like > > (equal (org-element-begin link) > (save-excursion > (goto-char (org-element-contents-begin paragraph)) > (skip-chars-forward "\t ") > (point))) > > (equal (org-element-end link) > (save-excursion > (goto-char (org-element-contents-end paragraph)) >

Re: [PATCH] Justify/align image previews in org-mode

2023-12-18 Thread Ihor Radchenko
Karthik Chikmagalur writes: >> This will not work when the image paragraph is indented: > > * This is test > #+attr_org: :align center > [[file:~/Downloads/wallpaper.png]] > > - Is there a better way to address this than checking if there is only > whitespace behind the link until the start

Re: [PATCH] Justify/align image previews in org-mode

2023-12-18 Thread Karthik Chikmagalur
> It would make sense to allow 'left value as well (same as nil). Done. > I do not think that we need to consider 'justify value at this point. > Maybe in future, when (or if) we add proper justification support to > text. But not now. Removed support for 'justify. > This will not work when

Re: [PATCH] Justify/align image previews in org-mode

2023-12-18 Thread Ihor Radchenko
Karthik Chikmagalur writes: > Please ignore the previous patch and use this one instead. I've fixed a > bug and a couple of formatting errors. Thanks for the patch! See my comments inline. > +(defcustom org-image-align nil > + "How to align images previewed using `org-display-inline-images'.

Re: [PATCH] Justify/align image previews in org-mode

2023-12-18 Thread Karthik Chikmagalur
Please ignore the previous patch and use this one instead. I've fixed a bug and a couple of formatting errors. Karthik diff --git a/lisp/org.el b/lisp/org.el index 30a4e7aef..ad2ad2332 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -15673,6 +15673,25 @@ cache Display remote images, and open

[PATCH] Justify/align image previews in org-mode

2023-12-17 Thread Karthik Chikmagalur
Hi, This patch allows image link previews in Org to be left-aligned, centered or right-aligned in the Emacs window. "Inline" images that are surrounded by text are unaffected. Here is an example of what this looks like: Image: https://abode.karthinks.com/share/org-image-align.png The