emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "Bruce D'Arcus" <bdarcus@gmail.com>
Cc: Org Mode List <emacs-orgmode@gnu.org>,
	Denis Maier <denismaier@mailbox.org>
Subject: Re: (Not so) Short note about citations in Org
Date: Mon, 26 Apr 2021 22:02:36 +0200	[thread overview]
Message-ID: <87czugx19f.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <CAF-FPGO4tYuoPkKCtrveNBeeL_u7QNeJfTG+Wc6UW-kSMQXiEg@mail.gmail.com> (Bruce D'Arcus's message of "Mon, 26 Apr 2021 14:36:38 -0400")


"Bruce D'Arcus" <bdarcus@gmail.com> writes:

> On this, on the other (big) wip-cite thread, Nicolas said the following:
> "A drawback with allowing emphasis there is that prefix and suffix become
> parsed data and not plain string anymore. As a consequence, searching
> through them, e.g., when looking for locator names, requires an
> additional level of indirection, since you need to first transform
> parsed data back into plain text."
> Nicolas: I get that you need more code to do this, but are there other
> practical consequences of allowing more than plain-text?

The code I need to write does not count, really. It is 10 locs at most,
without the tests. 

My concern is the additional burden for processor developers. They will
need to shift from one representation to the other, this is not
convenient. Also some tasks then become an order of magnitude harder.

For example, let's consider the suffix: " p.32 and following" If it is
plain text, I can recognize p.32 as a locator, and replace it with "page
32" using something like `replace-regexp-in-string'.

Now, if it is a somewhat opaque parsed string, I need to first expand
it, for example with `org-element-interpret-data', modify the output as
above, and then parse it again to get a new parsed string.

I can no longer (concat "(" prefix author "," year suffix ")") either,
because prefix and suffix are not strings anymore. I need to

  (format "(%s%s, %s%s)"
          (org-export-data prefix info)
          (org-export-data author info)
          year    ;I assume year cannot contain problematic characters
          (org-export-data suffix info))

So, nothing impossible, but still slightly inconvenient.

Nicolas Goaziou

  reply	other threads:[~2021-04-26 20:03 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-21 23:34 Nicolas Goaziou
2021-04-22  0:15 ` Bruce D'Arcus
2021-04-22  0:35   ` Nicolas Goaziou
2021-04-22  0:56     ` Bruce D'Arcus
2021-04-22 12:02 ` Bruce D'Arcus
2021-04-22 13:14   ` Nicolas Goaziou
2021-04-22 13:23     ` Bruce D'Arcus
2021-04-22 17:47 ` M. ‘quintus’ Gülker
2021-04-22 20:44   ` Bruce D'Arcus
2021-04-24  7:53   ` Nicolas Goaziou
2021-04-24  0:07 ` Bruce D'Arcus
2021-04-24  7:53   ` Nicolas Goaziou
2021-04-24 11:40     ` Bruce D'Arcus
2021-04-25 21:19 ` Denis Maier
2021-04-26 18:36   ` Bruce D'Arcus
2021-04-26 20:02     ` Nicolas Goaziou [this message]
2021-04-26 20:13       ` Denis Maier
2021-04-26 20:14       ` Denis Maier
2021-04-26 20:33         ` Nicolas Goaziou
2021-04-26 20:38           ` Denis Maier
2021-04-26 21:11             ` Nicolas Goaziou
2021-04-26 21:52               ` Denis Maier
2021-04-26 21:15             ` Joost Kremers
2021-04-27 12:21       ` Bruce D'Arcus

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:

  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=87czugx19f.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=bdarcus@gmail.com \
    --cc=denismaier@mailbox.org \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: (Not so) Short note about citations in Org' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:


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