From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id +EMoCsVB1WLtCgAAbAwnHQ (envelope-from ) for ; Mon, 18 Jul 2022 13:19:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id cBbfCMVB1WJWxgAAG6o9tA (envelope-from ) for ; Mon, 18 Jul 2022 13:19:33 +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 BEE09312F0 for ; Mon, 18 Jul 2022 13:19:32 +0200 (CEST) Received: from localhost ([::1]:60546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDOSi-0003nW-By for larch@yhetil.org; Mon, 18 Jul 2022 06:58:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDOPz-0000p0-9y for emacs-orgmode@gnu.org; Mon, 18 Jul 2022 06:56:04 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]:45926) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oDOPt-0005C5-GT for emacs-orgmode@gnu.org; Mon, 18 Jul 2022 06:56:00 -0400 Received: by mail-lf1-x133.google.com with SMTP id d12so18594435lfq.12 for ; Mon, 18 Jul 2022 03:55:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=tWxUcQ5bYQGlEHXW9ZjmoP8FtX+I0BGrpRmjLm7LTLU=; b=pvAON3p0qf38OKSrCdAQmiqHXXE5FPNeByo2zKlMyn9goWuERvTuFoH3nK5TdiGC7U Lp6+gTSa2d4rfJ2KXF3YE5/iKF46V0OUOY92Nksh8fA4SOrl3pRlSxwfxTY5ObtDNYjF caXqs62pX4l7w7wVVrK5yYRME+ikhtZM7wWwRMQcOocjdx/ijlUS86NitR9W9dBuTiue n5gRhQeY+jMxaqmK6j1BDSpk4RDDLKcVQzJ24krK5uIKhPWiHo4GiUszP/amPnwF7cIq 4hux4+E+V1IPg/YrDQbcRihW14ClxeBKGaNvzl2VsMSZQ0NeWF7C0PHlJqjwFo2Cr34m zL1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=tWxUcQ5bYQGlEHXW9ZjmoP8FtX+I0BGrpRmjLm7LTLU=; b=tkCPX0TFyzpAE5DMAIDT01AukCRCYFbWAQlFNq+wJegx+cGwJ89ZMeL+j8Us1w1Zye o02Gy0zABNAVj1E1aWUTsY/Jk+R56waiwz9wFIn2naHE+eDgb3N5xFPhzw9PvXVdJIUW f/wUSDGKDkPfQQizM7vni6qDnoAxILn3yGmiGkl+JiP55JvHoyElUE2ie1XjtL8TqLxp LNmZqSxmFPyzXSIjqRgrIhWzeP9ogRCi6X3GXntbm9EuX6jfephy3QMNbXguq2OxkAqW /pEjO2o5yBkTRdW+k+RovmmRgceybiLxtbcn7GbryIBixGggw2b6PPR8JRhauMO+J1Kf nNTw== X-Gm-Message-State: AJIora94YKAjoIXPotSFJ0X6zBHN5Z2ttBFm8/WD20mZpudcOs/3Pl9A DHhhNUJtCrO+QeLeAL28UMs= X-Google-Smtp-Source: AGRyM1ujqLpXnOPxNSBhoyDb0HQkyAmgTqB61OzkzR8D4ByFLximI1vexR08eI+bbL9ze+nqdmbung== X-Received: by 2002:ac2:5d70:0:b0:489:f9d2:15df with SMTP id h16-20020ac25d70000000b00489f9d215dfmr14794359lft.6.1658141753901; Mon, 18 Jul 2022 03:55:53 -0700 (PDT) Received: from [192.168.0.101] (nat-0-0.nsk.sibset.net. [5.44.169.188]) by smtp.googlemail.com with ESMTPSA id y21-20020a2e95d5000000b0025d952545e7sm2034227ljh.12.2022.07.18.03.55.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Jul 2022 03:55:53 -0700 (PDT) Message-ID: <47248a4f-10aa-0980-c054-563f30c05aaa@gmail.com> Date: Mon, 18 Jul 2022 17:55:51 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v6] ol.el: add description format parameter to org-link-parameters Content-Language: en-US To: Hugo Heagren , emacs-orgmode@gnu.org References: <87zgl1npow.fsf@localhost> <20220405192931.6747-1-hugo@heagren.com> <87a6cx79xn.fsf@localhost> <87zgi6fckr.fsf@heagren.com> <871qvixhfw.fsf@gmail.com> <87v8s8n1bm.fsf@heagren.com> <87let39d3c.fsf@localhost> <877d4flu3x.fsf@heagren.com> <87cze5e84m.fsf@localhost> <87tu7gkb4l.fsf@heagren.com> <87y1ws6o0c.fsf@localhost> <87k08bjw0t.fsf@heagren.com> From: Max Nikulin In-Reply-To: <87k08bjw0t.fsf@heagren.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=manikulin@gmail.com; helo=mail-lf1-x133.google.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, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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" 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=1658143172; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=tWxUcQ5bYQGlEHXW9ZjmoP8FtX+I0BGrpRmjLm7LTLU=; b=k3+t2ZDRS+uvPojDD0BAi3cjS6Im18diJ1dDv60KQJQoyL9x9YMroYrnzPBOOkQPMzJ8E6 s4qayE8wFEUTw9JK6fRaQBPsb8KcX7Q0SDVgIdG2xsNzkP6vVyJQ6akJ1mZKc5+cZu+bhO q7Yu7J1UviBbz7Tu2Jy0bpHXvmlRHP2Otemb7i8SK3JM8QRMAqwupOgiMzM2wgsSmG0s8E AgGWN6+ElmCivcClMYZklBEG8cup7eUvuNpeimy/5bhQQgE70QoOjrTcfJay+4oKCG6FPZ dZPh9bu+bTT1EpnMSuh+v9m7UFB/Id8iQ2Ycbj3wW3evaVkCVXOuCGe9cTNQMw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658143172; a=rsa-sha256; cv=none; b=MINHqjhi5oL3SlUwSYxJzS0xoeEhfn5FeeX45aPytx0WgJJuwKJ9vkTxxXviCj+4zI1+hT MuV147JF7IVSCSiHCbtKnPrl2Guz644zo7KRm3D6kblf5UZ4o3VX0VllYD3ut1AbI44eoE 8WwUxBGMM+Vc1lQ8EKAfAUysWpx26yV5AB3oZU0D5TKM32rTq03vsFt1AwrfYMH/ClRr6C 5pBE67tKu8icHtbJP3aFxwQPaFEjxQ4j+XLFuHtFtX88Mg9Xhtk+Eb2NjOUe+fpxOynaXC FqZFBo+Sg2JJwiZHOBRkDY0bFDNCfNh+FqwrJRNwrsAWgRSfuKTfmJPpmAfslQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=pvAON3p0; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: 6.27 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=pvAON3p0; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: BEE09312F0 X-Spam-Score: 6.27 X-Migadu-Scanner: scn0.migadu.com X-TUID: afL9Gja31zm2 Hugo, I am sorry if I am wrong, but I do not see you among known Org contributors. You patch is likely greater than it is allowed for TINYCHANGE, so before you patch can be committed, copyright assignment should be signed, see https://orgmode.org/worg/org-contribute.html#copyright for details. On 18/07/2022 03:59, Hugo Heagren wrote: > From fbe030ad3a2aafd09d491aefb9c56242b7ec669b Mon Sep 17 00:00:00 2001 > From: Hugo Heagren > Date: Sat, 16 Jul 2022 19:50:15 +0100 > Subject: [PATCH] test-ol: tests for insert-description param when inserting > links Emacs-26.3: make test-dirty BTEST_RE=test-ol/insert-link-insert-description selected tests: test-ol/insert-link-insert-description Running 1 tests (2022-07-18 12:21:46+0200) Test test-ol/insert-link-insert-description backtrace: signal(wrong-type-argument (listp :insert-description)) apply(signal (wrong-type-argument (listp :insert-description))) (setq value-7565 (apply fn-7563 args-7564)) (unwind-protect (setq value-7565 (apply fn-7563 args-7564)) (setq fo (if (unwind-protect (setq value-7565 (apply fn-7563 args-7564)) (set (let (form-description-7567) (if (unwind-protect (setq value-7565 (a (let ((value-7565 (quote ert-form-evaluation-aborted-7566))) (let (f (let* ((fn-7563 (function signal)) (args-7564 (condition-case err (l (closure (t) nil (let* ((fn-7563 (function signal)) (args-7564 (cond ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test ert-run-test(#s(ert-test :name test-ol/insert-link-insert-descriptio ert-run-or-rerun-test(#s(ert--stats :selector "test-ol/insert-link-i ert-run-tests("test-ol/insert-link-insert-description" #f(compiled-f ert-run-tests-batch("test-ol/insert-link-insert-description") ert-run-tests-batch-and-exit("test-ol/insert-link-insert-description (let ((org-id-track-globally t) (org-test-selector (if org-test-sele org-test-run-batch-tests("test-ol/insert-link-insert-description") eval((org-test-run-batch-tests org-test-select-re)) command-line-1(("--eval" "(setq vc-handled-backends nil org-startup- command-line() normal-top-level() Test test-ol/insert-link-insert-description condition: (wrong-type-argument listp :insert-description) FAILED 1/1 test-ol/insert-link-insert-description > +(ert-deftest test-ol/insert-link-insert-description () > + "Test `:insert-description' parameter handling." > + ;; String case. The cases might be improved by using different values, so when particular `should' form fail it is easier to find it in the code > + (should > + (string= > + "foobar" > + (test-ol-with-link-parameters-as > + "id" (:insert-description "foobar") E.g. "foobar-string" > + (test-ol-insert-link-get-desc "id:foo-bar")))) > + ;; Lambda case. > + (should > + (string= > + "foobar" > + (test-ol-with-link-parameters-as > + "id" (:insert-description (lambda (_link-test _desc) "foobar")) > + (test-ol-insert-link-get-desc "id:foo-bar")))) "foobar-lambda" Further "foobar-desc-arg", etc. > +`:insert-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 two arguments: the full link text, and the "link text" might be a bit ambiguous here. I would consider "link location", "string containing link type and target", or something else. > + description generated by `org-insert-link'. It should return > + the description to use (this reflects the behaviour of > + `org-link-make-description-function'). If it returns nil, no > + default description is used, but no error is thrown (from the > + user's perspective, this is equivalent to a default description > + of \"\").