From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id wEqmEiHcMGVdWwAA9RJhRA:P1 (envelope-from ) for ; Thu, 19 Oct 2023 09:34:57 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id wEqmEiHcMGVdWwAA9RJhRA (envelope-from ) for ; Thu, 19 Oct 2023 09:34:57 +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 037B154413 for ; Thu, 19 Oct 2023 09:34:57 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=bTZpdVEI; 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=1697700897; 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=elxIhvG6y1bGCC76fC3acyeJ5ALOgRo7AAoqw8R3aQs=; b=ZfpGtHnYW0yE4vJulMS3jv5xeJ2kQi6UkNX4XAoBcb3n+rIhwwlOfn70QOFNnJMNKwavgQ ESfLoy9U1wvpY2Fnce4aqCdbAnWXQALb7emDN9lOeRNNkJOnapaI5Xdx9gvqezl03Y+drb wmuzU88twCnwH0xTypaF35AfJQjvgswkKmITW6n/N9CLmIQ4hVS5spysFp1V61KBrldSA8 Q9NURTthBWhV7N/ZonPrrxEDtYkE2v0Ub+Pl/XQTzUlUEa+GM2RjiWu8XFk9dBV7TBMSfd i5QeQmBv1ErcdqtyS/Vholfe9fx2xiCcNoWR/FkRC/SN3rKEjr8qEp206Bo7tg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1697700897; a=rsa-sha256; cv=none; b=AwWfRqOo1RcZM52UEk+Hp/YvOVNQ6ksTN2Q69YnAbRiBcjCGZoFmSQmslE2Bde7TYCU9A6 DupfsdveIqe7jJaa939En22DM+47QFqL0MkJhh97g3c4hPor/GEVO2B5u1M18rPBlIxF/y nL1Mhbaw6LUzN465lJNidXPFj+pgV5wsYzhyRFjGsg6IowhDYtFOwFCWVYM3H6hpIxFgkl Wz/NpwV4ThO6U/vT3i5jNwJ5uRNk/hUbvUh4cAstjFdeiyLAtSH49fFhwkn2mmRIefclF8 bIryFYV5MJTBAO9GASSofD6BKqj2KfKb38IYQze7Vt6WQp6XNz7SCpCBjUgJfQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=bTZpdVEI; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qtNXs-0003O5-Pz; Thu, 19 Oct 2023 03:34:16 -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 1qtNXr-0003NP-7e for emacs-orgmode@gnu.org; Thu, 19 Oct 2023 03:34:15 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qtNXp-0002nV-Ic for emacs-orgmode@gnu.org; Thu, 19 Oct 2023 03:34:14 -0400 Received: by mail-pg1-x543.google.com with SMTP id 41be03b00d2f7-5a9bf4fbd3fso4765294a12.1 for ; Thu, 19 Oct 2023 00:34:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697700852; x=1698305652; 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=elxIhvG6y1bGCC76fC3acyeJ5ALOgRo7AAoqw8R3aQs=; b=bTZpdVEIqpdLF/A5bdbNoNq5aca/mQXULN3J22mplrqnfvPzebjzeZVeK6Ds9yBq/E PAIy2CAbcs1qQ8smeb5AxcZrocIPew3KbtcsnRcYqsI6WaYoDfcO54QHq5Uz0moEvLDf oMGZ3c9uRDzTOosn4fw8JFUE198ir2jstRBw16SPH5/WCCA/YuoAWQ3qqJGyqoOI7f9r pC6DcNpbuem9KV4zmq44PjTKIb3mY3ubivnAOl0biw0U4w/8z4tjne6Zk3SvmG/UqrvV DJ+anNnz9e5KnlmZHeP8zCWngjzyz3BFfwrgdkiISAcjXLphWDnoiqYbt63Bh6ftumP7 I8xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697700852; x=1698305652; 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=elxIhvG6y1bGCC76fC3acyeJ5ALOgRo7AAoqw8R3aQs=; b=cOahQJORjr/PW7aYyLrsIrSLepdlFYJlkU8azS3kvA4rN1mxzvXnkQlODOoZOEPcym Uv7jt97CuBef8QvfLPRw0j9YWagioJY7NdcreUohKMSpGSKiI1rW6dv85x+d/SoN0MtL +CoY+BIBos+M391Bv1kAqDuHy6izqHOVTf0kBxfgyV/IYq9LHWDxHBTCXMIX6GrJ1NbE 0fcPF2tmRIhc0Koh2ANFs6kpPs8zmRLMg+llc68IbvgZuQFPCNIZA4SZNMcg6efNmqML nhOdGnYSZxL1K186Zaji9oXpSF0xgAPPF1+pbva35U8/jkn16poc/9F3yHG8TmxbtyJ6 hMaw== X-Gm-Message-State: AOJu0YzPFPzDFEhgiEH0Kt82gs0pxQCL9mrKFhrTmYumg6fopBqkOY9T U52VtNHzDCOQSC5Sa3L4IATmZXjZbaft5A== X-Google-Smtp-Source: AGHT+IGBXTfjmdLwPYPVrSbVksJVasoHoRcMK89u6eV99m3tpEsJjock+rJV59SxeOARZ73rj1N2fg== X-Received: by 2002:a05:6a21:35c7:b0:15c:c381:f65e with SMTP id ba7-20020a056a2135c700b0015cc381f65emr1065478pzc.34.1697700851726; Thu, 19 Oct 2023 00:34:11 -0700 (PDT) Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id ie10-20020a17090b400a00b00263b9e75aecsm970972pjb.41.2023.10.19.00.34.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 00:34:11 -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: <87edi4dm78.fsf@gmail.com> (Visuwesh's message of "Mon, 09 Oct 2023 17:47:31 +0530") 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> <87edi4dm78.fsf@gmail.com> Date: Thu, 19 Oct 2023 13:04:08 +0530 Message-ID: <875y335amn.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::543; envelope-from=visuweshm@gmail.com; helo=mail-pg1-x543.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-Spam-Score: -7.51 X-Migadu-Queue-Id: 037B154413 X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -7.51 X-TUID: 7r17AfmSqRl4 [=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] V= isuwesh wrote: > [=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= ] Ihor 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 = filename))) >> >>> + (`file-link (insert (org-link-make-string (concat "file:" filena= me)) >>> + "\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. OK, seems like the actual handling is done by x-dnd-handle-uri-list where the URI list is split and each URI is handled separately. We can override this function by our own by changing the entry in x-dnd-types-alist but we need to do the same for pgtk-dnd-types-alist and from what I can tell there are no such facilities for MS Windows and NS? I think we need to accept that we will have sub-optimal interface for multi file drops. WDYT? Also, can I know what you think about using a popup-menu instead of a dialog box for prompting as Liu Hui suggests in https://yhetil.org/orgmode/CAOQTW-MAS6B2Uh9Z52eJN7eBwni+suhq9dWe0FkY_RzVHox= W-A@mail.gmail.com ? If you're okay with it, I will write a function to use rmc or popup-menu for prompting as per what use-dialog-box-p returns.