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 6Ix1Ab+DumSiCQAASxT56A (envelope-from ) for ; Fri, 21 Jul 2023 15:10:23 +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 2GziAL+DumSkzwAAauVa8A (envelope-from ) for ; Fri, 21 Jul 2023 15:10:23 +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 A0A884B110 for ; Fri, 21 Jul 2023 15:10:22 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=live.com header.s=selector1 header.b=uEICiqZF; 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=1689945022; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=He+jAX2N1Ixygg6rAm5esInMjMQ2C1AJ0YAATmiGdc0=; b=mkZYVgJ3QutehNtQpbnxAfLeD6aptiPEr4YtTeNmp5GKv9kS30a6e4wGkQMiNn6kSshzxi 0hXvxYzb8PanpqMwTihLxD6UzSRMX6eTydMbf3KfQJM5+z8qWRA6DvqPVpX4opgkmrpiVv zfQaEg3R9JNwnm820nMqQtvMHVxgtppqcCBS38SblZvA2ZUC7G3tVobuSzj629iCp8QMSj suV4izEl1taUUCz7jTz6rQHgi3GzKFdpAPAAyN6MOjrp6j4ay6sndkm0AW8P+PcjDHu0EW pHKdYOsZK77Ce2OctF1wEn5UHXfiHZl1+0Ja7d/w25qxGfUk6hKWdFwRLaFHsg== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1689945022; a=rsa-sha256; cv=pass; b=ifimM6KkoBttEtP60JVN/cmJatLO+BE1nx+nhtoNh3S7fjmaWVJtb67ZhzT0gsk1bu5/nO Sw4yxEeNVMAAqfoeiVKW4zyx6aQNXdxxISe4jFJhKL7OCsy+M8gXXGwuZo8uiEksLgfj6m N69JikGUu7XB0QggR+CIu0ZzXP8Vw9cdf9apJzNrJJvYG6MlQdOZJHHOGoPUsWkRaxMkuY w6tcTEr+6LC10EUSvGxRoKnhOQvNUJOggDXF2thec71gIySrv4P5tzehkatmUHSE2zxuLY va0kgXgiqYnmromPftn3Xh8I1cdVXJRWPH36EDQYENwy9Ltg4IbJywvIKuIJpw== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=live.com header.s=selector1 header.b=uEICiqZF; 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 1qMpsy-0001cf-Ef; Fri, 21 Jul 2023 09:09:32 -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 1qMpst-0001cI-8R for emacs-orgmode@gnu.org; Fri, 21 Jul 2023 09:09:27 -0400 Received: from mail-db8eur05acsn20808.outbound.protection.outlook.com ([2a01:111:f400:7e1a::808] helo=EUR05-DB8-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 1qMpsr-0002GW-9I for emacs-orgmode@gnu.org; Fri, 21 Jul 2023 09:09:27 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eSEQp7IabeLcIVadKsZ8XGuaYTwdGvlrDmjZXG4qfnugupU/UAkAWvG1Gkf7GzHWGgLbadzn/5VelHWVwRJvI9yBTARMrDfP1qJRcWLEO/SpHXaDAjmhmRjmxJskwVGWequiXAkJn64pUnWFk0yWK7hqldKMEvbVpGPp0XDRn9GKd7FB8/5TvHWQEaHGN4LnQCOQyKf43E7JLV1lVQ190hvtWybvAz4sWrdI2p4hiSqDXH25vJRrMW1EetpvWMzKa2EGTBUZWWZfbKgrZMCk/2bE4U6zXKhkIy7m/gUBleM/m9WDBU1RDlEEOAxVLMcqMlzqvLkHsE5tuUa9/lrRJA== 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=He+jAX2N1Ixygg6rAm5esInMjMQ2C1AJ0YAATmiGdc0=; b=LUeWZq2yF5JQlVDChyMqt2cReUIYL8SDFgJQ9zyHojZBZ4UFsIkPIi1LveiHsv1+Ow62fPDB/cmUV+uaL95WR1fMrIDsjSGx3xv5Ml22t6JJqXKwAmGHsK7qBZyg5mNx+idhgifloc6Wx7krIalffWxIK8StwIx1OcyZM+exjb0eoogZKH1HC+Ng/j0Oj+JegXrCNszhC4W0MFqAICIsifMRuKjs1f/aLfhFJS8jImGzmvs5buptI7k5AkL2dnvhQOzJXDW5EsyRW5UwYAaMif6Uj5rkjze9RRRjKeS/AwdIHbx6YcRMsOB0m41b89VyGMRvndyc8DJ/WrIDqnwP1w== 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=He+jAX2N1Ixygg6rAm5esInMjMQ2C1AJ0YAATmiGdc0=; b=uEICiqZFaGKf8JJLhR6ZvhdMbItbCHBTXOXmskT/JT9rQFPiztL9NcQOP5u/C3uWcdjj493RnlOIuh0Cf3SBFRG1sPP1tTNyjYyK5sJfiMAv7hjo4UPm6r0JsHmOLwU6dULhy7wJMIe5fFYWQCxJpZCwLKZuKGXPM8AYPDcotaywAbQm5kWagIV5u5hz/oOER+WF2nsuMH9QM2/Kij20ZXUUIZFomgXBr6fRJElX4ntwCCloowcAm6RLLhTxYw766motU4DWnyr+8+G5eYnwtBdyGZY+3aNqUM0PlCKykDmv1CHQjcWjVCog3InA3zFnG1GJLCyM5x9Hi1NBkYlJ/Q== Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) by GV1PR09MB6003.eurprd09.prod.outlook.com (2603:10a6:150:86::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.28; Fri, 21 Jul 2023 13:04:20 +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; Fri, 21 Jul 2023 13:04:20 +0000 From: Arthur Miller To: 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: <68592813-e8d4-a9d6-cb3d-51804236413d@gmail.com> (Max Nikulin's message of "Thu, 20 Jul 2023 18:01:56 +0700") References: <68592813-e8d4-a9d6-cb3d-51804236413d@gmail.com> Date: Fri, 21 Jul 2023 15:04:17 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Content-Type: text/plain X-TMN: [HaXafw0CSpMD+OpRAQLDke97GgXNy+Wo] X-ClientProxiedBy: MM0P280CA0017.SWEP280.PROD.OUTLOOK.COM (2603:10a6:190:a::6) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87v8edza9a.fsf@live.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR09MB4977:EE_|GV1PR09MB6003:EE_ X-MS-Office365-Filtering-Correlation-Id: 7764a38e-3307-4bde-3cf0-08db89eafeb4 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zBRXS0bil6VkYtGwP1c/dVyiSXmjFz4BmL0SjULiVO/HdqU9EmTHtyLVYch4tS7JCbb0rhwEjVRa1Zii5Y2c1btDukg+7kbKOwMwtFomxWFYhM9uMhxvy1U764/DunIxJqyyOMrDUBxpiSEjGGtv0EYxTBwf/edt9qUIR/H69fKw77yY4IUTLUradwdi9ZzX+tBnWkk5Be8TtJwUCmMeEUJoSaYdHXZwlA/ybyM036VbqzQoSa3Uz23qDve18NKHySaJehu2WybKcmFlhtwj5GmqpDkveZcxho4/y6u2BWS3gGkOPfiVf81hsGshTGfDsQYGln8uebYFFLOsxyg/+GudqlNsBHS+xwml+ZfG1cQpIlsWh6mFte6U6lSuwJuNbw/UQS7rXXS6pBAJCpBRTIGDAordFxjqA4d4KSrQ/8GG+uBuCiyBJiO4cQF6VIzOYnn7hQ3TPDZH4Vhhm+P54bS5NKqKKgzSl/nCxd+a9+wXBKqwoe2kMoMG2Ufi874Eb8A1fcVwKYwxJeXuFvLwTwUUJAnb8HoRr4kqZPIbhpjN5W8idhhbmPDQHx1cZHrL X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?NmREDbb3nawNLF49o8T4rbIP3MUGMpnT8YA1A2uglOrFslwLDhBewMEcUTqr?= =?us-ascii?Q?BfapnTOAeEfOKyxlpzWkaZU6tM1AEM5J2XxweR+iKO2ec67Q8QAWMfC640Jm?= =?us-ascii?Q?9gx0/wQP6UI3jy6mtT7osxwB3fpzZh4tMZqX6Scd9qvWZFozSAPqQ+R0ZXRN?= =?us-ascii?Q?aR2thRLg6S4YICmn/XKlSvCX53rwSQCtPbscxDlX+Zyi1Rboj3BmrCC7tFa2?= =?us-ascii?Q?QoG7xMKKkLofxHAPvON9QxHkTTC56AlXAnFt28eOcy7pUDUxsDKtQwhW8u24?= =?us-ascii?Q?DromzZEEB+hfAmbqRcffv0NG5gsWhKjIMnCYDory7Tka903haX5G9mX60gKi?= =?us-ascii?Q?9H7RAmf9mHWEgOOpjiO8Q375tsTkBpPwc6ID0k5URwieJTIHLTvTgXoETauU?= =?us-ascii?Q?GA1D09QOdqCop9ZuHxEzlL7SASC7EBfyne9i4XcbG9JYwPbGDM8LJrrhT+s+?= =?us-ascii?Q?/JajndxFi6cKPgV8oq8sS6K2zxyT6nRHGQm6fYDXOoKR38ffctXKD8FE0nBu?= =?us-ascii?Q?ILv5EPLpV99ohmmaHuhRSF5rCfo93G6KdCVHaS6qabMQK6Aj0TtgoIvP/I/O?= =?us-ascii?Q?iF2ywQJfiXlvSlI3/nZnq9IaN6MFAo3A05sC8TJhEqhhFoTLrgGAz1vZfXLj?= =?us-ascii?Q?EEaVq9no0IPiZK0zffh/6/RIUTr42HRoI5TMCVKK97XynGZBiETtsJTpAmyX?= =?us-ascii?Q?F44Wi4rUyilOSScBOGXJLzbDyKGp44GrX3uvtHLuZR3G4cAzLg3aVIaIJ4L8?= =?us-ascii?Q?STnJl1GA5nFR11blN8uJbcGMliQ6ZiVwl1CuFQ/WUBl0hVn29uWJNxpM+jgY?= =?us-ascii?Q?ODxN405Yn5O7P+7jd5AK6i9QwSkjpbQWQg8XxrMXn/AKRcRSZCyWzCVTF8rC?= =?us-ascii?Q?Zgw1qsfqnPCDtMRl2n8PwXlcO0t5nVC7d7bk2YghbWcKuHOpzUUH6eGLuSz8?= =?us-ascii?Q?BceXd1LWCGjQ87rd8KfYQAltHWmsIoGC8McxlTQChfhhL6vS+eHjiz/Llm7q?= =?us-ascii?Q?kWt3Ay3qM1hX1nYZdFpK1ZiF6NulNr8iDb4M+9yQF3m8mAt4sPK3fsbKeI+1?= =?us-ascii?Q?54WvdEA/MremMkLr1nRV4v6ZhBe8ylKVKukTprZlivqK9IebhDTxz/o4LCst?= =?us-ascii?Q?9iWmo5GmfczUSn2EZoHp5QB15EHwFvBJXtK9o1zBmZF1hCNpnf9yfRTu7ZGk?= =?us-ascii?Q?ZCATvRLkhMZPTWF4Mr+nOlurD3czKex4XVmQ/DP7dzAAYJAbe2388Aj49Eo?= =?us-ascii?Q?=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-64da6.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 7764a38e-3307-4bde-3cf0-08db89eafeb4 X-MS-Exchange-CrossTenant-AuthSource: AM9PR09MB4977.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2023 13:04:19.9806 (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: GV1PR09MB6003 Received-SPF: pass client-ip=2a01:111:f400:7e1a::808; envelope-from=arthur.miller@live.com; helo=EUR05-DB8-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, RCVD_IN_DNSWL_NONE=-0.0001, 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: -6.71 X-Spam-Score: -6.71 X-Migadu-Queue-Id: A0A884B110 X-Migadu-Scanner: mx1.migadu.com X-TUID: cZmSulzQH7hJ Max Nikulin writes: Hi thank you for the thorough and well-informed answer. > On 19/07/2023 19:06, Arthur Miller wrote: >> I want to auto insert a title from an HTML page as description for an org link in >> my notes. >> (defun org-link-from-clipboard () > ... >> (url-retrieve url >> (lambda (buffer) >> (goto-char (point-min)) >> (when (re-search-forward "\\(.*\\)" nil t) > > What are origins of your links? > If it is an URL opened in browser then `org-capture' or > org-protocol:/store-link/ may be used. There are a number of browser extensions > for that. I do use org-protocol, and I do have it in my FFX, so I am aware of it. But sometimes I copy a link from a readme file or a piece of code or elsewhere and wish to stash it away in a note but not necessary open in a browser. You know, "todo" to come back later for it :). > More metadata sometimes desired and just page title is not enough. For > extracting it within Emacs see e.g. Ihor's > https://github.com/yantar92/org-capture-ref > Search for its discussions on this mailing lists. > > Some complications: > - titles may have &...; entities > - Not all pages have , so heuristics have to be used. Yepp, I am aware, the goal was not to be 100% fool proof. I had experienced sometimes a couple of characters that Emacs can't dissambiguate, but it is not a problem and yes, in case of no title it will prompt; the other strategy I used was to return just url itself or "no description". Perhaps I should revert to just the url. > - Some HTML files contains nothing besides JavaScript to load actual content > - Some URLs are from minifiers or obfuscated by Outlook "protection", > trampolines to prevent leaking of data through the Referer header, etc. Likely > redirection target should be saved, not original URL. > - Some sites like GitHub have API that allows to get metadata in JSON format. It > is better than parsing HTML with regexp. Yes, I am aware and completely agree with you! Luckely I am getting quite old by now and don't visit too many sites or sites of dubious JS character, so for my needs IDC :). Miros idea served me well for several years now, I just improved it a bit the other day to skip prmpting for the URL and used asynchornous download to skip that slight second or two of delay in some links. > Anyway I suggest to split non-interactive part of the command to allow code > reuse (for drag and drop, etc.). Tell me more here? Can I drag a link from one buffer into a note buffer, or how can I use it? Thank you for the answer.