From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id MEnFEZvvI2XYbwAAG6o9tA:P1 (envelope-from ) for ; Mon, 09 Oct 2023 14:18:35 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id MEnFEZvvI2XYbwAAG6o9tA (envelope-from ) for ; Mon, 09 Oct 2023 14:18:35 +0200 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 062D45EAE4 for ; Mon, 9 Oct 2023 14:18:35 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="VMuLLc/f"; dmarc=pass (policy=none) header.from=gmail.com; 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=1696853915; 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=elL4wk9a9Dir32zEmR6IxMFvEI9O48FhbCeOKtrO+h4=; b=iHjWLeLJpn5Fprpp0i4WhiYtXNVXeHUt3sPOjTwt969pVnGiNt4ttj948gXxrDzD9CVI/8 SCbmrVhUXz1kGvEPVaX62T5LShluAg+nN9EzTp86ri42V55QShg+uMOGe/KC9Z3DtUvOpt 4/hW4ImOgZRU/f0ONDh9ib1UrT81xtaxJgbt98oTvUqQ2Q+x3n5ByBV4AlcLCq5KcyhMwd EWZgX1B1ZuutTAL2JLPPDZ2W/E750ZyZXFLVocXRMzFQ/Kvf6fLq5uKP3arjHGY+8m86eD f72pCEtsWXG4k/3kWgVq5pGsYkU3C8D9fepQx48INzFdc8/tbiAOugvKjZ2nAA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b="VMuLLc/f"; dmarc=pass (policy=none) header.from=gmail.com; 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-Seal: i=1; s=key1; d=yhetil.org; t=1696853915; a=rsa-sha256; cv=none; b=MGnAUFl7RpMGXWD+SOWOtHjv/AY82PCr2sQuNuKGstu8UtvTH11nFkHlJTNi4zN66j5U6e iO7O+6UKrUNJWtWkx7ugEfQEVGLTZCJ43Q08kabbE9aaUiTxfVf3aC/FO0K4hzQ+J0CKDj +4ltKsRDNqUtzrCeRnDb0s/A9jQgG0Z7Nen6jG37+6udBT04Dw/B4XsNVMKcEDb/TvYIKx DLzeZEJxxk69smamvJydubikNtwyxIqbHpIoORhDt10imZ8hLqyy32sEsCF/LA+W+kCE1c jL96nXbePDi1SGXnnBifGxjQISFRBUAZp9k1dHBI6sIAYhJNONSmZcX76GTyqg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qppCe-0001u3-NY; Mon, 09 Oct 2023 08:17:40 -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 1qppCc-0001tf-My for emacs-orgmode@gnu.org; Mon, 09 Oct 2023 08:17:38 -0400 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qppCb-0001YD-6s for emacs-orgmode@gnu.org; Mon, 09 Oct 2023 08:17:38 -0400 Received: by mail-pf1-x443.google.com with SMTP id d2e1a72fcca58-692779f583fso2941358b3a.0 for ; Mon, 09 Oct 2023 05:17:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696853855; x=1697458655; 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=elL4wk9a9Dir32zEmR6IxMFvEI9O48FhbCeOKtrO+h4=; b=VMuLLc/flzWcWIlmc+Yee3Yxg1msJjbmdSP14W1ilm8KSkxoyEfvsAMkCtVNXOVPzz wSrKZEnS8OviDGya4l08DD6PKdZUKJahUGvQzuF9zBFII5jcoZ3XqNUSfnuuhONkAqc0 4V+NZyF+0WuRu54MWP958Rq+53Ls1iJhmr7b7LdTwLP5EJX7+9bhRrktaa+iEdPwD1BG Xs/xDRj6XzIQbtTvaF4nQxoUs2PVQCbtd4NhCI+pZXLlCKw1GF9SORti3fj304iQx4vp ih1Lgl8IXbrJekvWqwBwnj8u/r/261MbLhVfQLGZFTVf4Z34DwOxXggHRgaHcvU0hSOu 604Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696853855; x=1697458655; 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=elL4wk9a9Dir32zEmR6IxMFvEI9O48FhbCeOKtrO+h4=; b=gp4FgBgcEom38d/GD020nsfJXP8xTerYm2nrtEVnydmnjCIm3kKDlZn/BQJzXoonK3 3u7mgwkVLeqD6UC3vjNbEslYPfgO4HirlhOdqynh8ll8IVeM4+yWis0H8GmOok2ZXNTk fvteXnSFQhea0dmDEJm+n0EAZJRJWwgwQFKHb2iFju6EZFOydRfxuRnxT3tPLsUL5nt2 rAwvWQiJDoGUUXB/Y+SbMyV/6idRD3Mm1Xc8D+w7bg4mj7cm3xIYzB1qc6v//oLVTxwY oU/hODtfVgshk53o/uzvY12Hpz++OZQjGlBy4mLtMUOEriSBL7RSz0d1JrnpjJBj1byQ D5Rw== X-Gm-Message-State: AOJu0YzYI6eOoWGcW0wvsixUHtcsVdPt4lUdZg5ValMNK45m77B4s+IV +Y115IEzqcdEH2eMxVFEOQk= X-Google-Smtp-Source: AGHT+IEK7jr6j+VxI0yzJEQd03KR52g4eEBTDvrTX4j1fsU3YQoQltbvchepUbwBMOoNT7raadTlXQ== X-Received: by 2002:a05:6a20:1608:b0:14b:887a:6d70 with SMTP id l8-20020a056a20160800b0014b887a6d70mr15879708pzj.15.1696853855436; Mon, 09 Oct 2023 05:17:35 -0700 (PDT) Received: from localhost ([118.185.152.162]) by smtp.gmail.com with ESMTPSA id q25-20020a62e119000000b0069370f32688sm6265801pfh.194.2023.10.09.05.17.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 05:17:34 -0700 (PDT) From: Visuwesh To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] [PATCH] Add yank-media and DND handler [9.6.7 (9.6.7-g6eb773 @ /home/viz/lib/emacs/straight/build/org/)] In-Reply-To: <87edi4m4my.fsf@localhost> (Ihor Radchenko's message of "Mon, 09 Oct 2023 11:12:05 +0000") References: <87jzsintv0.fsf@gmail.com> <87lecx2nff.fsf@localhost> <87bkdsomm2.fsf@gmail.com> <87a5tamm3j.fsf@gmail.com> <877cnyzlda.fsf@localhost> <87a5sur51r.fsf@gmail.com> <875y3ir0lu.fsf@gmail.com> <87ttr1pild.fsf@localhost> <87v8bhpdg8.fsf@gmail.com> <87edi4m4my.fsf@localhost> Date: Mon, 09 Oct 2023 17:47:31 +0530 Message-ID: <87edi4dm78.fsf@gmail.com> 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::443; envelope-from=visuweshm@gmail.com; helo=mail-pf1-x443.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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 062D45EAE4 X-Spam-Score: -6.77 X-Migadu-Spam-Score: -6.77 X-Migadu-Scanner: mx1.migadu.com X-TUID: OJH0ssYYtuYL [=E0=AE=A4=E0=AE=BF=E0=AE=99=E0=AF=8D=E0=AE=95=E0=AE=B3=E0=AF=8D =E0=AE=85= =E0=AE=95=E0=AF=8D=E0=AE=9F=E0=AF=8B=E0=AE=AA=E0=AE=B0=E0=AF=8D 09, 2023] I= hor Radchenko wrote: > Thanks! > >> +(defun org--dnd-attach-file (url action) >> ... >> + (insert >> + (org-link-make-string >> + (concat (if separatep >> + "file:" >> + "attachment:") >> + (if separatep >> + (expand-file-name (file-name-nondirectory filename) >> + org-yank-image-save-type) >> + (file-name-nondirectory filename)))) >> + "\n") >> + 'private)) > >> + (pcase org--dnd-xds-method >> + (`attach (insert (org-link-make-string >> + (concat "attachment:" (file-name-nondirectory f= ilename))) > >> + (`file-link (insert (org-link-make-string (concat "file:" filenam= e)) >> + "\n")) > > Is there any particular reason why you insert a newline after the image > link? It is for when you drop multiple files onto a frame. AFAIU/AFAICT there's no way to know beforehand if multiple files will be dropped or not. I will look into it in bit more detail in the coming days and drop the newline if only one file is dropped. > Also, we might want to add a subsection describing the new customization = to > 17 Miscellaneous section of the manual. Otherwise, users might have > difficulties discovering relevant settings to customize dnd and yank > behavior. OK, I will do so.