From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 aNiLOL0TwmQCzQAASxT56A (envelope-from ) for ; Thu, 27 Jul 2023 08:50:37 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id iMlcOL0TwmR/bQEAauVa8A (envelope-from ) for ; Thu, 27 Jul 2023 08:50:37 +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 802DE4E368 for ; Thu, 27 Jul 2023 08:50:37 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=live.com header.s=selector1 header.b=FRMr4sij; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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=live.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1690440637; 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=AmK098ZxQuqUaSMH98HiH3F16p1c5MFfLzqQELDWEVk=; b=AVO4v8E9DPN9F7GUPdFKmOsxLjFmeIR/h8wqBAk9e1mrw32MqVpZ54zlsk3/hRTPMKGY15 iCWc5CBeLFQFH9ZdRyFtWsChnQbOqVi42791iPYot5bxz2nMiZ4BdGCLwXvUsFs2PPFRRw F8TG11zFy6M/INEpxY2xOrud1U3RssnslpU5PgAqbQTkZIJCbKvXe92Y3LCpRE8EaN12Cu 0mz81s5+iztGfedJg5OBWA9f79EN/a9czTEXUK279DVh/SCiZcqjAE8CluuCWAISuliHsQ xDYTPlYtPpy0T35n3WV8AngOKMMTkEDQdIzjHvGstT3Yf30hAXUWX72Q8qRTRg== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1690440637; a=rsa-sha256; cv=pass; b=BXr+ZbPK5wpGJebtYFtGuPWwGLDYsbMBiB9DCdkpiKJZvPeiSrib5mvKUFapb1HdYzAjL2 xgZQ9AvxNA4DfGZEkthhqv3vOcuFdoeT61WemKvPn1B3tQNQ4vRs7rr6lhPCKV4dx6p8vA MDir9YmktmgPBgUdFUkPB5D/6FEhV5wvhhuvQM+qQbYncd0O1BC0xjjc+xEqRozeHeY3Fa /sZG5ZneYI7Wa2Nb5pSVGCGjIB7Jkrq9ukR5iSQGzWXD32buUT07WMghv1hguCenS4+ZV/ x5qyGMEwGrha5MD16VTr/CqDhLI3k8ziLdcobMdtaeMtW/yYbY5CtmhiQw6CRQ== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=live.com header.s=selector1 header.b=FRMr4sij; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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=live.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qOuWz-0005zl-L0; Thu, 27 Jul 2023 02:31:27 -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 1qOuWt-0005zC-L9 for emacs-orgmode@gnu.org; Thu, 27 Jul 2023 02:31:23 -0400 Received: from mail-vi1eur03olkn2080e.outbound.protection.outlook.com ([2a01:111:f400:fe1b::80e] helo=EUR03-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qOuWr-0008AK-R9 for emacs-orgmode@gnu.org; Thu, 27 Jul 2023 02:31:19 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EZAT0ZuXuRN1TgUS8r5d5O12oc8CGxm2o2DyvJQi4Og9inDerOZIpjgSkU+om3ek18ZK2Y94cykTLi4jcdomY77PlzEc97iSWIKibFdjf04mZ3s+e4VqgtO3KNgcoth1XCrRl/XL5HIdCJ+KGzvcEe/TqnBKgmTrMPcofNq9J4djpi1jA5OQihfdJPYz6/TBayjvQUjD5MaVJCLRxZMOuIWyCx7IV1B1qC+RQmPA+8Pt6OV5dpcaozN1+HRX09UjdC+w9u+dL+boHJSQ+GM62IY8PYKDwQ0mNI08+lK7t2922UDNnSY8tgQ1yDbPzjjI6o5ZPwm9O0WjoWUZqG6NQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=AmK098ZxQuqUaSMH98HiH3F16p1c5MFfLzqQELDWEVk=; b=X1jgvkS3TiPlqgyzFF+xwwQQSn+dl1j0Oa10EfWxUtGQ+7sQ3LlFyG2bJehS/yPdJr48BvBFf6V58KDyF8aLjzViIAcjeUfVbFget/UcZttqHobq80MVDRAjqxhf5uNXgO3maoOLpRDdtA0X0XXoJNEf9OneNRyPi8WbxU77r7lqmUkE0cxEDU2E2ZUPAZiXvEUMyZ7xbbT7nSmIsDhjyN0a+SfRY31zMEn2yw3dmYgXbEW6bPZ/hbP+OXhg4J5dBOutNbMYdhOJEgnzV1K+M2mu79E3J2GlWODYBKDQfe69OZlfUJLkxPBj7S+L6gXgmcgnbGikwqXo85ZdGB8cVg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=AmK098ZxQuqUaSMH98HiH3F16p1c5MFfLzqQELDWEVk=; b=FRMr4sijhz5i3Ey/+3aG7EVkGiXYQ++31Dhn+jk7w0WKmgtSV4q9yqlS7EiLsHk13U5uaainGIB70GPDTJ+GU69WGBhAMNEBbarB4xwIhEYurkdvlzpFiTbMqUa2mCL5vNAmlezmFTpwFd3VZElgyqtkmgMAo9lwYsDTk2USoUGHli4kDnFshFE5fULafdPTQneNGn/DlLjpDKmH+jqZb7iVXPhcjzTVu+p9rLqexGsiBi+Sldv476DKX1bQBMrjgh+bbs6ZfZWeNqkBvY8cIaFZAx2a5BzKfl1EgKofZG+ILd3OytogaoXbEZGcktTxs/EstugweCOJ1pOu069s1A== Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by AM7PR09MB3895.eurprd09.prod.outlook.com (2603:10a6:20b:111::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul 2023 06:26:11 +0000 Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::df56:b1b1:64b1:6122]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::df56:b1b1:64b1:6122%7]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023 06:26:11 +0000 From: Arthur Miller To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Subject: Re: Is there a better (built-in) way to insert an org link with title as description? In-Reply-To: <87h6pw8i8q.fsf@localhost> (Ihor Radchenko's message of "Sat, 22 Jul 2023 08:26:13 +0000") References: <87351irjad.fsf@localhost> <87h6pw8i8q.fsf@localhost> Date: Thu, 27 Jul 2023 08:26:08 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Content-Type: text/plain X-TMN: [3TAUxuQL6AYVQ2WRf9rRsdoDlYumEqCH] X-ClientProxiedBy: BE1P281CA0340.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:7d::23) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <82lef1kgzj.fsf@live.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR09MB4977:EE_|AM7PR09MB3895:EE_ X-MS-Office365-Filtering-Correlation-Id: ca6704e3-a3f7-4728-f72f-08db8e6a5e51 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jCpXEykX926eQk12sBK3QB/WUYJtRTUgueD45jmcuG1YRuOAzzq2G6/klg5AnY4xQkCsMw7k82ltYmhARCfqKxX3+t8brhX1fudsy2whZA3wOZPu49kp8qx1fBsdWoe0Ec0PGDAjE5fPWLczT0b4GBWgkEsvzpDQ0YtKH+pV5IBqeSCMKQn1UEQPwlUdVWRKbYeoZieCpmC+9kiDgnnNAirW7HWwrSovcr5OFIbYxsC3c6Lugdpgjxcn3c7u0Ikg6Wu0opR02ToZoKIW0073+wjqey5/o+fQDG/T1qZwZjiIkVEDPQHvCvuaC1Ix1Yft3g+DUTSITslL3eFq9yMVqntwZoqeL0SFKQeIw8YnDzAP5NnXUOX2ygA0pemIj1prtX6somDry5qT3tZuGHIgU52W0IEEUVyCUscHWtbHO8jVip/wEhe9MK2CAhJfeDOCwapvwH6bCBrbRo6T6nl/XaUxHAtuDNd/ycYQ1fg5cvKaYRyzw4K8N5+Z7xIGz9Rki24lMPGu4YH76QtV5bWMdfI4BWjOezq4/MZCsTnPiixTIwTEgcqu/5EiLfrLXPQJ X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?QN7CRP5eCjzfFP29ncxKQzelkdMy5ymD1qMogVxdpCEFfdKZqbRi4QliTmCa?= =?us-ascii?Q?fzpJ1RwPs4NxQImUknk6vQog1QlSBRYSnSZZxAU/n1uFLzpOjHYvRIk8wCql?= =?us-ascii?Q?rFyKy6yp2/jBBlHjWrd9jBuBTTAeHN80JuvaSaBp6l8e0Is5G7Un02BvStNj?= =?us-ascii?Q?ccjdZ7puZlD++Pwz8pt8KIJXAC8aqRA+f3r0mNIgExVFHBevkJ1qH9DK5ypC?= =?us-ascii?Q?i2OFfZkNKySn2T/UoiisgBJZEW/ArYD4UAntgCX9svBes22u4wOceIGqPZUY?= =?us-ascii?Q?fUte+fwf7y2fjyCpreXPEkqMOm9it8ydu6WNc/pCKvdqPlzik8e7CWxQm33M?= =?us-ascii?Q?vKoWZJmATJe2Bm09nTvKlevYEr223O9SJ48p642VDgxepVnYdLoqbSmOVFc8?= =?us-ascii?Q?wo1RgLavje9a44nDGRm64YgTOTfrv2W1t/8P3+T0w37IcW9721wXp5fnDp6J?= =?us-ascii?Q?oa1Q/prnAk50FYoLUkLUpJV2L1ams+OKa4w/Mqho6jy++T0uSoHGkeR23/58?= =?us-ascii?Q?HkssCZ/xfHCBv0U+5MZkfn4L1aMkXsWdoZAWHV8aaavvW0gyOKqbsIoyPSK+?= =?us-ascii?Q?sy/G2XtBzl8AX9key7Ob6nwY92/Ix69EoDAc5bmiuXXLvyLXjE61TS4Vc4In?= =?us-ascii?Q?8TKx+B8UUNWIs5WtzwXoF7oGayK66/i9arDM9PmmfVBF4BpEtvnbl9UfgX+A?= =?us-ascii?Q?60NHnv0oRSPhyCcvoEotG6xSpYXyv6/8c6Y+PvlzpsxqvWlCuhL0GLlxYybR?= =?us-ascii?Q?F9J0n94x4n1nNP/SQoc02bITE235O3E24Coism+SGUd2fP/RT4ZRDwgoftch?= =?us-ascii?Q?qpQ9XEg8lehkkdwfXR7RbTAWU36r2QMh0siomefriaj7CtLY91vd0Ruhf2UO?= =?us-ascii?Q?IyMsFo0GYaSOqM3NWAD04pOPleklb8nbBd1TgPVtLfqiOhv+ds4/9Ol0Ivqm?= =?us-ascii?Q?6gOpEwxAAAxeq1KChW9MucOgBOJwxx4G8mG8wHCW9g7d5GR72IDyBJnL0Y5d?= =?us-ascii?Q?OKoYwS2Mn8hHmWsDiD5zM2AAj0UuWCskvq29UTCoXVKP/n3ViNmrdHo7PnXj?= =?us-ascii?Q?SKJNTMNqUcsU6P2/SoOtkeb4wbySC3zBX7oMSAVxI8VC13VPTtC3/K4ar1cZ?= =?us-ascii?Q?6jYVYEgBwqVdR9kUTlQ/oSrFIueyrIDOZCwHsFODJokpk3clIUUH2xHcrMWV?= =?us-ascii?Q?gesppVuQe0uIS2I7606sNQmO2mfusPicHfR7GvV7OJ+h7Xgx9VWiRsveB+k?= =?us-ascii?Q?=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-64da6.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: ca6704e3-a3f7-4728-f72f-08db8e6a5e51 X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 06:26:11.0068 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR09MB3895 Received-SPF: pass client-ip=2a01:111:f400:fe1b::80e; envelope-from=arthur.miller@live.com; helo=EUR03-VI1-obe.outbound.protection.outlook.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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: -8.16 X-Spam-Score: -8.16 X-Migadu-Queue-Id: 802DE4E368 X-Migadu-Scanner: mx1.migadu.com X-TUID: zJQLB6lWYXKz Ihor Radchenko writes: > Arthur Miller writes: > >>> (org-link-set-parameters "http" :insert-description #'your-function) >>> (org-link-set-parameters "https" :insert-description #'your-function) >> >> Thanks, after some thinkering I got it: >> >> ... >> (org-link-set-parameters "http" :insert-description #'org-desc-from-clipboard) >> (org-link-set-parameters "https" :insert-description #'org-desc-from-clipboard) >> #+end_src >> >> And I can do it async too, *but*; this will affect all insertions of links, >> right? > > Indeed. By design, `org-insert-link' is synchronous - it expects the > link and description to be available upon request. > >> I am not sure if it is safe/possible always to access the internet or do >> it asynchronously, so I'll abandon the ship and revert to home-cooked one just >> for the precautios measures: > > What you can do is (1) make url descriptions be something like be retrieved>; (2) add an :after advice for `org-insert-link' that will > queue asynchronous url fetching; (3) replace <title to be retrieved> > with the fetched title upon finishing the request. If the request fails, > the description will remain <title to be retrieved>. Yes of course, placeholders could work. Another option is to use url as a placeholder, so if the retrieval failed the url would still be visible which is a bit more informative than some generic placholder. > Or you can run description retrieval independently, as a minor mode > that will search for <title to be retrieved> marks and try to fetch > them. True. I could also run an idle timer on my notes file and try to patch all urls without descriptions. Would need to put something as a marker into a desription for dead links, or just remove them, so they are not fetched over and over again. However, I am ok with doing it on the request only, when I actually create a note :). But if someone adds something similar to org, I'll gladly use it :). Thanks and sorry the late response. My memory is like a gold fish, sometimes when GNUS remove a mail from my view I totally forget about it. /a