From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gAxDEtCypmEEwQAAgWs5BA (envelope-from ) for ; Wed, 01 Dec 2021 00:25:04 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id sNTlDdCypmHfJAAAbx9fmQ (envelope-from ) for ; Tue, 30 Nov 2021 23:25:04 +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 EB2C82EA5C for ; Wed, 1 Dec 2021 00:25:03 +0100 (CET) Received: from localhost ([::1]:54582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1msCUg-0005n9-WF for larch@yhetil.org; Tue, 30 Nov 2021 18:25:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1msCUC-0005l2-Ux for emacs-orgmode@gnu.org; Tue, 30 Nov 2021 18:24:32 -0500 Received: from [2a00:1450:4864:20::42a] (port=42712 helo=mail-wr1-x42a.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1msCUB-0003J5-1n for emacs-orgmode@gnu.org; Tue, 30 Nov 2021 18:24:32 -0500 Received: by mail-wr1-x42a.google.com with SMTP id c4so47923706wrd.9 for ; Tue, 30 Nov 2021 15:24:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xk77sykBHfqmVNYblBzbAJ/mzqeVZSO0ZcHgPZ0sIbU=; b=Oulper92Rx9+8bJs97mDn+tcl6oA5/zS7Jz2kL8Cydq1a1lr9GzkSjb2CK7K00D/JL QZauetxYU0UpHPUHgRPEq7l0onvXqRz8oPG5ACw+yLGgoVZb2DY8UPZiZPFbMeTjWNSB +k4I5xXbN6GkqUx8O0gIXzJRW5E4ur8Hw4H6DMEph2s1VgKpohSGA2hzcDbSqH/ssiQW 3mtrgLQQHWePNxsZvHREAFFRWgBPLsq/kkkuaFHHxU62LSeqJpTVrptglco2FoNZnuPK LGg0Rsi3sIogtAYr421XVBLG7OzoEiWBEEhkg7kH0EBxM7qk/nHiKn55j3Oxul0M8Jzt IJRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xk77sykBHfqmVNYblBzbAJ/mzqeVZSO0ZcHgPZ0sIbU=; b=pnuFW92Wg2k4DZKF7EqbsNx8ldOEvoAaphMixQINXPsTRv2ddoEO4xlF3hLngtBxci avIhb7iJYPCZbpLkMWw/5A6r5pUwM7522GPpRMHqS0YQuVbOTPXM9XBX1h4LtoYwYA64 aRLQoJrz70Fu1O5EqlKM/hJwvuU6QW1wQMlt/lAWi4IYtf3KywqNLlVyAgWRQEbItTty 3/NCMAltwlCpkayzwv2YbVZB5F4/eXJ5aK6tey8Aq/YTv8AqfWJhYPCLs33BqxMWO739 EM8YJ1nPET7FJfpKabcZgfZPaf9IrO8A++0EKWk8SlxaW5aV3ROKov1jxJEUfrhTclb1 jH5A== X-Gm-Message-State: AOAM530DEelLOQIu0bmFY4cULwelmYIZCcbtnNh/G8DuOhf3m/CCIdC2 uPoUO5W+nxXR9agZlzj26Q05eJw1WBAeYSAL2aAw7eNNDa0= X-Google-Smtp-Source: ABdhPJxF5QFFzwhcwDBz8eNMc644B5OF21hyXWy/haOdGBOm/gVrpfllOu/W3xLeeol3ewCEoliLvW6EPFIPOXhmUW4= X-Received: by 2002:a5d:6a89:: with SMTP id s9mr2344930wru.123.1638314669065; Tue, 30 Nov 2021 15:24:29 -0800 (PST) MIME-Version: 1.0 References: <871r2xr1tr.fsf@gmail.com> In-Reply-To: <871r2xr1tr.fsf@gmail.com> From: Tom Gillespie Date: Tue, 30 Nov 2021 15:24:17 -0800 Message-ID: Subject: Re: Formal syntax for org-cite To: Timothy Content-Type: text/plain; charset="UTF-8" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::42a (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=tgbugs@gmail.com; helo=mail-wr1-x42a.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, 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 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: emacs-orgmode , Nicolas Goaziou 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=1638314704; 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=xk77sykBHfqmVNYblBzbAJ/mzqeVZSO0ZcHgPZ0sIbU=; b=ZxCAdue4BwUzbpSGLb8LOLa9c0Fk5GV8HQMkNQ74noEE7zPyQZGKRUBnxNM7Smhs1SYXHl CWfjYnAH80oFdCFrORfvXg6POnaAEVmBU/bIQfgWnxRpGvaBwSi8V4f3HSLLG/UroB3ltN Z7FdMnTZg/LuuEEOtALtgw+K5F0gKpdEyFdTTJz7pPlQAtZ1AIZTQTxAiLiTnCIry6Tjlq nSZariUIw0Q2sbNzkHUQFOxvxkUvBW/T80GQMNpCucAoQRiTA3TXZ9qDRnUCcPOCYvrU5C UiWHiY7I/jqFAwN5z+MV3uPyTspEbSIxqmLaTuZY1YwtzeXIhk4WDJLoB169IQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638314704; a=rsa-sha256; cv=none; b=YXEHuqdgihrYOA5BN8DxscaKECCHArpixFUlqa3CprRyXZC/gke3j5l9SxITPpRyistHwt wBASq9iCg8VRXP0zm3c1blDmik4ENGKglRA9D3XCHbe2UTsTNYG7SHvfusZM+SYoNR7Ina Rsm/IIltnGn/Gm4Z+CNfQLGPuyDneAZIG809T/DXje91jJmnPNErkW4WOvW/P9gWKCenm3 zuP1poYGcIkGap0buvWDUnZWlWTvXfIGgvIjDXjJf/Gm+zX0fBFQ2yg5kn/4J9TJSXI7Wh 1NngTzkgSn128wnMVVwwQfFn0N791jrlxsHge1C7YGxuVPJHbYRbaPmIF2MQIA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Oulper92; 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.11 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Oulper92; 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: EB2C82EA5C X-Spam-Score: -4.11 X-Migadu-Scanner: scn0.migadu.com X-TUID: vWtqfwk84dGe Hi Timothy, Thanks for putting this together. Comments in line. Best! Tom For reference here is the tokenizer pattern I use in laundry at the moment. There are a number of issues with it ... https://github.com/tgbugs/laundry/blob/5a396bef98d9a3cd9ee929f21cd47612dd6cb1ac/laundry/lex-abbrev.rkt#L896-L913 > Citation syntax is currently not documented, but from the implementation > it looks something like this: > #+begin_example > [cite CITESTYLE: GLOBALPREFIX KEYCITES GLOBALSUFFIX] > #+end_example There is potential confusion here because =[cite= does not have to be followed by a space (rather, cannot be). The top level syntax is =[cite= terminating at the first occurrence of =]=. I think we may also need to include a note that no whitespace is allowed either? It will only be recognized within paragraph context (e.g. headings, paragraphs, and other places where org objects can appear). Stating that up front would clarify that the rest of the syntax described here is how to determine whether the citation is well formed/how to parse it. > =KEY= can be made of any word-constituent character, =-=, =.=, =:=, =?=, > =!=, =`=, ='=, =/=, =*=, =@=, =+=, =|=, =(=, =)=, ={=, =}=, =<=, =>=, > =&=, =_=, =^=, =$=, =#=, =%=, =%=, or =~=. You have a duplicated =%= here. > I have not yet confirmed what =KEYPREFIX= and =KEYSUFFIX= may contain, > but as a starting point, any of the characters allowed in =KEY= except > =@= plus whitespace would seem fairly safe. =KEYSUFFIX= must start with > a whitespace character to be able to be differentiated from =KEY=. I don't think we can allow whitespace here? > =CITESTYLE= consists of a main =STYLE= and any number of =VARIANT=s > (including zero), prefixed by forwards slashes in the following pattern > #+begin_example > /STYLE/VARIANT/VARIANT/VARIANT > #+end_example Need clarification on empty syles e.g. [cite//:] > "cite" and =CITESTYLE=, =KEYCITES= and =GLOBALSUFFIX= are /not/ > separated by whitespace. Neither are =KEYPREFIX=, =@KEY=, or =KEYSUFFIX= > separated by whitespace. I may be missing something, but this is confusing with respect to the statement about =KEYSUFFIX= and whitespace made above.