From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id CMo+HFC/SmLY7wAAgWs5BA (envelope-from ) for ; Mon, 04 Apr 2022 11:50:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id eOnAFFC/SmLUXwEAG6o9tA (envelope-from ) for ; Mon, 04 Apr 2022 11:50:08 +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 AE1EB394B7 for ; Mon, 4 Apr 2022 11:50:07 +0200 (CEST) Received: from localhost ([::1]:47850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nbJLa-0007cC-Oc for larch@yhetil.org; Mon, 04 Apr 2022 05:50:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbJKh-0007az-TO for emacs-orgmode@gnu.org; Mon, 04 Apr 2022 05:49:12 -0400 Received: from [2607:f8b0:4864:20::102e] (port=46616 helo=mail-pj1-x102e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nbJKg-0002mP-8J for emacs-orgmode@gnu.org; Mon, 04 Apr 2022 05:49:11 -0400 Received: by mail-pj1-x102e.google.com with SMTP id j20-20020a17090ae61400b001ca9553d073so2393485pjy.5 for ; Mon, 04 Apr 2022 02:49:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=1buBhRdvrlkETUNpW1DIGMfHZn64C/Wt3W34+4uFR3w=; b=SE4HDB4KsPWQznadjIU7NIF9hSX7OG+y/77m1vcbMhrgoRmAGiy7YZlhEKKc8+QHAO X03Z/vyHsi2uflrUw+8r+jTJWTRye1vssezu3jnQMnialvGlOH/ylxeKqQY3nvtEyRIp WEbTmEdTILeV6Pza7px1fuOEVrHks+T61IsbRvh0ucpzpuBRT19YAjPtCJKgGllOmVOP qI+JYrIl4E8d38lmOaRnzyzq4n9V/8830otC1Y63FM2gYoKVQXjgj3AjGtCtyjTMJPuw SjurTNF4qr7RQIleyXEISN3zmawiToKSuDMMeuhSBioiDUb0QMpzyJb2zZNKEQRMDc1q A9Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=1buBhRdvrlkETUNpW1DIGMfHZn64C/Wt3W34+4uFR3w=; b=DCcg/eW2gdi0Md0ven8kWfJpyAlmhFF1lS49g3W3mPy630kTHfUwcHiA78F46KOPBw HY19VcmtoOSYAM/6pFRNXTkLk2F3co+b067YvxqQHFBKsljqZjnFkpmFmIxGS5ejjzqw FazwpnRWZLGTNq2v6bYuO9xcaLWek1CWhNAQIe5As2CZkiSbaM7GwW/mX3EQ0up7a3s4 XFqkAqzKHuwduVlqL0d0v1V+PAzg1f1Hrb/auF5EJrAv/gJ/1HQRYDOPt3nOotP4ue2I t7k1enYwiF5A753aK6WsZR0aj/9Br8efedd66pgqYSkWuKz2N7czEo6jSDiouiqVTbxY XV5Q== X-Gm-Message-State: AOAM532rhBV5MBEkMlgN1Qqe1EhOT3aI3GGqIAHZiHE6SOi0pX4ff4Q9 1KeTAQDQ0jACQH6wy+QcPY3xbE7FrsQQa/TK X-Google-Smtp-Source: ABdhPJxBhwQi1UnsNsSXSxo/C92EMeda464mIihg1UfvvdxyfQ2pfUgsbOaA8afssov4rsjvko1i3g== X-Received: by 2002:a17:902:f701:b0:14d:7cea:82af with SMTP id h1-20020a170902f70100b0014d7cea82afmr57544650plo.71.1649065748710; Mon, 04 Apr 2022 02:49:08 -0700 (PDT) Received: from localhost ([45.128.72.3]) by smtp.gmail.com with ESMTPSA id n14-20020a17090a394e00b001c670d67b8esm10177626pjf.32.2022.04.04.02.49.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 02:49:08 -0700 (PDT) From: Ihor Radchenko To: Hugo Heagren Subject: Re: [PATCH] ol.el: add description format parameter to org-link-parameters In-Reply-To: <20220328231549.30935-2-hugo@heagren.com> References: <20220328231549.30935-1-hugo@heagren.com> <20220328231549.30935-2-hugo@heagren.com> Date: Mon, 04 Apr 2022 17:49:35 +0800 Message-ID: <87zgl1npow.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::102e (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=yantar92@gmail.com; helo=mail-pj1-x102e.google.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1649065807; 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=1buBhRdvrlkETUNpW1DIGMfHZn64C/Wt3W34+4uFR3w=; b=ZhEJHaqJdWOzNLlRoVm2ckT5fOBEHiYAxV3Aw49cTPYN1ZNmJPrs1IRMgNK7aXWjvyxwGO Mzi0Fsr8eelRLRLdqY/B4H4iA9Juwd68AC9DMmv2a8eGmLFzYXCY8V7Ir+46kaq0Ls1cGR CL9v2D3wPHD/bGGJiVTbuGJ1/x7Bj5+4xnGZw70BVg1/J+b0Ug+ERphd68JAddqGUYpe9k QnGU/xa181fg/Z1s5fXqJC0Zz+4fgS2dIzinAFL4oy4NSBjvh6YYq/O1hXNC+V8o7UcdAv yHardAVY+VmTELGfrcUw14lBJV6VMmmGImDxCmlX8kuqAOYn0bBj6P0obc0wOg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1649065807; a=rsa-sha256; cv=none; b=FI4Pgb6HggIxOKrP2lKXJcMmD8uiTQc2lF4lySrQyrd62MXCHNLiTWeKJ+JoS2lC+khvbe L/GPteCK80n0DCl3w2F6cZkaSIfxLkYXXMot40QaCBcfy8zSCy+dnJj4o6byNMGs6eAxAD +QL4s5gqXlsYt58VdlUjrwuveTxWnWvTXUnfuo17fZ7c57KMo2i2okgrHJuuO6Ovz4haZI 2TQXQ2+I2KDrZ/knBTPeysRHxrJ8Y9Et5Lx4AhaE6ppeXdBKTI40lZdv3uFX4Q2+eqKBdg z50KiuKjO7u0cKS/5vyuAR1QSU6ikYEhwxqfcGdf+1x4DO9F0gQvfRf1zehKZg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=SE4HDB4K; dmarc=pass (policy=none) header.from=gmail.com; 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" X-Migadu-Spam-Score: -9.38 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=SE4HDB4K; dmarc=pass (policy=none) header.from=gmail.com; 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" X-Migadu-Queue-Id: AE1EB394B7 X-Spam-Score: -9.38 X-Migadu-Scanner: scn0.migadu.com X-TUID: KSY2FV9ALAui Hugo Heagren writes: > * ol.el (org-link-parameters): add parameter `:default-description', a > string or a function. LGTM in general. Note that I proposed (and never followed up on) a similar patch in the past: https://orgmode.org/list/87pnauvxht.fsf@localhost I like that you introduced an option to set default description to string, but I have several comments on the patch itself. > - (t (condition-case nil > - (funcall org-link-make-description-function link desc) > + (org-link-make-description-function > + (funcall org-link-make-description-function link desc)) > + (t (error > + (message "Can't get link description from %S" > + (symbol-name org-link-make-description-function)) > + (sit-for 2) > + nil))))) It looks like you removed condition-case used to catch errors on org-link-make-description function. I am pretty sure that it is not intentional. Similar condition-case could also be used for the :default-description function. +`:default-description' + + String or function used as a default when prompting users for a + link's description. A string is used as-is, a function is + called with the full link text as the sole argument, and should + return a single string. Why not two arguments like in org-link-make-description-function? Best, Ihor