From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id kMnRC+CgbV+DPQAA0tVLHw (envelope-from ) for ; Fri, 25 Sep 2020 07:48:48 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id KGTaB+CgbV/iSAAA1q6Kng (envelope-from ) for ; Fri, 25 Sep 2020 07:48:48 +0000 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 6C2619402B6 for ; Fri, 25 Sep 2020 07:48:47 +0000 (UTC) Received: from localhost ([::1]:42194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kLiTF-0006J1-2m for larch@yhetil.org; Fri, 25 Sep 2020 03:48:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kLiSr-0006Ip-1t for emacs-orgmode@gnu.org; Fri, 25 Sep 2020 03:48:21 -0400 Received: from mail-qt1-x836.google.com ([2607:f8b0:4864:20::836]:43031) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kLiSp-000607-Gf for emacs-orgmode@gnu.org; Fri, 25 Sep 2020 03:48:20 -0400 Received: by mail-qt1-x836.google.com with SMTP id g3so1155688qtq.10 for ; Fri, 25 Sep 2020 00:48:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:in-reply-to:date:message-id :mime-version; bh=/wSn/K7hpc24vs1TYIVLx13HyB6HEM068C85jk1czUI=; b=XKhbNJm7N5igN7zxkJ6hTi1uMViYZYZ/Qu3fcH3fNkXBdWR0FFeru5NVHdcwdp9qML 9CIhKRRENJCR1HQQKwGdET0+14DDxxn+XWgyrNvyQm5hSHurhtcMdWj/1QIE7GbJtyvU KUF0N0H2Po2Kvi9Vsd1aiITzF9BO/gkt4VBuG3mXjHSvbDLOEtjg56U0g1yEyHNLvdG4 ovSk0tHcywkfgOFnMbWi7DxjQuYpXBNMSXh7nuope62Hezs+WypQ+Wm3LPJ5kOgi2xSP ZWysiyLkrXwp3sIqeiLBbS6PfqdPqrC+BmuTOpWVxiBkNJhg9Cf8jrgkwa29lIyX4au1 FXuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject :in-reply-to:date:message-id:mime-version; bh=/wSn/K7hpc24vs1TYIVLx13HyB6HEM068C85jk1czUI=; b=WSJHu/1rms+FSohR1IaVWFvtzEO3W+TW2yT7afZFMY00gZnBmQ2j8jQcJnm3l/hogn QpX12DmUKWKB63lFdjuL1LVNhM0mBedBP9m84OXFTxSbEVT/HkxDeInMCfgRHUA3nU9F sg4t0xlEd9B6tEO9H9+8PESEHvLy7YRPUfJX38Ae/Vk5YGtFSitLAmDti7JpVpL2BOmo CemZMoyomxG+WBu06yEoGLoNJvxYW+oo3C0WdU6W9/xQSLQ4IdoUQRUVL3FXsbleSPr2 Kd1zj4YTrNiC/qW2zKFg6hojvUFygVPNgcy889ftM8D5O5lO2/jLptHbZWPaw3UTqWgp QuwQ== X-Gm-Message-State: AOAM5306OjgmCNbfjYgGSMnjwmNrDzt1M4afTV8032KwAtFTgfJcueQW 3JEHusYCEe9lT/xzP0/2JFnMKXr39IkDlQ== X-Google-Smtp-Source: ABdhPJw3UZ55NFTcnOoAPJp0yVZieEuC22iFGINzarWF6O/bY/e46AOwZoh/HHv/63mtWc2/cxI2dw== X-Received: by 2002:aed:24c9:: with SMTP id u9mr3135078qtc.292.1601020097359; Fri, 25 Sep 2020 00:48:17 -0700 (PDT) Received: from laptop ([2601:8b:c300:1024:3635:54a:8d7c:f1d8]) by smtp.gmail.com with ESMTPSA id m10sm1424474qti.46.2020.09.25.00.48.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Sep 2020 00:48:16 -0700 (PDT) References: <87d02al383.fsf@gmail.com> User-agent: mu4e 1.5.5; emacs 28.0.50 From: No Wayman To: emacs-orgmode@gnu.org Subject: Re: Bug: org-capture: %L causes arg out of range error for empty string annotation [9.4 (release_9.4-31-g8c44f2 @ /home/n/.emacs.d/straight/build/org/)] In-reply-to: <87d02al383.fsf@gmail.com> Date: Fri, 25 Sep 2020 03:48:14 -0400 Message-ID: <87lfgyz48x.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::836; envelope-from=iarchivedmywholelife@gmail.com; helo=mail-qt1-x836.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 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-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=XKhbNJm7; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -0.21 X-TUID: A483irxBFecI --=-=-= Content-Type: text/plain; format=flowed No Wayman writes: > If `v-a' is an empty string, the call to `replace-match' throws > an > Args out of range error. Similar assignments in that area of the > code use an `and' comparison to guard against this, so perhaps > it > should be: > > >> (v-L (if (and v-a (string-match l-re v-a)) >> (replace-match "\\1" nil nil v-a) >> v-a)) See attached patch --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-capture-Fix-bare-link-Args-out-of-range.patch >From be476c236e40dd0ba87be9d466dd5cd00a6960b7 Mon Sep 17 00:00:00 2001 From: Nicholas Vollmer Date: Fri, 25 Sep 2020 03:42:57 -0400 Subject: [PATCH] capture: Fix bare link "Args out of range" * lisp/org-capture.el (org-capture-fill-template): guard against empty annotation string --- lisp/org-capture.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-capture.el b/lisp/org-capture.el index a6e95f24e..67c58ffdd 100644 --- a/lisp/org-capture.el +++ b/lisp/org-capture.el @@ -1595,7 +1595,7 @@ The template may still contain \"%?\" for cursor positioning." (v-l (if (and v-a (string-match l-re v-a)) (replace-match "[[\\1]]" nil nil v-a) v-a)) - (v-L (if (or v-a (string-match l-re v-a)) + (v-L (if (and v-a (string-match l-re v-a)) (replace-match "\\1" nil nil v-a) v-a)) (v-n user-full-name) -- 2.28.0 --=-=-=--