From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: Citation syntax: a revised proposal Date: Tue, 03 Mar 2015 14:57:37 +0000 Message-ID: <87sidm2kny.fsf@gmail.com> References: <87k2zjnc0e.fsf@berkeley.edu> <87bnkvm8la.fsf@berkeley.edu> <87zj8co3se.fsf@berkeley.edu> <87ioezooi2.fsf@berkeley.edu> <87mw4bpaiu.fsf@nicolasgoaziou.fr> <8761aznpiq.fsf@berkeley.edu> <87twyjnh0r.fsf@nicolasgoaziou.fr> <87oaopx24e.fsf@berkeley.edu> <87k2zd4f3w.fsf@nicolasgoaziou.fr> <87egpkv8g9.fsf@berkeley.edu> <877fv6xfaq.fsf@gmail.com> <87twya2ak0.fsf@berkeley.edu> <87zj81aa97.fsf@nicolasgoaziou.fr> <87ioep2r6p.fsf@berkeley.edu> <87y4ngbgm7.fsf@nicolasgoaziou.fr> <87bnkbi61v.fsf@gmail.com> <877fuzruin.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSoGg-00064w-Pc for emacs-orgmode@gnu.org; Tue, 03 Mar 2015 09:57:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSoGd-00082I-GJ for emacs-orgmode@gnu.org; Tue, 03 Mar 2015 09:57:54 -0500 Received: from mail-wg0-x22c.google.com ([2a00:1450:400c:c00::22c]:38792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSoGd-00082B-6O for emacs-orgmode@gnu.org; Tue, 03 Mar 2015 09:57:51 -0500 Received: by wgha1 with SMTP id a1so40552253wgh.5 for ; Tue, 03 Mar 2015 06:57:50 -0800 (PST) In-Reply-To: <877fuzruin.fsf@gmx.us> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rasmus , emacs-orgmode@gnu.org Hi Rasmus, 2015ko martxoak 2an, Rasmus-ek idatzi zuen: >=20 > Looks cool Aaron. Thanks! >=20 > Aaron Ecay writes: >=20 >> The first issue is that the parser includes trailing punctuation in >> =E2=80=9Cbare=E2=80=9D @key citations. So the following does not work a= s expected (the >> :key includes the period): =E2=80=9CThis was demonstrated most recently = by >> @Smith2015.=E2=80=9D I=E2=80=99m not sure what the right approach is = =E2=80=93 one option >> would be to say that keys can contain punctuation, but must end (and >> begin) with an alphanumeric character. >=20 > I also tried to solve this in the attached patch. Feel free to use it in > the unlikely case that it adds anything to your fix (I didn't check). > Note, cf. my other recent post, this should probably be part of a > citations object rather than a citation object (assuming you take my idea > at good value). It looks like the patch you sent also adds support for subtypes. Rather than try to distill the essential bit from it, I=E2=80=99ll wait for you an= d/or Nicolas to get to it (there=E2=80=99s no particular hurry...) I=E2=80=99m not sure I=E2=80=99m happy about the citations/citation proposa= l (under any assignment of different names to the pieces). A citations containing only one citation is degenerate: it can never have a :prefix or :suffix (these will rather be attached to the lone daughter citation). That=E2=80= =99s a smell in my book. It also makes the latex export more complicated: a one-daughter citations should export as \textcite etc., whereas a multi-daughter one will be \multicite. From my perspective it would be more straightforward to only have the citations wrapper be generated if there are actually multiple citations. But I don=E2=80=99t know how that would a= ffect the parser, so you should do what seems best to you. Another tangentially related issue is what does (org-element-context) return when point is in a multi-citation. It would be nice if it returned the citation daughter, rather than the wrapping citations element. This would make implementing goto-citation-at-point very easy. >> -> How much of the non-latex citation code is it worth implementing in >> elisp. >=20 > As little as possible, though a highlevel API is nice, e.g. being able to > make a citepos using (concat (citeauthor cite) "'s" (citeyear cite)). I think I have an idea for this (though based on string templates rather than list forms). > I haven't tried org-ref, but isn't it just reftex?=20=20 I haven=E2=80=99t either, but my impression is that, while perhaps based on reftex, there=E2=80=99s a lot of spit and polish that goes into making it w= ork nicely. It would be nice to be able to =E2=80=9Csteal=E2=80=9D that becaus= e... > If so something like this >=20 > (add-to-list 'reftex-cite-format-builtin > '(org "Org-mode citation" > ((?t . "[cite:%l]") > (?p . "[parencite:%l]")))) >=20 > Should work. We'd automatically add subtypes and maybe make an > intelligent choice based on whether prefix and postfix is used.=20=20 Every time I=E2=80=99ve looked at the reftex internals I get grumpy, because they are heavily tuned towards latex usecases, and involve some weird cache structure which manipulates the plist of an interned symbol. So customizing it for org always seems precarious. In the long term I=E2=80= =99d be happy if we built something out of more easily composable pieces. > Another idea would be to use the ox-export dispatcher code, somehow... If this was a composable piece I=E2=80=99d be happy (I haven=E2=80=99t look= ed at it). There was also an attempt to factor the menu code out of magit (called makey IIRC). I=E2=80=99ve used it for some small things, but it wasn=E2=80= =99t terribly pleasant. >=20 >> PS the code uses relatively new functions from the subr-x and let-alist >> libraries, so it probably works best on a recent-ish (past few months) >> trunk version of emacs. >=20 > In another post, Nicolas said we can target (at least?) 24.4 for v8.4. > I'm assuming citation won't make 8.3... What about XEmacs? That=E2=80=99s another stumbling block. Thanks, --=20 Aaron Ecay