emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Visuwesh <visuweshm@gmail.com>
Cc: pinmacs <pinmacs@cas.cat>, emacs-orgmode@gnu.org
Subject: Re: [FR] yank media: allow customization of absolute path a filter for type candidates
Date: Sun, 22 Sep 2024 11:38:57 +0000	[thread overview]
Message-ID: <87ikunrk8e.fsf@localhost> (raw)
In-Reply-To: <87msk7wmlj.fsf@gmail.com>


Visuwesh <visuweshm@gmail.com> writes:
>> 1. do a variable for selecting absolute path: to be able to have a file 
>> link that works with absolute path; and the reason is that being 
>> relative, this, does not combine good when you move your latex export 
>> somewhere else (in my case, I usually move it to /tmp/, and from there I 
>> decide when I want to save something persistently), hence it fails, and 
>> I got tired on fixing the links, in fact, the absolute path sometimes is 
>> smaller than the relative one 
>> =file:/tmp/clipboard-20240916T013308.png]]= vs 
>> =[[file:../../../tmp/clipboard-20240916T011913.png]]=
>
> This can be done in the org side.  I guess adding another defcustom
> would be the way to go? I don't see how it is possible to make
> org-yank-image-save-method accept another option.

We can re-use `org-link-file-path-type'.
Probably, simply by factoring out the cond from `org-insert-link' and
then reusing it in yank handler.

>> 2. do a variable that allow a list that would filter and reduce the type 
>> candidates of yank-media. In org-download, everything was png so I was 
>> not having the "Several types available, choose one" with 7 options. But 
>> then is like, oh, maybe I would like to be able to switch between png 
>> (synthetic image), jpg (natural image)... anyway, I hope you see 
>> customizing this is interesting for the users.
>
> This needs to be done in the Emacs side.  The querying is done in
> yank-media and nothing much can be done from org-mode.

That's one option - we can ask Emacs devs to provide a customization for
`yank-media' to auto-select specific type once it is available.

Another possibility is making "image/.*" customizable in
(yank-media-handler "image/.*" #'org--image-yank-media-handler)

Then, users may limit image types that can be inserted into Org by
setting that regexp to something like "image/png".

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


  reply	other threads:[~2024-09-22 11:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-16  4:56 [FR] yank media: allow customization of absolute path a filter for type candidates pinmacs
2024-09-16 17:10 ` Visuwesh
2024-09-22 11:38   ` Ihor Radchenko [this message]
2024-09-22 13:01     ` Visuwesh
2024-09-22 17:04       ` Pedro

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=87ikunrk8e.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=pinmacs@cas.cat \
    --cc=visuweshm@gmail.com \
    /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).