From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SOroEeAQLmF3yQAAgWs5BA (envelope-from ) for ; Tue, 31 Aug 2021 13:22:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 6FGfDeAQLmEYPwAA1q6Kng (envelope-from ) for ; Tue, 31 Aug 2021 11:22:08 +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 B88421C5C5 for ; Tue, 31 Aug 2021 13:22:07 +0200 (CEST) Received: from localhost ([::1]:58322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL1qA-0001Wd-No for larch@yhetil.org; Tue, 31 Aug 2021 07:22:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL1iP-0005OH-CX for emacs-orgmode@gnu.org; Tue, 31 Aug 2021 07:14:05 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]:33372) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mL1iN-0005wa-P9 for emacs-orgmode@gnu.org; Tue, 31 Aug 2021 07:14:05 -0400 Received: by mail-pl1-x634.google.com with SMTP id m4so10437013pll.0 for ; Tue, 31 Aug 2021 04:14:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version; bh=vBuZpI3pCtjY8Do6RAKIxxqQxygpmZVoeYyNzj9ngCQ=; b=YhbXojRH6ARQ5kbGmrJajStXVY67+1Kv4bI8ek2Wa1sgUiIQYQPl/PBjQsNUkEYmjS gNs5+SI4pZsKpKhypGD0aRPnwj/s5R6v8VzF9geRWA0diLpeX2NtLza9NR15/euyaDM4 /s8tcoJAS3pCAzDvda3Khb0hhl5Xhbvn0KCgysQG0EtldyXANjPTTiIpilwnwZ7RN50H Ke2/JwSqFiJAjBxY8OoMv96N7M3CLYUY70mjjHU2cD5nqzHCry6dGDss+6QujU+ct94L FgGupHY0ij4g9kkhzHpSeAguWCS0/n52v0m5swaDdYSyk2qKNzIgRc5JnNDGrZ2VmGfb gfJw== 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:cc:subject:date :in-reply-to:message-id:mime-version; bh=vBuZpI3pCtjY8Do6RAKIxxqQxygpmZVoeYyNzj9ngCQ=; b=lIrIBZxsKsVgBPffgs+RnepJgVhId7ARQbbiNxleYkQ7mIAmPKC8Kf2wRWF4g+HIyw 5gganWP46BUAdEb4SA80ErmDfy7/92vodGXYmXrieTJPM4tr0TUzToiJAUTMR7cGRdTH 2G8TDPDjUBlpJd63nv8272cTL80wzBe9J2k/o3t7TM2vW8iLIreKQAo7IgYcB2RYthvG vDL1Q672A1QJG9GLn6ecNarBjxe7f4TqmRhesxzTEuEZVOgJ9ZJyT0dI39KCWPQUa8cn qtnQBFJLCOwdzjpjvg4konp95bN2+cTzOCpgyT+dGsrbg3lWG87KiklVCUHXHMGTBJRe haIQ== X-Gm-Message-State: AOAM531XbziU//+LWGPSGN4lyvuo0l+nO3Tsw/xy/FOF0pxr6XB7gy1Y Iocfw2Nfg3o8PfPt++5w0WI= X-Google-Smtp-Source: ABdhPJzBg/wjqJQIcJWyLAbgkO0JZsEFMigr+MS8O3sf9Fy1Z6wySRXNOqIoIBlcqTE/33zP1i+k5w== X-Received: by 2002:a17:90a:12:: with SMTP id 18mr4959815pja.104.1630408442461; Tue, 31 Aug 2021 04:14:02 -0700 (PDT) Received: from localhost (61-245-128-160.3df580.per.nbn.aussiebb.net. [61.245.128.160]) by smtp.gmail.com with ESMTPSA id gw11sm2663257pjb.38.2021.08.31.04.14.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Aug 2021 04:14:01 -0700 (PDT) References: User-agent: mu4e 1.6.5; emacs 28.0.50 From: Timothy To: Yuu Yin Subject: Re: org-cite: enable inserting citation (org-cite-insert) after list bullet [9.5 (9.5-7c78aca @ /home/yuu/.config/emacs/straight/build/org/)] Date: Tue, 31 Aug 2021 18:24:57 +0800 In-reply-to: Message-ID: <87a6kxq32h.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=tecosaur@gmail.com; helo=mail-pl1-x634.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, 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: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630408927; 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=vBuZpI3pCtjY8Do6RAKIxxqQxygpmZVoeYyNzj9ngCQ=; b=OQmRbRLEF9wOvbBmXNA6d0E+wy7DWAdkuGhaWVhRgA6Ww3SXDKqz0j3rnei7p8HMiWHt44 Hi/l2nlGVtpDm2T8wQ3nGn1M7vTQ7LY20R18uhqIsf1hPk9Fdaf7iKAXLzASnYX7UY5gOW NOewMGykr8s+Z19+x3kXni/1ffUauJUNCm5EnKwuAYhMyY+CXX+vK+QnZcg2zUkrFc1gpk ktElKrrVKzWiJnE7K7BtcqqBw+14GpF2apHVj+6YpdnQtRfTS39OVvXowulmheyxWCQQR6 Fno9V7xNLoZhpBJmPHFtG31QMi2iMgHJuSuATjvr5JI5NDO/+/ecfHw7KB8xfg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630408927; a=rsa-sha256; cv=none; b=r8ujE6bc4XFqQwv8iYOzvDyMaWo21SOqOgzIiYHmiu0SxdOL8inKS0KRqfJZ0HtfTFO31m kjaSMPyATLBAZy0Z98dovTy/+zCQjraSzTKfIXeENbDt4MIKq9VDWg45VB06QQ4/BwNC8M gWOWppjCbCEGMSgJfgzcdVNV/ySoQzXq/d8xHh/WEtaDLNbkyLNt/9Ul13vGC4wZ7p0Nfn PbCj/ysjQZisBwpVjXrM3d974TFInapgicfKhc/i1e/Jryf3yuj3ajWZ2/Z85DKtf9bGz/ Ab1KCUM22iS/Mmc6PO1i2oIwgt99dqc2/ZXaRwOgkf5tSes+LKJ3WyJPUhkcmQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=YhbXojRH; 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-Migadu-Spam-Score: -1.62 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=YhbXojRH; 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-Migadu-Queue-Id: B88421C5C5 X-Spam-Score: -1.62 X-Migadu-Scanner: scn0.migadu.com X-TUID: hoZTxaJ6uRNr --=-=-= Content-Type: text/plain Yuu Yin writes: > Invoking ~org-cite-insert~ after list bullets (e.g. ~-~ and ~1.~ ) > doesn't work. I did a little test myself, and can confirm that it's not currently possible to insert a citation *immediately* after a bullet and space. This can be checked with `org-cite--allowed-p'. Thinking about this situation, inserting citations should be fine as long as the `point' isn't before or immediately after the bullet itself (i.e. no space). I've prepared a patch that fixes this (attached). This is the test case that I'm adding: + ((eq type 'item) + (> (point) (+ (org-element-property :begin context) + (org-get-indentation) + 1))) As this is so simple, if nobody has any comments I'll push this in a week or so. -- Timothy --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-oc-allow-citations-following-an-item-bullet.patch >From 8a242b6c80c2ec2b384f12c16bb9f70c2d44c9c7 Mon Sep 17 00:00:00 2001 From: TEC Date: Tue, 31 Aug 2021 19:03:19 +0800 Subject: [PATCH] oc: allow citations following an item bullet * lisp/oc.el (org-cite--allowed-p): Expand the allowed cases to include "item", which lets one insert a citation following a bullet, e.g. "- ". We just have to check to make sure the citation actually is at least one character away from the bullet. --- lisp/oc.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/oc.el b/lisp/oc.el index 5fcb9da62..7ffe37e57 100644 --- a/lisp/oc.el +++ b/lisp/oc.el @@ -1426,6 +1426,11 @@ (defun org-cite--allowed-p (context) ((= (point) (org-element-property :begin context))) ;; Within recursive object too, but not in a link. ((eq type 'link) nil) + ;; At the start of a list item is fine, as long as the bullet is unaffected. + ((eq type 'item) + (> (point) (+ (org-element-property :begin context) + (org-get-indentation) + 1))) ((eq type 'table-cell) ;; :contents-begin is not reliable on empty cells, so special ;; case it. -- 2.33.0 --=-=-=--