From: stardiviner <numbchild@gmail.com>
To: Karthik Chikmagalur <karthikchikmagalur@gmail.com>
Cc: "Ihor Radchenko" <yantar92@posteo.net>,
"Björn Bidar" <bjorn.bidar@thaodan.de>,
emacs-orgmode@gnu.org
Subject: Re: Link preview generation with new link preview property
Date: Wed, 18 Dec 2024 14:21:58 +0800 [thread overview]
Message-ID: <CAL1eYu+kOTBuDJYB-Q0jVtuB05gz9hZoWzcH2kDbaHTR3zhRCQ@mail.gmail.com> (raw)
In-Reply-To: <87ldwfnff4.fsf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1643 bytes --]
I don't think so, my package org-link-beautify ported to the new
:preview mechanism. The file preview not always image. Could be text, or
icon etc. So pass in image object is not a good idea. It will limit
preview functionality extensibility.
[stardiviner] <Hack this world!> GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter: @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/
On Tue, Dec 17, 2024 at 11:43 AM Karthik Chikmagalur <
karthikchikmagalur@gmail.com> wrote:
> >> Would it be possible to also handle image data in the function or
> >> refactor the org-link-preview-file function in a way that the geometry
> >> handling is done in a helper function which can be reused by other
> >> handlers.
> >
> > There is such function: `org-display-inline-image--width'.
> > We may consider exposing it as public function.
>
> This will not be enough, we will also have to expose `org-image--align'
> and the alignment code:
>
> (when align
> (overlay-put
> ov 'before-string
> (propertize
> " " 'face 'default
> 'display
> (pcase align
> ("center" `(space :align-to (- center (0.5 . ,image))))
> ("right" `(space :align-to (- right ,image)))))))
>
> I don't think we can expect third party packages to figure out and
> reimplement Org's image alignment logic.
>
> Considering this, it might be better to just split
> `org-link-preview-file' into two public functions, where the "inside"
> function accepts an image instead of a file.
>
> Karthik
>
>
[-- Attachment #2: Type: text/html, Size: 2425 bytes --]
next prev parent reply other threads:[~2024-12-18 6:23 UTC|newest]
Thread overview: 17+ 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-18 6:21 ` stardiviner [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAL1eYu+kOTBuDJYB-Q0jVtuB05gz9hZoWzcH2kDbaHTR3zhRCQ@mail.gmail.com \
--to=numbchild@gmail.com \
--cc=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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.