Re: [patch] Fix inner smart quotes in French

2023-08-24 Thread Bastien Guerry
Ihor Radchenko  writes:

> Agree. We can factor out the language names into a separate constant and
> then use that constant as a source of "canonical" language names in
> :type definitions of defcustom. Then, we can turn all the other
> dictionary variables into defcustoms.

Yes, sounds good!

-- 
 Bastien Guerry



Re: [patch] Fix inner smart quotes in French

2023-08-23 Thread Ihor Radchenko
Bastien Guerry  writes:

> From the same quick look, I believe `org-export-dictionary' contains
> more entries than other variables--we could use languages names from 
> this variable.
>
> WDYT?

Agree. We can factor out the language names into a separate constant and
then use that constant as a source of "canonical" language names in
:type definitions of defcustom. Then, we can turn all the other
dictionary variables into defcustoms.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [patch] Fix inner smart quotes in French

2023-08-22 Thread Bastien Guerry
Ihor Radchenko  writes:

> Bastien Guerry  writes:
>
> Are you referring to `org-export-smart-quotes-alist'? It is a defconst.

 Ah, indeed.  I'd say using a defcustom here would be useful.
>>>
>>> Is changing defconst to defcustom ok for bugfix?
>>
>> Nope, it's more an "evolution" than a bugfix.
>
> Ok. I changed it to defcustom on main.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=570cdacdb
>
> Note, however, that we have `org-export-dictionary' as a constant.
> Also, language names are not standardized across
> `org-export-dictionary', `org-export-default-language',
> `org-clock-clocktable-language-setup', `org-export-smart-quotes-alist',
> and `org-latex-language-alist'.

>From a quick look, I cannot find two conflicting language names (that
is, two strings like "fr" that refer to two distinct languages from
the variable you mention).

>From the same quick look, I believe `org-export-dictionary' contains
more entries than other variables--we could use languages names from 
this variable.

WDYT?

-- 
 Bastien Guerry



Re: [patch] Fix inner smart quotes in French

2023-08-15 Thread Ihor Radchenko
Bastien Guerry  writes:

 Are you referring to `org-export-smart-quotes-alist'? It is a defconst.
>>>
>>> Ah, indeed.  I'd say using a defcustom here would be useful.
>>
>> Is changing defconst to defcustom ok for bugfix?
>
> Nope, it's more an "evolution" than a bugfix.

Ok. I changed it to defcustom on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=570cdacdb

Note, however, that we have `org-export-dictionary' as a constant.
Also, language names are not standardized across
`org-export-dictionary', `org-export-default-language',
`org-clock-clocktable-language-setup', `org-export-smart-quotes-alist',
and `org-latex-language-alist'.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [patch] Fix inner smart quotes in French

2023-08-14 Thread Bastien Guerry
Ihor Radchenko  writes:

> Bastien Guerry  writes:
>
>>> Are you referring to `org-export-smart-quotes-alist'? It is a defconst.
>>
>> Ah, indeed.  I'd say using a defcustom here would be useful.
>
> Is changing defconst to defcustom ok for bugfix?

Nope, it's more an "evolution" than a bugfix.

-- 
 Bastien Guerry



Re: [patch] Fix inner smart quotes in French

2023-08-13 Thread Ihor Radchenko
Bastien Guerry  writes:

>> Are you referring to `org-export-smart-quotes-alist'? It is a defconst.
>
> Ah, indeed.  I'd say using a defcustom here would be useful.

Is changing defconst to defcustom ok for bugfix?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [patch] Fix inner smart quotes in French

2023-08-13 Thread Bastien Guerry
Ihor Radchenko  writes:

>> It's difficult to say what's more common but since we cannot expect
>> the « « inner » » style to be correctly implemented in, say, HTML, and
>> since, even in LaTeX, babel-french defaults to the « “inner” » style,
>> I suggest we stick to the « “inner” » style (this is a defcustom and
>> users can change it.)
>
> Are you referring to `org-export-smart-quotes-alist'? It is a defconst.

Ah, indeed.  I'd say using a defcustom here would be useful.

-- 
 Bastien Guerry



Re: [patch] Fix inner smart quotes in French

2023-08-13 Thread Ihor Radchenko
Bastien Guerry  writes:

>> What I
>> don't know is why babel-french defaults to the « “inner” » style. Is it
>> the most used currently in France? If the « « inner » » style is more
>> canonical, I don't mind having my patch 'fix' reverted.
>
> It's difficult to say what's more common but since we cannot expect
> the « « inner » » style to be correctly implemented in, say, HTML, and
> since, even in LaTeX, babel-french defaults to the « “inner” » style,
> I suggest we stick to the « “inner” » style (this is a defcustom and
> users can change it.)

Are you referring to `org-export-smart-quotes-alist'? It is a defconst.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [patch] Fix inner smart quotes in French

2023-08-13 Thread Bastien Guerry
Hi Juan,

Juan Manuel Macías  writes:

> In any case (apart from LaTeX), it is clear that I was wrong when I said
> that the inner quotes that my patch 'corrects' were 'incorrect'. 

Indeed, and thanks for the discussion, interesting.

> What I
> don't know is why babel-french defaults to the « “inner” » style. Is it
> the most used currently in France? If the « « inner » » style is more
> canonical, I don't mind having my patch 'fix' reverted.

It's difficult to say what's more common but since we cannot expect
the « « inner » » style to be correctly implemented in, say, HTML, and
since, even in LaTeX, babel-french defaults to the « “inner” » style,
I suggest we stick to the « “inner” » style (this is a defcustom and
users can change it.)

Thanks!

-- 
 Bastien Guerry



Re: [patch] Fix inner smart quotes in French

2023-08-10 Thread Juan Manuel Macías
Bastien writes:

> Yes, this is also what the French national printing press ("Imprimerie
> nationale"), which is quite authoritative in this matter, recommends.
>
> Note that the Full recommendation of the Imprimerie nationale is to
> repeat second-level quotation marks at the beginning and of each line
> when the text spans over several lines, like this:
>
>   Then X reported : « This is what Y said : « Here is
>   « a quotation with a paragraph spaning over several
>   « lines, with each line starting with a quotation mark
>   « until the end of the quotation. » 
>
> (The unique » at the end is intentional, the rule is to not repeat.)

I've been looking at the babel-french documentation (LaTeX)
(http://mirrors.ctan.org/macros/latex/contrib/babel-contrib/french/frenchb.pdf),
which claims to be based on "Lexique des règles typographiques en usage
à l’Imprimerie Nationale, troisième édition (1994)"; p. 3 is about
quotation marks and the different options:

-
with all engines: the inner quotation is surrounded by double quotes
(“texte”) unless option InnerGuillSingle=true, then a) the inner
quotation is printed as ‹ texte › and b) if the inner quotation spreads
over more than one paragraph, every paragraph included in the inner
quotation starts with a ‹ or a › or nothing, depending on option
EveryParGuill=open (default) or =close or =none.

with LuaTeX based engines, it is possible to add a French opening or
closing guillemet (« or ») at the beginning of every line of the inner
quotation using option EveryLineGuill=open or =close; note that with any
of these options, the inner quotation is surrounded by French guillemets
(« and ») regardless option InnerGuillSingle; the default is
EveryLineGuill=none so that \frquote{} behaves as with non-LuaTeX
engines.
-

I have tried this example with quotes per line:

https://i.imgur.com/od4HwUs.png

In any case (apart from LaTeX), it is clear that I was wrong when I said
that the inner quotes that my patch 'corrects' were 'incorrect'. What I
don't know is why babel-french defaults to the « “inner” » style. Is it
the most used currently in France? If the « « inner » » style is more
canonical, I don't mind having my patch 'fix' reverted.

-- 
Juan Manuel Macías 

https://juanmanuelmacias.com

https://lunotipia.juanmanuelmacias.com

https://gnutas.juanmanuelmacias.com




Re: [patch] Fix inner smart quotes in French

2023-08-10 Thread Max Nikulin

On 10/08/2023 21:49, Bastien wrote:

So I'd rather use this:

   Then X reported : « This is what Y said : ”Here is
   a quotation with a paragraph spaning over several
   lines, with each line starting with a quotation mark
   until the end of the quotation."»

WDYT?


I do not mind since I see that it is a conscious decision and this 
particular case does not affect me directly.


In general however I would rely on CLDR data as much as possible to 
limit maintenance to a converter to a format more suitable for elisp and 
perhaps to a small subset of overrides.




Re: [patch] Fix inner smart quotes in French

2023-08-10 Thread Bastien
Max Nikulin  writes:

> On 04/08/2023 18:09, Bastien wrote:
>> Juan Manuel Macías writes:
>> 
>>> In the meantime, I'm submitting this patch with a fix for second-level
>>> French `smart quotes': the correct quotes should be “” (without spaces,
>>> as in Spanish or Greek) (please, some francophone correct me, if I'm
>>> wrong...).
>> Applied, thanks!
>
> I am not a francophone, I just have tried to look into sources I found
> during discussion on Greek quotes.
>
> https://en.wikipedia.org/wiki/Quotation_mark#French
> says that there are different styles of inner quotes.
>
> I am more worry that Unicode CLDR defines the same character for
> quotes. 

Yes, this is also what the French national printing press ("Imprimerie
nationale"), which is quite authoritative in this matter, recommends.

Note that the Full recommendation of the Imprimerie nationale is to
repeat second-level quotation marks at the beginning and of each line
when the text spans over several lines, like this:

  Then X reported : « This is what Y said : « Here is
  « a quotation with a paragraph spaning over several
  « lines, with each line starting with a quotation mark
  « until the end of the quotation. » 

(The unique » at the end is intentional, the rule is to not repeat.)

I don't have a strong opinion on this.  I find the non-French
(e.g. canadian?) convention more sensible for digital documents (vs
printed ones): I expect repeating the quotation mark at the beginning
of each line is something software don't do.  (Perhaps there is a
LaTeX package doing so, I've not checked.)

So I'd rather use this:

  Then X reported : « This is what Y said : ”Here is
  a quotation with a paragraph spaning over several
  lines, with each line starting with a quotation mark
  until the end of the quotation."»

WDYT?

-- 
 Bastien



Re: [patch] Fix inner smart quotes in French

2023-08-10 Thread Max Nikulin

On 04/08/2023 18:09, Bastien wrote:

Juan Manuel Macías writes:


In the meantime, I'm submitting this patch with a fix for second-level
French `smart quotes': the correct quotes should be “” (without spaces,
as in Spanish or Greek) (please, some francophone correct me, if I'm
wrong...).


Applied, thanks!


I am not a francophone, I just have tried to look into sources I found 
during discussion on Greek quotes.


https://en.wikipedia.org/wiki/Quotation_mark#French
says that there are different styles of inner quotes.

I am more worry that Unicode CLDR defines the same character for quotes. 
However inner quotes varies across languages:


fr.xml: «
fr.xml: »
fr.xml: «
fr.xml: »

fr_CA.xml:  ”
fr_CA.xml:  “
fr_CH.xml:  ‹
fr_CH.xml:  ›

I would prefer to keep consistency with CLDR.




Re: [patch] Fix inner smart quotes in French

2023-08-05 Thread Ihor Radchenko
Juan Manuel Macías  writes:

>> And it looks like at least on of the test conditions is not trivial to
>> fix without knowing French. May you or somebody familiar with French
>> punctuation take a look?
>
> I'm afraid I'm not very familiar with the syntax and usage of tests, so
> I have to study that part. I've been looking at
> `test-org-export/activate-smart-quotes', and I have a question: does it
> only include tests for English and French cases?

Yes, currently.

> First level quotes for French are «» with spaces, and second level ones
> (if I'm not mistaken) should be “”, without spaces (my patch fix).
> Therefore, I understand that a line like:
>
>(equal '( "« outer « inner » outer »")
>
> should it be changed like this
>
>(equal '( "« outer “inner” outer »")
>
> ?

That was exactly the piece of information I was missing.
I have no notion of "inner" quotes being different from "outer" in the
languages I am familiar with.

I now managed to fix the tests.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=e4f127437

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [patch] Fix inner smart quotes in French

2023-08-05 Thread Juan Manuel Macías
Hi, Ihor,

Ihor Radchenko writes:

> Welcome back :)

thanks! :-)

>> In the meantime, I'm submitting this patch with a fix for second-level
>> French `smart quotes': the correct quotes should be “” (without spaces,
>> as in Spanish or Greek) (please, some francophone correct me, if I'm
>> wrong...).
>
> The patch does not update the tests. So, we now have
> FAILED   644/1151  test-org-export/activate-smart-quotes
>
> And it looks like at least on of the test conditions is not trivial to
> fix without knowing French. May you or somebody familiar with French
> punctuation take a look?

I'm afraid I'm not very familiar with the syntax and usage of tests, so
I have to study that part. I've been looking at
`test-org-export/activate-smart-quotes', and I have a question: does it
only include tests for English and French cases?

First level quotes for French are «» with spaces, and second level ones
(if I'm not mistaken) should be “”, without spaces (my patch fix).
Therefore, I understand that a line like:

   (equal '( "« outer « inner » outer »")

should it be changed like this

   (equal '( "« outer “inner” outer »")

?

-- 
Juan Manuel Macías

https://juanmanuelmacias.com

https://lunotipia.juanmanuelmacias.com

https://gnutas.juanmanuelmacias.com



Re: [patch] Fix inner smart quotes in French

2023-08-05 Thread Ihor Radchenko
Juan Manuel Macías  writes:

> These last months I have been disconnected from the list for family
> reasons. Now, trying to catch up with the news on the list and pending
> things that I left here :-).

Welcome back :)

> In the meantime, I'm submitting this patch with a fix for second-level
> French `smart quotes': the correct quotes should be “” (without spaces,
> as in Spanish or Greek) (please, some francophone correct me, if I'm
> wrong...).

The patch does not update the tests. So, we now have
FAILED   644/1151  test-org-export/activate-smart-quotes

And it looks like at least on of the test conditions is not trivial to
fix without knowing French. May you or somebody familiar with French
punctuation take a look?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [patch] Fix inner smart quotes in French

2023-08-04 Thread Bastien
Hi Juan,

Juan Manuel Macías  writes:

> In the meantime, I'm submitting this patch with a fix for second-level
> French `smart quotes': the correct quotes should be “” (without spaces,
> as in Spanish or Greek) (please, some francophone correct me, if I'm
> wrong...).

Applied, thanks!

-- 
 Bastien