From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id CGZzD9+652afHwEA62LTzQ:P1 (envelope-from ) for ; Mon, 16 Sep 2024 04:58:07 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id CGZzD9+652afHwEA62LTzQ (envelope-from ) for ; Mon, 16 Sep 2024 06:58:07 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=cas.cat header.s=2023 header.b=cskKSl5F; dmarc=pass (policy=quarantine) header.from=cas.cat; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1726462686; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=yghv4ItWtdPIGwWhLx6eOdnZ7oUXyCP2+igMBadH4aI=; b=XF+jdx0788QeCQSE4Re83KqAmzWVZvlXCGx93upVd6cfAEOsPZ/LLHRw7qNyYQp6HELROd oz5uK5aI+KlZAmYDUw/efwbENrhWQkgaYpCoVhRjbC/mWU1DqVMMs7yG4jF3T/rIeVa7xe PDHStJkDSh0r4czPzcr5XvCdw89677vrOQRwc4xzh6K82ZTpLeTMDykOba7EyFSpKMsXYy jj7yE823/L31r4/yIRmHz4um4yG4TzWaBPp4Xh+aq0cD7ZhzGPjS/uNWIK8LQq79cLUQA9 oPn7R8KIJdLp0Jea7PmoV2t+LjWDN95ISdI/Z5Wn17mme7AP3LST7zFVFjwMRw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1726462686; a=rsa-sha256; cv=none; b=u4ur3iDVqbAr4pywzeGq3kJxrTTIy5xXl+3H34Qf2lZ1DJ8nSpV6bDfZytazD4GN8EPquz PAv3bQITT0cSZK0KfxMh6df+lndiII947UQPiLlr94O/i3VXkrIrJJApIwew4UB2QJ4j6I L+3QW69diSUHSoh78n9ZvoZYBxQUYcj1nd9TnuyDD+G/ahPOxJ0L/KFpUckKRkFxhzo9cg SL9QiYcH2FChLrXbO56BU4P1lT6iklyb/sFol32OwIJl3POE5Dk2Jp7wOd9zqzqf7Pe1py WpUnlL1sOHK9aKo3tOB9bxiI9FubUhgXSkCGndPNTt5M/tyrlK4FvzBFOiCGiA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=cas.cat header.s=2023 header.b=cskKSl5F; dmarc=pass (policy=quarantine) header.from=cas.cat; 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" 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 C29C15C1BE for ; Mon, 16 Sep 2024 06:58:06 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sq3nM-0002a8-BL; Mon, 16 Sep 2024 00:57:04 -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 1sq3nK-0002Zk-Eg for emacs-orgmode@gnu.org; Mon, 16 Sep 2024 00:57:02 -0400 Received: from cas.cat ([45.150.187.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sq3nI-0005Rj-DD for emacs-orgmode@gnu.org; Mon, 16 Sep 2024 00:57:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cas.cat; s=2023; t=1726462615; bh=2A3TlL8t8XflK4ekJqkyStbQhbMH/+ubJXkCvEr0nHY=; h=Date:To:From:Subject:From; b=cskKSl5FlqqpbYWqGyZ3rIq8z1knNHdA7A/BgrQNArqmSZbRh2HuTr/hRrZ2T/Y04 h82fziCncV72/UsUF1HhWUsjiKxzjgHGQEUszdEi/ngMrqLsUm/xqDqM4C7tjwdYMw T2bj5FlFA/k4tepYlH5p6LPtGHYQTXZVgJUTpn3PG68H3wGTCcLfRJt70JMZbZ8yNe oUOpVET7Umt/sDdk4ruP0P2L9YwsBuHi2skgWfYlQkGcgReqQvVdHDln8YSnui+4Ih vMO3NCuxsc0BSAnDp64//gNiEqLIp2DdgrmWRZKhcuoeUIMGL6V5BRlXj3CeJTirPR xjJ0Y7dP1jr/A== Message-ID: Date: Mon, 16 Sep 2024 01:56:50 -0300 MIME-Version: 1.0 Content-Language: en-US To: emacs-orgmode@gnu.org From: pinmacs Subject: [FR] yank media: allow customization of absolute path a filter for type candidates Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=45.150.187.15; envelope-from=pinmacs@cas.cat; helo=cas.cat 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, SPF_HELO_PASS=-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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -5.61 X-Spam-Score: -5.61 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Queue-Id: C29C15C1BE X-TUID: m5ddL89YMFrA Hi, So I was using org-download, and I would like to replace it entirely with yank-media and what I am missisng is: 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]]= 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. What I did to solve the absolute path meanwhile the discussion and development happens is defining on my own the entire function =org--image-yank-media-handler= just changing this: #+begin_src diff -(setq link (org-link-make-string (concat "file:" (file-relative-name absname)))) +(setq link (org-link-make-string (concat "file:" absname))) #+end_src source (sorry, this link is slow to open): https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/org.el?id=cdcde091b9bdc14fc2254b0e594d8e0da6c4e6c6#n20895 and here is the equivalent to the org-download #+begin_src emacs-lisp (defun my/yank-media ()   "org-download replacement"   (interactive)   (let ((org-yank-image-save-method "/tmp/")         (org-yank-dnd-method 'file-link))     (yank-media))     ;; facilitate image size on preview     (save-excursion       (previous-line)       (insert "\n#+attr_org: :width 350px"))) ;; thanks for all the fish, org-download ;; (global-set-key (kbd "C-M-y") 'org-download-clipboard) (global-set-key (kbd "C-M-y") 'my/yank-media) #+end_src Thanks for your attention, pinmacs