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 wNrhGQEw9WHAIAAAgWs5BA (envelope-from ) for ; Sat, 29 Jan 2022 13:16:01 +0100 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 8PdzEgEw9WE6AwEAG6o9tA (envelope-from ) for ; Sat, 29 Jan 2022 13:16:01 +0100 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 E91FD13F74 for ; Sat, 29 Jan 2022 13:16:00 +0100 (CET) Received: from localhost ([::1]:48248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nDme8-0001Vn-10 for larch@yhetil.org; Sat, 29 Jan 2022 07:16:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nDm4P-0005aE-Tx for emacs-orgmode@gnu.org; Sat, 29 Jan 2022 06:39:07 -0500 Received: from [2607:f8b0:4864:20::529] (port=45779 helo=mail-pg1-x529.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nDm4O-0001Bs-0x; Sat, 29 Jan 2022 06:39:05 -0500 Received: by mail-pg1-x529.google.com with SMTP id z131so7594397pgz.12; Sat, 29 Jan 2022 03:38:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PEuldsQi5bso3HPjj0iujFOcu5YoXtTA7oCuBTCCOvI=; b=f/KEDjfHsc5CJG6MivQReTWxUw7x8WzyXgIRCWefFqtyQWnKs8rP/98PkgTjS4g7kX XlC1vq276HKaSN2rK65Bro4tVirL254LSP3nR7paCXfFVOyzJFqD1MZNKGVzChUIX4O5 oRnXG/hPUMj3TZiiuNeH610Wh6qx2OBUGrJSWH9dbr8EoytqRuR842ObBCHwfqcJcBL4 8klmZ5EBq6qwZmX3ZbdvPRif+XI1SJ+r5JMSM8gA1yC6j7N3pSl1hRXtriSSmlra3Fq2 InF+EfgkVsqUncX/iRrIzxxm5aSAxHdXK12ZI/rJTFiEnG+KI0T/4VW1eDXevbJ1y05e ni1A== 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:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PEuldsQi5bso3HPjj0iujFOcu5YoXtTA7oCuBTCCOvI=; b=H2zrygfBdCjLMGR6kSFv+35VFBomk1+d/xFOs/2Kru4YjtEOe8NDOcjlXD44FPSU4A 0GwMjXgIYQSV0yFgKEoHNgaUmcFx4e92phKWn81ksSLMkf2UZPP0LQ7euJ+2hiBypZ6w hwhf2FNxNP/jHj5WCUV9YYA9pO4dY0MPfIdqrmhLJD9ORZUIADaCNhDKflHElJYP+dxu /F50BKg8mTwMdalL9AOHf+fu1qf1fTyI48kxEzxNFRZ4On3lpiaUtpZtPXOsvcnVMrW1 R1x8lap6mEYDL1PLEk5nFmnBQqkWOPjPpHoqVpydIZhp8WoNFUzGbFBuSZCZrQxOuUKV V30g== X-Gm-Message-State: AOAM53123y6OgoROm3WW69/7eAJlAdq7IbPYjraBceD81gi+jfNoQzxA 6t+t871CQ3tUP8zR/G7IFJy+n8FRliOtC7hQ X-Google-Smtp-Source: ABdhPJxUruA0G/MIAit1VqIwqFwKiF+Zkm2TqD7gW5RivX1/6m4von2CiH+n3KUkErAFdFA0gQbSLg== X-Received: by 2002:a63:475e:: with SMTP id w30mr9986719pgk.175.1643456336912; Sat, 29 Jan 2022 03:38:56 -0800 (PST) Received: from localhost ([209.95.60.92]) by smtp.gmail.com with ESMTPSA id q9sm12630886pfj.113.2022.01.29.03.38.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Jan 2022 03:38:56 -0800 (PST) From: Ihor Radchenko To: Bastien , Kyle Meyer , Nicolas Goaziou , Karl Voit , Christian Heinrich , emacs-orgmode@gnu.org Subject: [PATCH 34/35] org-link-make-string: Throw error when both LINK and DESCRIPTION are empty Date: Sat, 29 Jan 2022 19:38:26 +0800 Message-Id: <81afe7c873338c58c03b957f8af59ad6f61498ea.1643454546.git.yantar92@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: <87y2cvloay.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.34.1" Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::529 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=yantar92@gmail.com; helo=mail-pg1-x529.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, 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: Ihor Radchenko Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1643458561; 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: 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=PEuldsQi5bso3HPjj0iujFOcu5YoXtTA7oCuBTCCOvI=; b=SXCuPbpNOAL/j+t8rD/Ww99cYx1d7P9vJE7Xy0bDoK8f7cmys/l3k1JF4JT1QJLUJ5x5w4 5LS9LYP3xM55mnmQ9f0564v/Pm5y8VdeAIN9iVhh2kI++Kwxti3QGhAUxDMJtJE1zVcTES d8qr7ugQg4BuWJoWnK70yLTmfvFNplakERuZQYsaP6ZKnubaZusEyZjJ8d/gX1mAZVVlgZ msCSm/vL6r7hNW2vg6X999mQVUOC+Zm2OqDbSElj8hzqWqJjAveSKK2N5U2TCLPbl/f9gu CsfR//b4M9+K9rNW15RsV1mNtuk/Ogk+mtZoY4TqCJq1/a+MV/PPxS21JmPURw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643458561; a=rsa-sha256; cv=none; b=G4yEOkA50ntxqF9MqKmJDPdZP/1Zhhf1B+oxivmo6h5Beql/zsGJ73G0Stx2M8VSGnZdUw O2FGnndEQWDv2ZmboNBWv6O+46jaCIJ6hTM6+RctXazulVE4jv0+GVozT3lVNtT8Kt6Q2n FEGv4lX3+Gr1esYicKq5Nr8NHQmGorNzoSVjvlED04fJl/sS6it5mF4cq8pB2GcIiw+GcR qBG/jhznCEpa8bxm8VwO72PJrRapTaLKGGmB95+y2zThvTbc2nUbuktMduCv7PGqUHhjjM jDoCoM+LqBKys0cuxB52Wv0nshcw5QUxOhsMyBg58Pax99a71MbBB43xLmzeGg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="f/KEDjfH"; 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: -4.63 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="f/KEDjfH"; 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: E91FD13F74 X-Spam-Score: -4.63 X-Migadu-Scanner: scn0.migadu.com X-TUID: 9tJ+Ajwslcf9 This is a multi-part message in MIME format. --------------2.34.1 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit This behaviour is expected according to `test-ol/make-string'. --- lisp/ol.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --------------2.34.1 Content-Type: text/x-patch; name="0034-org-link-make-string-Throw-error-when-both-LINK-and-.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0034-org-link-make-string-Throw-error-when-both-LINK-and-.patch" diff --git a/lisp/ol.el b/lisp/ol.el index 1837bf37c..2e954a57f 100644 --- a/lisp/ol.el +++ b/lisp/ol.el @@ -999,7 +999,9 @@ (defun org-link-make-string (link &optional description) (replace-regexp-in-string "]\\'" (concat "\\&" zero-width-space) (org-trim description)))))) - (if (not (org-string-nw-p link)) description + (if (not (org-string-nw-p link)) + (or description + (error "Empty link")) (format "[[%s]%s]" (org-link-escape link) (if description (format "[%s]" description) ""))))) --------------2.34.1--