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 SH/rELoB8GaiuwAAqHPOHw:P1 (envelope-from ) for ; Sun, 22 Sep 2024 11:38:34 +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 SH/rELoB8GaiuwAAqHPOHw (envelope-from ) for ; Sun, 22 Sep 2024 13:38:34 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=WZdPsW32; 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=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1727005114; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Q6QaSK/67+IFzg32LgvId8jrHjNL+UvNd0A+JVxAzcM=; b=ejU22FFCeQXNM4oKpN8scmkgBz97en72rDjGIltRFcg9pPlY8jSv1/3Rwjg7YLy16ed2jG +mCTSP1Fk+XvruTzonPF4d1/pTwEODAkqKNnn9xcCubuE6cS6/INCAnb+Uzqj7x403XvCM UaprENpoVhFhKx4jclgXBsRQNoEbzlrN58lEO+96YDzDvKoVIHc4MOFfS4VpkTmYG4qme9 y3S1pOUrvXf0G0VqebNvkQ43nq/BTog0r5HW7CXsUzAfmJkcDOXg7QzRikUWmo9lfEEYij z42z6dJP5BaAEOlgnOF+rISTscrDeQ9dqxkV9aCuQntq8EaPLgmWqzequ86Emg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=WZdPsW32; 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=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1727005114; a=rsa-sha256; cv=none; b=GkPTDpQQ8SmUtcyvyde3v75aSHn236pbwxCQBttxfYGhK75jNRrlQFa3el90m1ILvLuXMD dk71NzRoHdKZM2jAvlogIrGWOIJ1/aB1m7ffg4TPcBZsg8rnXpo51LY2v9mvDVecLeBjt4 4J5uah6aXKo0iK+iPaUidjF+Ughz7UrVAaU69dLj0OHFh7heV6VyjZDlVoX1cNBvSH13L2 lNgJlcYgicBR9Iq/DBK1m/7YNFzfbgFAAcRjczrPvSTlDkySsiosfMBne1UY3M4yzwujqV x4ZjBHZzDn/uy9Yu9j1Ez+F6EyyZOXCFpzjPrE22jKHC28uc6G2GRcQJYskrEA== 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 26DBD37EA for ; Sun, 22 Sep 2024 13:38:34 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssKu9-0000YX-MK; Sun, 22 Sep 2024 07:37:29 -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 1ssKu7-0000YN-Gt for emacs-orgmode@gnu.org; Sun, 22 Sep 2024 07:37:27 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ssKu5-00086n-2X for emacs-orgmode@gnu.org; Sun, 22 Sep 2024 07:37:27 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 2FC44240101 for ; Sun, 22 Sep 2024 13:37:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1727005042; bh=mxltiehj7h2HLtKgd6FnN5pvn0Is3/lIz32eYcP1y1s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=WZdPsW32377mRJNShAw9AhIAWoABOKD63AyvZQwYjAHt+Ova0HqEZQM/pa00torGN 8GOIZQQ6mwUisRRcu/pM+dNWRN4cDPiwdOz7ekICbo/CJW7q9WVCvUPh4uN8EVURZB r0jxSG4l9BR8QWhngqg/Rx+jw72YHUEnQ05tfQZ1RWiPq4Zuz4Yd5cKp0qFPtjJh68 Y1uGYks5CDr0QQKs0+OtBRTQ2PtrTxRtnlCswdwpZcgzbscSBqMw4U9oL9Eu9kwwiL jliY2BSr+b4TbYTlz0Gm0Djwxmvktso3rxt/knhvjFTOreNwGoxeNoRUW0hqWQiiz2 8g60u6tmuY3WQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4XBPHN6lFbz6tw3; Sun, 22 Sep 2024 13:37:20 +0200 (CEST) From: Ihor Radchenko To: Visuwesh Cc: pinmacs , emacs-orgmode@gnu.org Subject: Re: [FR] yank media: allow customization of absolute path a filter for type candidates In-Reply-To: <87msk7wmlj.fsf@gmail.com> References: <87msk7wmlj.fsf@gmail.com> Date: Sun, 22 Sep 2024 11:38:57 +0000 Message-ID: <87ikunrk8e.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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.31 X-Spam-Score: -5.31 X-Migadu-Queue-Id: 26DBD37EA X-Migadu-Scanner: mx10.migadu.com X-TUID: DGrlVl/FP272 Visuwesh 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 . Support Org development at , or support my work at