From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Visuwesh Newsgroups: gmane.emacs.devel Subject: Re: yank-media: allow users to limit image types that can be inserted Date: Tue, 24 Sep 2024 18:20:21 +0530 Message-ID: <875xqlw702.fsf@gmail.com> References: <79fc91f3-c2c3-44db-9817-595808917f26@cas.cat> <86ed5ahb08.fsf@gnu.org> <87zfnywki8.fsf@gmail.com> <86setqfnmq.fsf@gnu.org> <87frpqflv4.fsf@gmail.com> <86ikumfjri.fsf@gnu.org> <877cb2fj0c.fsf@gmail.com> <86cykufhw7.fsf@gnu.org> <3a015d0f-549a-401f-be1c-651c9dbd5d9a@cas.cat> <8634lqfcaf.fsf@gnu.org> <87ikulwsd6.fsf@gmail.com> <86o74ddzxp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25019"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: pinmacs@cas.cat, rpluim@gmail.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 24 14:51:05 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1st50T-0006Lq-I9 for ged-emacs-devel@m.gmane-mx.org; Tue, 24 Sep 2024 14:51:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st500-00028o-CT; Tue, 24 Sep 2024 08:50:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1st4zw-00028W-2I for emacs-devel@gnu.org; Tue, 24 Sep 2024 08:50:32 -0400 Original-Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1st4zt-0006yy-8Z; Tue, 24 Sep 2024 08:50:30 -0400 Original-Received: by mail-pl1-x641.google.com with SMTP id d9443c01a7336-206aee40676so44196505ad.0; Tue, 24 Sep 2024 05:50:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727182227; x=1727787027; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/kDISyea+Ne6JCae8M7HuAWH70eEcbJ5JCHZYSZY1is=; b=VFFgaT6KqxGic5zm6hsoTY6NC22ycM4OKz0oZ6fkxJPv92CxJ/KyGW/rYYZ7zMjQ8L 56W8Y/sbLXrCEgsbmMfttcZZfFJgxrhJpfSCqG2FYjbo7fKcZ7SijNfx4cSgZBTbLjuL kF6YC6Rgz5xA4O7zIVw1rf4pfv/aJCbrydzqjdWzmqE0+JxyRqdgLyKyWzkVcPXCg8Be dFwpCsTRXDvMcSwmeEgMCvdvbbiaIkLCNDXn5l6GmrgFHBpgRdeS/5MQtIESHA3A5ysz q2kx10q9W2cQMOA+OtDw2cA7p0OVfHh3bnV602qyX1f5JYzODzJTmFyvDGEUS0Oh3t2x XWOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727182227; x=1727787027; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=/kDISyea+Ne6JCae8M7HuAWH70eEcbJ5JCHZYSZY1is=; b=sO8AD5vrBXZSb6V7v+P5yjuSvzxCneMqeO03JOS3cFPkCyppIg5DDfwpLOEgY3k/09 twMvzMrztqHT0veSWQTciyBjHuYqwqdeubDhzhwos6cwyjjlTzBVdziqF/RwFGltWfQd tndP8z27nLhgOhfU7KS5EThLb5uCVI44HIQD/XiypfkCUuWgN53pUG1wpS9Ccy/5THhZ ol5REEiDuzvs4AB5UVGh4vOP8IzFlsWwxdEBbXmqF+rNLfzk1C7iqFarVZWFljINZ8R+ sdHKfGX8FJcNnd+CZs66Qac2Dl6okJmQngsnxDT2xjtwmDG9Z90l3tyg+R8cYNsQbPVW 9xGg== X-Forwarded-Encrypted: i=1; AJvYcCUCwvyIM0TYj/VrY/z088LREPHoW4C0nZI8CcGsjPuvtY1YxrBaFSEf+gL1JsHmkhxVBQSZFkHRykyl9Q==@gnu.org X-Gm-Message-State: AOJu0Yxftwa9y63YEgTI33Ge37MlLxnUPMBYpsjIBbE6m7COmzg89sOv coQXy0Uqw97Bxs/eOQLDgEz76F1jBg/MLXUSFgv3DlosQW05t1mIVQrt3EMx X-Google-Smtp-Source: AGHT+IFpv8ykiJEA4DE949powcbuBzDPwnzSBOPsqNLZU2ULe9inSyM5w7LKIV9qBO4UcR5BwnZNVA== X-Received: by 2002:a17:903:11d1:b0:205:88bf:bfe9 with SMTP id d9443c01a7336-208d836cfd9mr181182815ad.15.1727182226996; Tue, 24 Sep 2024 05:50:26 -0700 (PDT) Original-Received: from localhost ([1.7.159.70]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20af183c2c4sm9840035ad.240.2024.09.24.05.50.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 05:50:26 -0700 (PDT) In-Reply-To: <86o74ddzxp.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 24 Sep 2024 15:00:18 +0300") Received-SPF: pass client-ip=2607:f8b0:4864:20::641; envelope-from=visuweshm@gmail.com; helo=mail-pl1-x641.google.com X-Spam_score_int: 22 X-Spam_score: 2.2 X-Spam_bar: ++ X-Spam_report: (2.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:324028 Archived-At: [=E0=AE=9A=E0=AF=86=E0=AE=B5=E0=AF=8D=E0=AE=B5=E0=AE=BE=E0=AE=AF=E0=AF=8D = =E0=AE=9A=E0=AF=86=E0=AE=AA=E0=AF=8D=E0=AE=9F=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0= =AE=B0=E0=AF=8D 24, 2024] Eli Zaretskii wrote: >> From: Visuwesh >> Cc: pinmacs , rpluim@gmail.com, emacs-devel@gnu.org >> Date: Tue, 24 Sep 2024 10:38:53 +0530 >>=20 >> > What I still do not understand is what would be the reason for the >> > user to prefer JPEG over PNG. More generally, if Emacs can support N >> > formats out of those available in the clipboard, why would the user >> > want to be shown only 1 < M < N out of them? >>=20 >> [ The more I think about this, the more I believe the choice of >> "preferred formats" will change depending on the scenario where >> yank-media is used. In Org, I could see "don't bother asking me, just >> use PNG if available" could be useful. But somewhere in HTML mode, >> "always ask me" could be the right choice. ] > > Which is why I suggested two separate commands: one where the user > says he/she wants the most appropriate type, the other to allow > selection. We could make C-u choose the other "mode of operating" since it is currently free. Whether we default to asking, or choose the appropriate one can be decided later on. >> > Bottom line: I'm okay with offering two yank-media alternatives: >> > >> > (1) via a command that selects a single most appropriate format based >> > on some (yet to be defined) algorithm; and >>=20 >> What about a user option yank-media-preferred-mimetypes which is a list >> of mimetypes that the user would like to always opt for, given the >> choice? > > That was proposed earlier in this thread, and I responded: I'm not > sure I understand when and why would this option be needed _as_ a user > option. I hope Robert shed some light in the other thread on this. I haven't encountered many "multiple types available" scenario outside of Firefox and LibreOffice. In most cases, yank-media just does the thing without interrupting me but when the uncommon case of "multiple types available" crops up, I would like yank-media to choose the type I want automatically for me. In Org, I personally would make yank-media choose image/png. If you ask me for technical reasons to prefer image/png specifically, I cannot give you a concrete answer. It might as well be image/jpeg for all I care. I simply do not want to be asked a question when I'm focusing on writing. The point of the user option is to keep user interaction to a minimum. >> > (2) via showing the list of all the formats that the running Emacs >> > supports and asking the user to choose one. >>=20 >> This is what we already have so nothing to be changed. > > Right.