[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: yank-media: allow users to limit image types that can be inserted
From: |
Robert Pluim |
Subject: |
Re: yank-media: allow users to limit image types that can be inserted |
Date: |
Tue, 24 Sep 2024 14:18:08 +0200 |
>>>>> On Tue, 24 Sep 2024 14:30:01 +0300, Eli Zaretskii <eliz@gnu.org> said:
>> Date: Mon, 23 Sep 2024 18:08:58 -0300
>> Cc: rpluim@gmail.com, visuweshm@gmail.com, emacs-devel@gnu.org
>> From: pinmacs <pinmacs@cas.cat>
>>
>> Eli, I think we can solve the three situations described with following
>> algorithm/idea/inspiration [1]: through a configurable variable
>> (yank-media-image-types ?). That would allow you to be able to select
>> among all options (that for certain cases could be interesting, say
>> "expert mode", I know what I am doing, verbose mode, etc.), and also, a
>> way to filter out certain candidates based on what you need.
>>
>> Making that variable equal to nil would be as it is now, and configuring
>> it to "image/png", would only select one. I think others were thinking
>> about a regex. As you wish, I only need some sort of filter, and I don't
>> care too much on the detail of how it is configured.
Eli> First, I think a simple defcustom will not be enough, since changing
Eli> the list of handlers must go through yank-media-handler.
Thereʼs no need to change the list of handlers. What the user option
would change is only which type(s) are presented to the user. The
mapping from the selected type to the handler doesnʼt need to be
changed. eg org uses the same handler for all image types.
Eli> More importantly, I still don't understand the rationale and the use
Eli> cases where this could be useful, and adding yet another user option
Eli> without understanding its need and intended usage is not something I'd
Eli> like us to do. Emacs already has way too many user options.
When writing technical documentation, often you want to include
screenshots, eg of a browser window. On my GNU/Linux box, `yank-media'
of such a screenshot offers jpeg, png, or webp as formats and I have
to choose which one I want every time. If I could say "use png if
available" via our proposed user option, that would save me time and
would interrupt my flow less. Or if I was yanking text from a word
processor, I could say "prefer plain text" since I donʼt want to deal
with any potential html markup.
Itʼs analogous to the situation where people send
multipart/alternative emails with both a text/plain and a text/html
part, and the recipient specifies which of those theyʼd prefer to see.
Robert
--
- Re: yank-media: allow users to limit image types that can be inserted, (continued)
- Re: yank-media: allow users to limit image types that can be inserted, Eli Zaretskii, 2024/09/23
- Re: yank-media: allow users to limit image types that can be inserted, Robert Pluim, 2024/09/23
- Re: yank-media: allow users to limit image types that can be inserted, Eli Zaretskii, 2024/09/23
- Re: yank-media: allow users to limit image types that can be inserted, pinmacs, 2024/09/23
- Re: yank-media: allow users to limit image types that can be inserted, Eli Zaretskii, 2024/09/23
- Re: yank-media: allow users to limit image types that can be inserted, pinmacs, 2024/09/23
- Re: yank-media: allow users to limit image types that can be inserted, Robert Pluim, 2024/09/24
- Re: yank-media: allow users to limit image types that can be inserted, Eli Zaretskii, 2024/09/24
- Re: yank-media: allow users to limit image types that can be inserted,
Robert Pluim <=
- Re: yank-media: allow users to limit image types that can be inserted, Eli Zaretskii, 2024/09/24
- Re: yank-media: allow users to limit image types that can be inserted, Visuwesh, 2024/09/24
- Re: yank-media: allow users to limit image types that can be inserted, Eli Zaretskii, 2024/09/24
- Re: yank-media: allow users to limit image types that can be inserted, Pedro, 2024/09/23
- Re: yank-media: allow users to limit image types that can be inserted, Visuwesh, 2024/09/24
- Re: yank-media: allow users to limit image types that can be inserted, Eli Zaretskii, 2024/09/24
- Re: yank-media: allow users to limit image types that can be inserted, Visuwesh, 2024/09/24
- Re: yank-media: allow users to limit image types that can be inserted, Eli Zaretskii, 2024/09/24
- Re: yank-media: allow users to limit image types that can be inserted, Visuwesh, 2024/09/24
- Re: yank-media: allow users to limit image types that can be inserted, Eli Zaretskii, 2024/09/23