From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 2P/7F0d+yl4WdgAA0tVLHw (envelope-from ) for ; Sun, 24 May 2020 14:01:43 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id cH7fE0d+yl4MdQAAB5/wlQ (envelope-from ) for ; Sun, 24 May 2020 14:01:43 +0000 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 094EA940B2B for ; Sun, 24 May 2020 14:01:43 +0000 (UTC) Received: from localhost ([::1]:56160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jcrCA-0004lM-0t for larch@yhetil.org; Sun, 24 May 2020 10:01:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jcrBe-0004lD-17 for emacs-orgmode@gnu.org; Sun, 24 May 2020 10:01:10 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:60610) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jcrBd-0002nU-OO; Sun, 24 May 2020 10:01:09 -0400 Received: from [2a01:e35:2fe1:f780:89e5:8450:94dc:1572] (port=45840 helo=guerry) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1jcrBc-0004dU-QU; Sun, 24 May 2020 10:01:09 -0400 Received: by guerry (Postfix, from userid 1000) id 22ECA1A603BA; Sun, 24 May 2020 16:01:07 +0200 (CEST) From: Bastien To: stardiviner Subject: Re: [PATCH] make org-attach-url download function as an option Organization: GNU References: <87zhaupfl6.fsf@gmail.com> Date: Sun, 24 May 2020 16:01:07 +0200 Message-ID: <87pnatl9ek.fsf@bzg.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Org Mode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: 0.49 X-TUID: zCENdvDjJ18W Hi, stardiviner writes: > I found when network is bad and slow, or the download file is big, the > org-attach-url will suspend Emacs for a long time. User might have to cancel > downloading, and start again later. Indeed, this might be annoying. At the same time, it is not unreasonable to expect the user to know what size is the contents he is willing to attach to an Org node. > I hope to make "org-attach-url" download file asynchronously. But function > org-attach-attach hardcoded this function for 'url method. Here is a patch to > make it into an option. (FWIW, I could not find the patch.) I think you are on the right track when trying to enhance the 'url package. Maybe url-copy-file should be asynchronous and url could provide url-copy-file-synchronously (to mimic the url-retrieve and url-retrieve-synchronously pair)? Until Emacs has a function to copy a URL's contents asynchronously, I'd rather not add this functionality in Org. -- Bastien