From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id cKc1CKc2/2GPBAEAgWs5BA (envelope-from ) for ; Sun, 06 Feb 2022 03:47:03 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id aASTBac2/2GSFwEA9RJhRA (envelope-from ) for ; Sun, 06 Feb 2022 03:47:03 +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 C93283E8BB for ; Sun, 6 Feb 2022 03:47:02 +0100 (CET) Received: from localhost ([::1]:39374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGXZt-000664-Sl for larch@yhetil.org; Sat, 05 Feb 2022 21:47:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60728) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGXXd-00065v-09 for emacs-orgmode@gnu.org; Sat, 05 Feb 2022 21:44:41 -0500 Received: from ciao.gmane.io ([116.202.254.214]:56318) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGXXa-0002a0-Ts for emacs-orgmode@gnu.org; Sat, 05 Feb 2022 21:44:40 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1nGXXX-0005B0-Ve for emacs-orgmode@gnu.org; Sun, 06 Feb 2022 03:44:35 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Sacha Chua Subject: [PATCH] org-list-send-item: allow dest to be a buffer position Date: Sat, 05 Feb 2022 21:44:29 -0500 Message-ID: <87o83kaf3m.fsf@sachachua.com> Mime-Version: 1.0 Content-Type: text/plain User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cancel-Lock: sha1:RQrqORQB6k0vHo/oBndqiiBYz7k= Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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: , 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=1644115622; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=nn/lvNvbrBGn2TiHGp7K0M7oQ1pZMcEMwbF+w24PmwU=; b=BJtuv6WPMd0mnZrQTihAcobGB6WswOQpsClGYnq0f/Rcd/Suwzq5MBU4JwowHq0bp/QBdh 2Tlo/eJmS2THqfT6bAy92km+8l+dQPWkUYEwWvFv2OZYUxMWl5hjb/P2swT7zDSFGYD6PF M70s+OZbz4w7C/UFx/qYOR8QmdJruFjTNADBtI5fF+qrdJ3ChNKBl86ea0MKA4JD/D+jTo jng0YCyOeRfdnkn0bCKArU6T+9wBD7DBx2+cdLHIrf1tolX1suUj8MvIUPeoRmETl0j4l2 IBrpktOyqCC48NidQpLev2U+RntAIXbBwEx073GtnZ2hA29f9u55ig8/6PssMA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644115622; a=rsa-sha256; cv=none; b=PtIxHhdxWpRIjjn39EYRuPSUtoNoTSQ+PkHj3XvXHe7A6pETiI5BMCEoRYJ/R+MziQd4m/ ktG2tTTHUPpbipoM/angk+tPeQsAodvLm6ofHqJzrgrdVLj9Gg6GgfjvWdKnSM/IG1gmHt 0Qikpx2NTE2oI1DyTkyCKw3GZEKCt+AfodT07j7pCFIkz07o2Xr6qw+nTTd40dYVRjrxbM mFVmapq/X+MkragAtypJTNTldKIu9azmo7TMSD2V7dl5UywsR4B2OdcW6bL569hMLW/G5l zmmrcJgOa9BPBNtnylWxO/bBz312CwK2d2EQL289yMvTfsGgxla67599UCssFA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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: -2.63 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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: C93283E8BB X-Spam-Score: -2.63 X-Migadu-Scanner: scn1.migadu.com X-TUID: w7NYuWCPFAhd Passing an integer representing a buffer position to org-list-send-item was failing because of the string-match-p, so here's something that lets integers skip that part. I have copyright assignment papers on file. Sacha ---------------------------------------------------------------- lisp/org-list.el: org-list-send-item: allow dest to be a buffer position * lisp/org-list.el (org-list-send-item): Check if dest is a string before matching it, to allow dest to be a buffer position. --- lisp/org-list.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-list.el b/lisp/org-list.el index 3533c8319..f1ab2ca76 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -1442,7 +1442,7 @@ (defun org-list-send-item (item dest struct) (save-excursion (goto-char (org-list-get-last-item item struct prevs)) (point-at-eol))) - ((string-match-p "\\`[0-9]+\\'" dest) + ((and (stringp dest) (string-match-p "\\`[0-9]+\\'" dest)) (let* ((all (org-list-get-all-items item struct prevs)) (len (length all)) (index (mod (string-to-number dest) len))) -- 2.25.1