emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "András Simonyi" <andras.simonyi@gmail.com>
Cc: emacs-orgmode list <emacs-orgmode@gnu.org>
Subject: Re: [wip-cite-new] experimental citeproc-el based activation processor
Date: Sat, 12 Jun 2021 16:46:18 +0200	[thread overview]
Message-ID: <87sg1nta2t.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <CAOWRwxCW+_y489zdjs+7azbbCjdzQPAB5kJZ3k2chLP_HminUQ@mail.gmail.com> ("András Simonyi"'s message of "Sat, 12 Jun 2021 13:30:31 +0200")

Hello,

András Simonyi <andras.simonyi@gmail.com> writes:

> playing with the new citation API (which is already very impressive
> and usable!) I cobbled together an "activation processor" which
> fontifies Org citations using citeproc-el generated previews (when the
> cursor is elsewhere). It also shows the full references as a tooltip
> on mouse-over. Currently everything is very experimental, but if any
> of you is willing to give it a try it can be found at
> https://github.com/andras-simonyi/org-cite-csl-activate, and, of
> course, any feedback is welcome.

This looks very nice already! Thanks for sharing.

It may make sense to merge it with "oc-csl.el" at some point. If that
suits you, there are a few gotchas:

- `alist' library isn't usable in Org, as it didn't exist in Emacs 24.3.
  So, there's unfortunately no `alist-get' for us.

- `<=' was not a variadic function back in Emacs 24.3, so (<= beg
  (point) end) is not possible either.


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").

- Nitpick: (car element) => (org-element-type element)

- 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.

- 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.

WDYT?

Regards,
-- 
Nicolas Goaziou


  reply	other threads:[~2021-06-12 14:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-12 11:30 [wip-cite-new] experimental citeproc-el based activation processor András Simonyi
2021-06-12 14:46 ` Nicolas Goaziou [this message]
2021-06-12 15:43   ` Timothy
2021-06-12 15:45     ` Timothy
2021-06-12 16:03       ` Bruce D'Arcus
2021-06-12 19:43       ` Nicolas Goaziou
2021-06-15  7:12         ` András Simonyi
2021-06-22 18:08           ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sg1nta2t.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=andras.simonyi@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).