From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id kLnAMYgV8Gb5LQEAqHPOHw:P1 (envelope-from ) for ; Sun, 22 Sep 2024 13:03:05 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id kLnAMYgV8Gb5LQEAqHPOHw (envelope-from ) for ; Sun, 22 Sep 2024 15:03:04 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=EakzZv23; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1727010184; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=kdVd35tG9KUKKwuu+RKJfcwyGwlFWC3KlgqqGr77mlY=; b=HCyQ+LqETFVt1HqNEH3NR9BodERA6ReNkGg6vx7kzZgdiqAN34X3vtjPF22VR/1jMBEL2G 3e+T1MAfEutx4leVvMJiT5cyVatVzOPKmKW0KmaoHqMWhHvU0e3GyYXV+mGBQNQnnwzsiD PXH7UvI3O96hi5lypqi1aD4vDou7IFvxnAUxJ6FFpD1YRkPCOakBdlAhr5ipi4a9mbIM0W VuVBB1zitzDBEyS+8MxrXyUCnG2mCotuum9bC2AIFIK81iF9pMUqNgKO0Ix51q4j0pbMWD l36jUpAzCcf03/OB9xX8WiGpaM26Wyi0A1S0EmtvmciQx7tsPA+E6XVbh/0lmg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=EakzZv23; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1727010184; a=rsa-sha256; cv=none; b=LKUO4umWJq4yNlIsaeKB4rB5i17mrqVdBsX1SfcBZeZW/rsq3zzGfvfnHh9eJOMFH5Vu61 YVJL0AFWEEWTrbXqHr7AeJB03KZ1ELzqnuzSjjQZgF3iqmnPi+xe/WMKZyQD1n6/P78XEk ydqpC70CansO8OMj6HxO9Tl0f0JXRi05XfSxcqED1byvd/3JCksX+5q+eU5DgZofYlkZvH AFoI61pAxhijdQMT7dHc9iCOeIDCBZng27+qAUi8OVHISADUlFgsq426p7mkYuww/Qkef1 uIgRDXSxym54VIY25a6mX6DC95yWN7Ogar1lvpQzW+sRaLiQNh3y5pwGDON85Q== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 91F3A8629 for ; Sun, 22 Sep 2024 15:03:04 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssMEH-0006Oe-Uy; Sun, 22 Sep 2024 09:02:21 -0400 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 1ssMEF-0006O9-Eo for emacs-orgmode@gnu.org; Sun, 22 Sep 2024 09:02:19 -0400 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssMED-000153-7E for emacs-orgmode@gnu.org; Sun, 22 Sep 2024 09:02:18 -0400 Received: by mail-pl1-x644.google.com with SMTP id d9443c01a7336-2054feabfc3so31253065ad.1 for ; Sun, 22 Sep 2024 06:02:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727010136; x=1727614936; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:references :message-id:date:in-reply-to:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=kdVd35tG9KUKKwuu+RKJfcwyGwlFWC3KlgqqGr77mlY=; b=EakzZv23BXQhxQ1cznUmWb2/9xuRshGWTvUt5UtKi2qZ/bMq4LU7GMZcezKQCaL67q tSysC2XwvVNFmyyAY8//i5yB7AUlcBY3LVw1Z+ilL/Z3LOd4XjV30pgT7IPnHMxw0H5p aA0VNjd6rzmE5D5oNeD6udUwJJ7t45oFy28CZLXWI073kO+xdXvLFR+FZW8Ol4xKvTAI YG0YIYY1HjeSNwrV/fuafjLNnbxA+EQzQbaHCQjD8St+97PFlEUoAepT8r6qKuj6f+oE gKvHLGuFVBwcijIcFpEuRkFC8k8oCWMQZkt/ko7t43Ro6YzXEvTFLeiGXqpWZw8kUgS7 QLFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727010136; x=1727614936; h=content-transfer-encoding:mime-version:user-agent:references :message-id:date:in-reply-to:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=kdVd35tG9KUKKwuu+RKJfcwyGwlFWC3KlgqqGr77mlY=; b=a6SwaMvH2EdrbXgddHXxJjCvslq5ju7z0VZ25lQ0mwd48ice4Uhm2C26qnP7yyswSf OyhQVhR87cMr8yqOCJHOQcgMvYue0Zm7fIcOIAt23H06XW4Wx5nui2Llclozhp6eGnit jk5QaTpud9Q6AKXtQ7G7sOXUAvWxFacKGu1mVWbi24foKRj7KyZTM7yl5Hq0gdmRv3BX rYHNh/JN5qb6LSzlLrtRF1qzQ6Ka3M8CKz9mbFBoSG0P0S01GRDinnfV7pq38N0ciT0Z FdQj2VCaePuXkZCeauz1/P6O1Za+BqTAdoGzO9SiAxeiXMJcatxYFmshhRQcpm0mClSP iYkw== X-Forwarded-Encrypted: i=1; AJvYcCUGZlBaMF0F4cb1biP61lNBBZQ/l1hOTY0+VPrSUAqP5JpV4V4ciGTQEc2kn3HjXoscqclG6Uhja4CoIYyW@gnu.org X-Gm-Message-State: AOJu0YwNGfZgaWsMFpN/eXubCzcvx73mhSyyPdKkIiAsFa+GUZVP+6yL Dya06x/1alm+gWvXeTjk9W/cD25VA73R8mrIXEhyVekWSaBxnKfV04YirFSM X-Google-Smtp-Source: AGHT+IGpsCbhqVIj2FSMNIZcoagnx27jk4bw8yqc98Clu2qpLX9f0naOQCHBv6QaCYnvScMXkej7TA== X-Received: by 2002:a17:902:e74f:b0:206:b960:2e97 with SMTP id d9443c01a7336-208d986a61emr135132925ad.45.1727010135586; Sun, 22 Sep 2024 06:02:15 -0700 (PDT) Received: from localhost ([1.7.159.70]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20794735863sm119348725ad.274.2024.09.22.06.02.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Sep 2024 06:02:15 -0700 (PDT) From: Visuwesh To: Ihor Radchenko Cc: pinmacs , emacs-orgmode@gnu.org Subject: Re: [FR] yank media: allow customization of absolute path a filter for type candidates In-Reply-To: <87ikunrk8e.fsf@localhost> (Ihor Radchenko's message of "Sun, 22 Sep 2024 11:38:57 +0000") Date: Sun, 22 Sep 2024 18:31:34 +0530 Message-ID: <87r09betap.fsf@gmail.com> References: <87msk7wmlj.fsf@gmail.com> <87ikunrk8e.fsf@localhost> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::644; envelope-from=visuweshm@gmail.com; helo=mail-pl1-x644.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -5.61 X-Spam-Score: -5.61 X-Migadu-Queue-Id: 91F3A8629 X-Migadu-Scanner: mx10.migadu.com X-TUID: iUCgyAZmnin1 [=E0=AE=9E=E0=AE=BE=E0=AE=AF=E0=AE=BF=E0=AE=B1=E0=AF=81 =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 22= , 2024] Ihor Radchenko wrote: > Visuwesh writes: >>> 1. do a variable for selecting absolute path: to be able to have a file= =20 >>> link that works with absolute path; and the reason is that being=20 >>> relative, this, does not combine good when you move your latex export=20 >>> somewhere else (in my case, I usually move it to /tmp/, and from there = I=20 >>> decide when I want to save something persistently), hence it fails, and= =20 >>> I got tired on fixing the links, in fact, the absolute path sometimes i= s=20 >>> smaller than the relative one=20 >>> =3Dfile:/tmp/clipboard-20240916T013308.png]]=3D vs=20 >>> =3D[[file:../../../tmp/clipboard-20240916T011913.png]]=3D >> >> 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. I think this will indeed be the best. We can reuse this everywhere we insert the link in yank-media+DND code (which IIRC uses the same function at the very end). >>> 2. do a variable that allow a list that would filter and reduce the typ= e=20 >>> candidates of yank-media. In org-download, everything was png so I was= =20 >>> not having the "Several types available, choose one" with 7 options. Bu= t=20 >>> then is like, oh, maybe I would like to be able to switch between png=20 >>> (synthetic image), jpg (natural image)... anyway, I hope you see=20 >>> 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". I am leaning towards doing it in the Emacs side since it would get rid of similar annoyance(s) in other yank-media handlers, not just Org. If no one beats me to it before the end of this week, I will propose a patch to take care of (1). It would be preferable pinmacs if can take care of (2) if we decide to take care of it from the Emacs side since I will probably not be able to describe the situation well.