Re: [BUG] @* in [cite/nocite:@*] is a valid special LaTeX bibliography key, but it is highlighted using "error" face by oc.el (was: [PATCH] oc-csl: Add support for nocite citations)

2022-07-04 Thread Bruce D'Arcus
On Mon, Jul 4, 2022 at 8:57 AM András Simonyi  wrote:
> It seems to me that "*" as a key is sophisticated enough that if we have to 
> make a decision
> about the default fontification then it is better to err on the side
> of supposing that a user using it knows what they are doing,

+1

Bruce



Re: [BUG] @* in [cite/nocite:@*] is a valid special LaTeX bibliography key, but it is highlighted using "error" face by oc.el (was: [PATCH] oc-csl: Add support for nocite citations)

2022-07-04 Thread András Simonyi
Dear All,

On Mon, 4 Jul 2022 at 14:27, Ihor Radchenko  wrote:

> András Simonyi  writes:

> I do not agree.
> If someone sets up natbib for latex export and basic for other formats,
> "*" will not be correctly exported in those other formats (because basic
> does not support @* syntax) - something fontification should better
> highlight for the user.

yes, the basic export processor is, well, basic in certain respects.
But then this is the case with more advanced citation styles, e.g.
"locators" as well, which is supported by the biblatex export
processor and not by "basic"; nonetheless, the "basic" activation
processor's fontification doesn't signal "error" if someone uses the
"locators"  style, in fact it doesn't check whether a used citation
style is supported by any of the processors. It seems to me that "*"
as a key is sophisticated enough that if we have to make a decision
about the default fontification then it is better to err on the side
of supposing that a user using it knows what they are doing, Of
course, others' mileage may vary, and it'd be very interesting to hear
other opinions.

best wishes,
András



> Also, are there any similar non-key constructs in latex in addition to "*"?
>
> Best,
> Ihor



Re: [BUG] @* in [cite/nocite:@*] is a valid special LaTeX bibliography key, but it is highlighted using "error" face by oc.el (was: [PATCH] oc-csl: Add support for nocite citations)

2022-07-04 Thread Ihor Radchenko
András Simonyi  writes:

> I think that the problem with simply adding one or more new activation
> processors with different fontification for the "*" key is that Org
> has no way of knowing (at least for sure) which export processor will
> be used for a exporting a certain Org buffer, since it can depend on
> the chosen export backend (see the variable
> org-cite-export-processors). E.g., org-cite could be set up to use the
> "natbib" processor for "LaTeX" export and the "basic" processor for
> any other format.  I think that it'd be more in the spirit of the
> "basic" activation processor to be more permissive and not treat "*"
> as an error, similarly to citation styles not supported by the "basic"
> export processor but supported by others.

I do not agree.
If someone sets up natbib for latex export and basic for other formats,
"*" will not be correctly exported in those other formats (because basic
does not support @* syntax) - something fontification should better
highlight for the user.

Also, are there any similar non-key constructs in latex in addition to "*"?

Best,
Ihor



Re: [BUG] @* in [cite/nocite:@*] is a valid special LaTeX bibliography key, but it is highlighted using "error" face by oc.el (was: [PATCH] oc-csl: Add support for nocite citations)

2022-07-04 Thread András Simonyi
Dear All,

On Sun, 3 Jul 2022 at 15:09, Ihor Radchenko  wrote:

> Then, oc-natbib, oc-biblatex, and oc-csl should be modified to provide
> an alternative activation function that will not highlight @* as
> non-existing key.
>
> Probably, we can even use an alternative "special" key face, not
> 'org-cite-key.

AFAICS, the situation is rather complex: Org (the main branch)
currently contains five export processors (basic, bibtex, natbib,
biblatex and csl), but only a single activation processor called
"basic". Of the five export processors the three LaTeX-based ones
already support the "*" key in nocite citations, and the CSL processor
could also with my proposed patch, leaving only the "basic" one
without this feature.

I think that the problem with simply adding one or more new activation
processors with different fontification for the "*" key is that Org
has no way of knowing (at least for sure) which export processor will
be used for a exporting a certain Org buffer, since it can depend on
the chosen export backend (see the variable
org-cite-export-processors). E.g., org-cite could be set up to use the
"natbib" processor for "LaTeX" export and the "basic" processor for
any other format.  I think that it'd be more in the spirit of the
"basic" activation processor to be more permissive and not treat "*"
as an error, similarly to citation styles not supported by the "basic"
export processor but supported by others.

best wishes,
András