From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4HMmFxdTyGDVcgAAgWs5BA (envelope-from ) for ; Tue, 15 Jun 2021 09:13:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id uNCCEhdTyGAXTwAA1q6Kng (envelope-from ) for ; Tue, 15 Jun 2021 07:13:27 +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 C83DA1CFAC for ; Tue, 15 Jun 2021 09:13:26 +0200 (CEST) Received: from localhost ([::1]:60218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lt3GG-0004tt-T1 for larch@yhetil.org; Tue, 15 Jun 2021 03:13:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lt3FU-0004tb-6w for emacs-orgmode@gnu.org; Tue, 15 Jun 2021 03:12:36 -0400 Received: from mail-il1-x131.google.com ([2607:f8b0:4864:20::131]:35706) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lt3FS-0004OO-5Y for emacs-orgmode@gnu.org; Tue, 15 Jun 2021 03:12:35 -0400 Received: by mail-il1-x131.google.com with SMTP id b9so14463862ilr.2 for ; Tue, 15 Jun 2021 00:12:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=k5u/dmMyuw0dypTMLwy09NcKo/nKgo7sgCI3yjFBiyo=; b=omDDdSjG+k+DZlY6jQmiSAKdxbnH4qgJBOGTfP+sMekUCVY1vjVDc4x6pDROdiZJgz ByhB8V9B/uQwBLm7ZIL2+F4ZOdu9GJNTGBO37XUVPnNnx4ZFt7v+h9PjDgKwlcMiDx4p /z1R8OlWZfZlRTsEMScrylVa/6Ano8xS/N+//OHXfCy8xvHUDhhI13UjTVEKmDSf5ZqJ 6JYfur54n8A0fZ4GlkQaBySmlhA3Fq37Nz40koAyqLda9I0Gl/Lbhg6Cb+MVg/36Pgho odiM+PydK6QghWPZ8tdw2LbQvZJC6hLLR8tBgY1woNa0GB/+Q2gqhw5MI8o+5Iljxx8h iLug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=k5u/dmMyuw0dypTMLwy09NcKo/nKgo7sgCI3yjFBiyo=; b=cNOQrD4yTaJZMvrwTXnCI4JkhXyD0UqnDh59vHKHVbRuYPEJclDnbZ5DCBU5PpkVr3 VHDXn7EAJjrGZ6ITlxz9E1G7ptZvtmQ8P+ovR2qLRV6YKq2sVDr1xgP9Q6eu5ACbkbag cx/4FMs05QEXM6xEOGVik10mv9c9xdM7GhVGkTnlrCFpWS9w+9YFbD/fWqT/aiRJRgqj vF7GKpq7w8y4AXII7EMk1oTHqWhvGwJiaVX0nJMJfWVmAZMftgateaDCdiFrdAGzZo2B fuLC4XrN0hEu90ZhF385sI6EtyD/5xiIfpXyW3+R4ok8Url4h3cOQnTvjgxhKV3yHgcB ylsg== X-Gm-Message-State: AOAM531jG/DVxnCu12ifnBdp+uCm8y+jS3FPPakni+PA6EmG0F9G48sx DgFzsoNIvcWM3IkI1dd9WYe206pyF7b4nKAGi7s= X-Google-Smtp-Source: ABdhPJx5huaKMfCsKV2letnuNHb3zj67V8KBrBiFDxpQ3VPUC5yX/foDQnGle45qyWFnYgVnPkqOuIZHm+KiSG2ASOQ= X-Received: by 2002:a92:ca8b:: with SMTP id t11mr16660467ilo.263.1623741152336; Tue, 15 Jun 2021 00:12:32 -0700 (PDT) MIME-Version: 1.0 References: <87sg1nta2t.fsf@nicolasgoaziou.fr> <87im2jytoy.fsf@gmail.com> <87fsxnytln.fsf@gmail.com> <87a6nuuavg.fsf@nicolasgoaziou.fr> In-Reply-To: <87a6nuuavg.fsf@nicolasgoaziou.fr> From: =?UTF-8?Q?Andr=C3=A1s_Simonyi?= Date: Tue, 15 Jun 2021 09:12:21 +0200 Message-ID: Subject: Re: [wip-cite-new] experimental citeproc-el based activation processor To: Timothy , emacs-orgmode list , =?UTF-8?Q?Andr=C3=A1s_Simonyi?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::131; envelope-from=andras.simonyi@gmail.com; helo=mail-il1-x131.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: , 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=1623741207; 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=k5u/dmMyuw0dypTMLwy09NcKo/nKgo7sgCI3yjFBiyo=; b=u4fL93COqZh0SHsa+vRqnO0Uj8GRNcmB0iodX6aHhXKe7uV7s4C2cHix01tUOE4upXHZyN ljnoZgsIIhF9IHr+X0fyBYDS/YPz3cn4CroRo4V+jR/r4O7x/lOoOVLCTpf/peQpmq4rJV R96nA2d+XDDv5Nz3xFJvrJ9joAFNreBrRCh0jegqwJm9cgoXZkJN/rhdmZWNJDTCvcG0rQ 298kDUuyKda5OztQHAhXqKnqYP6vAf2tJKNWLfSabpRMnB08IJDj1CCrIofoF//lE0EjrE pqNWI1UOiL9BveGKrwFIPP0YDXGbAN/nnNHKd7FidCa0acPST9gRcsK4/ecQBA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1623741207; a=rsa-sha256; cv=none; b=J1Qq61beDlq+8LnuL2yW3gpE7MIjRTVHr7/FeGBIu3pwP+Voac4NrM6L/B5ZITTwls7q5J A8TzMlPk2Kun6pzWhjo3LgZviTcEAbACNQcHASgE7wbC0U098gvwbfp/OKgnzOsQ3UGhG9 BnsMNF8dwXztTFKpH830KF8fwkYkcpFgCIBNjsOdvfSJvBNTodl/OeSryD0asvtcdIGPSG kw1LaFnF3u6VobfsWUcfSRmtEUACjhLQ9lS8V6OO7ltkLYoHZznwRZVaaLC4+HWaWTt37/ aHBDUeXbxJtYOM2wxsDX/gstcWRCY5jL2m8ZSurjmFHxtGaMBNqOcDJCoE48Zw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=omDDdSjG; 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: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=omDDdSjG; 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: C83DA1CFAC X-Spam-Score: -3.12 X-Migadu-Scanner: scn0.migadu.com X-TUID: GoLZ10HZejkG Dear All, thanks for the positive feedback, and sorry for the late reply. On Sat, 12 Jun 2021 at 16:46, Nicolas Goaziou wrot= e: > It may make sense to merge it with "oc-csl.el" at some point. If that > suits you, Absolutely, thanks for the suggestion! > In addition, I have a couple of comments: > > - As suggested by Bruce D'Arcus, we might move `org-cite-get-boundaries' > in `oc.el' proper, since it is also used elsewhere (at least in > "oc-basic.el"). sure, it makes more sense there, especially because I took the fragment from your code IIRC (apologies for the lack of explicit attribution) > - Nitpick: (car element) =3D> (org-element-type element) I was actually wondering about this when I wrote the code and if I may nitpick on the nitpick, I find the documentation a bit confusing in this respect. If the list representation is meant to be internal/private only (I guess that is the case), then maybe this should be more explicit in the docstrings, because now the docstring of `org-element-context' says "Return smallest element or object around point. Return value is a list like (TYPE PROPS) [...]" Omitting the second part or having something like "Internally, return value is [...]" would go a long way toward conveying the message that one shouldn't rely on the list representation. > - I think it is inefficient to call `org-element-context' in > `org-cite-csl-activate--sensor-fun'. You may as well store the parsed > object as a text property on the citation during fontification, and > read the property in the function above to know where you are. Thanks for the suggestion, I'll certainly implement this! > - I am also wondering about the call of `org-element-parse-buffer' in > `org-cite-csl-activate-render-all'. It is not wrong per se, but it is > only optimal when citation density in every part of the document is > not low. This might not be the most common case. The other option is > to `re-search-forward' for `org-element-citation-prefix-re' and then > call `org-element-context' at point. > Of course, optimizing `org-cite-csl-activate-render-all' may not be > the top priority, since some latency is to be expected anyway. Thanks for this as well, I'll switch to the more efficient approach you suggested. Best regards, Andr=C3=A1s