From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 6M79J0LTt2Q+HQAASxT56A (envelope-from ) for ; Wed, 19 Jul 2023 14:12:50 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id WJrmJkLTt2TAFAAAG6o9tA (envelope-from ) for ; Wed, 19 Jul 2023 14:12:50 +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 D6445489BA for ; Wed, 19 Jul 2023 14:12:49 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=live.com header.s=selector1 header.b=o7FUSjnD; 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=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1689768770; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=V8xycCoSpn/pbUC+UIss6A5t6yuordTr48ttZ1u1+JE=; b=i+0EvpVbHr/tJjR6UsMqknXRIhQkRhbw5FtDHs+gIeVp5fzUxnsIRmgxUn0LiivwmUkvu/ KamghJFR88wamqCnOH0KMiFQNspv/+jWCAHciQIDHv1XE7kIVpYnn/7T/Ac9sEJGCbTWRH VveQe6Jhaj6iYfKcNoCIRo/6xSBfK4/x1OqdbzuewS4CTGe8VzjrzgZ2wS6xqbgN3hdhhi sJb63YyUS4fTI94Pu3288TMQTZ2MueQpwRJteKVe/FYWlhLpEPujbJHj46gkeUPlHF0t6V AG0OxzULO0x2VSrhpV1O1DbtN/yrfMyjmc11V6b69Ui6uICD5yDzI4m0Etoy7Q== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=live.com header.s=selector1 header.b=o7FUSjnD; 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=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=key1; d=yhetil.org; t=1689768770; a=rsa-sha256; cv=pass; b=qqpfHk/yxKa7i3chidv7kJITbhvSizV6H8QIroh5NYWa0o0PFsdW0dAldfaVmOsRZ2tiqc e2lTwlG4CFh5JFP5hUzTdsjaU/OtEea8rX+WVcoHPvejcmR9sqrCziNmkwk+x7IUPDzRCE SMunz7wYDrXFU4oU1Hm786VsgPwg0Q+d8nEl/MBavLzTERAWLXKJFlTGU60nuiOhmk8PWp u2bSSXUSWJS5HZLGwtSffJkuu7MRI/G+60Uy0DTIbSMlMWxPsBFKsFTaf/Tif45ANCCtAj 9lc3xVRVqgB86KUYJ/zVsnqd0ZNMvE2V+laeL/eQHBHXqViVosIDivESr6GFDg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qM61j-0001lU-JQ; Wed, 19 Jul 2023 08:11:31 -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 1qM61Z-0001ig-Eg for emacs-orgmode@gnu.org; Wed, 19 Jul 2023 08:11:26 -0400 Received: from mail-am0eur02olkn20811.outbound.protection.outlook.com ([2a01:111:f400:fe13::811] helo=EUR02-AM0-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 1qM61P-0005vH-JB for emacs-orgmode@gnu.org; Wed, 19 Jul 2023 08:11:19 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=McGzujlPr6bPcb9Es5l+NSkbivY53cNjdBYEExdKopQQArs8zOQN+TU2AwOcCkV8al5/d7BgDdnBnjGxDybsDqHgiMNlm4b8v7nt0K8zUtAXtSMSTEn5bkRUvhaPB6/JEnOXg3AtQiWWQA0DSKK3/vU28ir2SypBlJYx3Bcvr22CXcGmrXMQb8Ktx3k3fowlUbJa8vyhbmOwIEljClelAt4vI100ilHT0oYk0S3z9Dtt1kToJJ3p+glnJAGjfFxdtbZq9IIWEYJ4N2RyYEUoOSGgl7ko3JzEXhz9KzOhHKVakVqJ/guqPGPJXwXeXm6grTEK68VLs+E70Hj6abNWww== 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=V8xycCoSpn/pbUC+UIss6A5t6yuordTr48ttZ1u1+JE=; b=I4cqBblCS15AOTHEtJzpVfnvmPmiBWPEImG0lOKbw3918kUS/21n+iQJA1ah8mm28CF+s3NlAjOckwdGC13HSUNib64+tthuyJffjYBGyghchbwHq1fWqJ3Cdy/C/ZUKhLuHSqjjbpL5QJlu8U9jHTGTSmB/lV5tXMarQ/v0P+B1ASIpmlnoh5tY7XJMm06NeyES8IRI7owIrGXEneVe6AhxX11mKLSeo//8+ixxYGL/uhaOdEt5cG0pMmeK1VciWnyIE6VRJrVZWqpAPVXqj+B047b4A7DgPmju/oJetmo/TURTULgMC7sLs90K4hbkPm7V4O1BqmFFGjEU0tz29g== 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=V8xycCoSpn/pbUC+UIss6A5t6yuordTr48ttZ1u1+JE=; b=o7FUSjnD7Xm5dftOqMkGpihU1vT3LZLztLlhHgIuWwydvW3I5a6ymvHxsRJ6XaZiZRr/31jQkwaBmmxSuAOVSYPxMCPmB8dd3IU+0Q5shpvD5t2vDRX7CCl1fw8DHL1z3GqIYnH88nQmmtmd86KMhlfJIFwD9ZXLCzuoNK5y3pfd0bA0cqFrI2xAwkfXuTkqUT3VDv9HaF9sQ369ThHpk6zHgZZu2Cuk7kxSal8gQ46LLBJ0OpEd0cuMBf5anNeP6mEvS48xkRGE7VVzkU5WdrCWXMOn+amPTzf5mQtrrCk50b2xqKahRXpU7h3jnC4vrOLuM8ZxJna03VjodHTvCA== Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by VI1PR09MB6829.eurprd09.prod.outlook.com (2603:10a6:800:1d6::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.32; Wed, 19 Jul 2023 12:06:07 +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.6609.024; Wed, 19 Jul 2023 12:06:07 +0000 From: Arthur Miller To: emacs-orgmode@gnu.org Subject: Is there a better (built-in) way to insert an org link with title as description? Date: Wed, 19 Jul 2023 14:06:05 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Content-Type: text/plain X-TMN: [MO+Soa2sYoFfNr5Tmx2xwHmq1aEkuFv3njgxsx0x7Tc=] X-ClientProxiedBy: MM0P280CA0029.SWEP280.PROD.OUTLOOK.COM (2603:10a6:190:a::17) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87zg3sw1g2.fsf@live.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR09MB4977:EE_|VI1PR09MB6829:EE_ X-MS-Office365-Filtering-Correlation-Id: 54e41589-0fe9-4740-e177-08db8850884b X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GA/bR8/syQgf0/zGEvjIiVjMHkTNkQ46i8tUNKA3SfVp4UWkckjnIUCn6PT4SXdYCpqTQFOV/JcZbPM8p45ZkmOeS0XWQXP8oQo/9fW4wz9ATfah6ROBtuOYhQg1dRZ9T6U4btCG0FReR6Nr6/6nS5RqLy1SDaf+pVHM7IhzND6ApgMgmRvLpQBXC0EL0g81MjSJyg9IGmlDe168YjEAw4LqcLXTrvZ4ZN7orNEYmFFZWrVogFyMWm8xfmr2KekFx5F+YZm55mwyfhSFebZaooIy/hFvoVTD8t7ZWkRlesdkEc8TWJmc23230x149Kg5FQnxTiDngH91YN/jfxH3QwSjHNrJc3pR/Q9mbc2cizFyofuVimByr2IqL6pXZLEqQuarMW9i6gK/uCxAzWMRZpEP7eXIWyWEtE5BsFnuSwNrDfnvCRK1Wp6f4MPcY5yHiAHyUZWLu3cl+Gx1cE47En2lZJzlqijhz1p7wBusxQNakYAKOKOO2NF/q4iokh+hI9Hoji1EPB/6g/oMmn/B/EoByJ9dGCEeW+O+V6exDlk= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?A8USr6UldslzXljkOpZNS6rgb1bFYXpgLpkgaDNiqHslMNE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kSgONUgbKLRxAEYfod3iGXcrFjaUVjCFDPFpZBDlc7roLxp9WSD?= =?us-ascii?Q?eX76HEzrqFhZlCfwwA4zBYutan8HPBrUDSf6dcVi5Bq6C4QnqIZTSfUp1XDm?= =?us-ascii?Q?rqXX23pmQwrSyLxhgBD/FLn9AUBB0SihdnLrbBABb/A5MPIp27MlnRp0TksY?= =?us-ascii?Q?elS4kSx/oK55nFmQ3FaLzrPl+FLRE04BN05i6++mvKAa4pGPI4nl4khzFQ/t?= =?us-ascii?Q?uftXPNSeoooM+M7fWfxtGojcaK+89qHawP1qpKCEzJhgDWk1sDfZl0Ol77nu?= =?us-ascii?Q?gML2VdfaXcQ1hRvS/PzXftAC+ccPaKNF3Z3Q6WUV8TsI/yD+9Km2fXqP49M?= =?us-ascii?Q?=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-64da6.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 54e41589-0fe9-4740-e177-08db8850884b X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2023 12:06:07.5206 (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: VI1PR09MB6829 Received-SPF: pass client-ip=2a01:111:f400:fe13::811; envelope-from=arthur.miller@live.com; helo=EUR02-AM0-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-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: -9.56 X-Migadu-Queue-Id: D6445489BA X-Migadu-Spam-Score: -9.56 X-Migadu-Scanner: mx0.migadu.com X-TUID: 49s/3Vg71/mD Hello Org experts, I want to auto insert a title from an HTML page as description for an org link in my notes. I stumbled upon some old message by Miro Bezjak on this list: https://lists.gnu.org/archive/html/emacs-orgmode/2012-09/msg01435.html I have seen the replies, but I am not sure how to use org-make-link-description-function, so I coded my own version of Miros idea: #+begin_src emacs-lisp (defun org-link-from-clipboard () "Insert an org link into current buffer from an URL in clipboard." (interactive) (let ((marker (point-marker)) (url (if (string-match-p "^\\(http\\|https\\)://" (current-kill 0)) (current-kill 0) (read-string "URL: "))) (title nil)) (when url (url-retrieve url (lambda (buffer) (goto-char (point-min)) (when (re-search-forward "\\(.*\\)" nil t) (setq title (string-trim (match-string-no-properties 1)))) (with-current-buffer (marker-buffer marker) (save-excursion (goto-char (marker-position marker)) (org-insert-link nil url (or title (read-string "Description: ")))))) nil t t)))) #+end_src While my function is not very big, I would still like to learn how to use the suggested built-in stuff from that discussion. I also dislike the interactive fallback in asynchronous callback if the title is not found, but I would also dislike to have a bunch of "No description found" strings in my notes too, so I am not sure which one is less evil there. Thankful for any help and advice.