emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Björn Bidar" <bjorn.bidar@thaodan.de>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: Karthik Chikmagalur <karthikchikmagalur@gmail.com>,
	emacs-orgmode@gnu.org
Subject: Re: Link preview generation with new link preview property
Date: Sat, 18 Jan 2025 16:44:23 +0200	[thread overview]
Message-ID: <87ldv8chbs.fsf@> (raw)
In-Reply-To: <877c7afz2y.fsf@localhost> (Ihor Radchenko's message of "Sat, 04 Jan 2025 14:11:49 +0000")

Ihor Radchenko <yantar92@posteo.net> writes:

> Björn Bidar <bjorn.bidar@thaodan.de> writes:
>
>>> Both alignment and width are derived from LINK AST node.
>>> I am not sure what is the problem.
>>> AFAIU, Karthik is simply asking why you decided to calculate alignment
>>> from LINK, but not width.
>>
>> My question was because the width is set through the width of the inline
>> image, i.e. the image-data passed through the preview function.
>> Is there no difference if function using org-link-review-image-data has
>> not set the width of the image and then we set the with of the overlay instead?
>
> You are probably confused by `org--create-inline-image'?

Possibly but I simply was confused by some of the properties of the
overlay being set and some of them being taken from the image object. 

> IMHO, it would be best to pass image file name/raw image data to
> `org-link-preview-image-data', not an image object and call
> `org--create-inline-image' from inside `org-link-preview-image-data'.
> That way, we can automatically obey Org customization wrt image
> alignment, image width, and image max width.

For that case using org-link-preview-file should be sufficient? 

>>> If we think about the API function to be more useful, we can derive
>>> alignment and width from LINK itself by default, but also provide
>>> optional parameters, so that the caller can override the values
>>> manually. If both alignment and width parameters are explicitly
>>> specified, LINK does not have to be provided.
>>
>> How would that work? Make link align and with optional and fail if
>> align or with are missing without link?
>
> Yes.


  reply	other threads:[~2025-01-18 14:45 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <6755f138.0c0a0220.40388.51fbSMTPIN_ADDED_BROKEN@mx.google.com>
2024-12-13  5:49 ` Link preview generation with new link preview property Karthik Chikmagalur
2024-12-14  0:03   ` Björn Bidar
2024-12-14  7:04     ` Ihor Radchenko
2024-12-17  2:46       ` Björn Bidar
2024-12-17 17:39         ` Ihor Radchenko
2024-12-19 21:55           ` Björn Bidar
2024-12-21 12:03             ` Ihor Radchenko
2024-12-17  3:42       ` Karthik Chikmagalur
2024-12-17 17:40         ` Ihor Radchenko
2024-12-19 23:20           ` Björn Bidar
2024-12-20  0:45           ` Karthik Chikmagalur
2024-12-21 12:05             ` Ihor Radchenko
2024-12-23 20:41               ` Björn Bidar
     [not found]           ` <6764aa79.050a0220.23273b.09a5SMTPIN_ADDED_BROKEN@mx.google.com>
2024-12-26 18:46             ` Karthik Chikmagalur
2024-12-29 15:44               ` Björn Bidar
2024-12-30 17:05                 ` Ihor Radchenko
2025-01-04  2:01                   ` Björn Bidar
2025-01-04 14:11                     ` Ihor Radchenko
2025-01-18 14:44                       ` Björn Bidar [this message]
2025-01-18 15:03                         ` Ihor Radchenko
2024-12-18  6:21         ` stardiviner
2024-12-18  6:33           ` Karthik Chikmagalur
2024-12-19 23:26             ` Björn Bidar
2024-12-21 12:09               ` Ihor Radchenko
2024-12-08 19:18 Björn Bidar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ldv8chbs.fsf@ \
    --to=bjorn.bidar@thaodan.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=karthikchikmagalur@gmail.com \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).