emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] ox.el: add smart quotes for Greek
@ 2021-09-19 16:30 Juan Manuel Macías
  2021-09-20 14:54 ` Max Nikulin
  0 siblings, 1 reply; 9+ messages in thread
From: Juan Manuel Macías @ 2021-09-19 16:30 UTC (permalink / raw)
  To: orgmode

[-- Attachment #1: Type: text/plain, Size: 631 bytes --]

Hi,

I attach here a tiny patch to add Greek smart quotes. Finally, I apply
the second level quotation marks that Protesilaos Stavrou proposed in this
previous thread:
https://orgmode.org/list/87o89yv1mz.fsf@cnu407c2zx.nsn-intra.net/#r

So the quotation marks setting for Greek is exactly the same as in the
case of quotation marks for Spanish.

Thanks a lot to Protesilaos, Michalis and Maxim Nikulin for their suggestions on
that thread (Maxim, sorry I did not reply to your message in the thread,
but and I didn't see it until a few days ago :-()

Best regards,

Juan Manuel

---------------------
https://juanmanuelmacias.com


[-- Attachment #2: 0001-ox.el-add-smart-quotes-for-greek.patch --]
[-- Type: text/x-patch, Size: 1843 bytes --]

From 3deb65be3d59e2ae35bd6dc9bb38b138dee926f8 Mon Sep 17 00:00:00 2001
From: Juan Manuel Macias <maciaschain@posteo.net>
Date: Sun, 19 Sep 2021 17:58:51 +0200
Subject: [PATCH] ox.el: add smart quotes for greek

* lisp/ox.el (org-export-smart-quotes-alist): The correct quotes for Greek have been established with the help of Protesilaos Stavrou
---
 lisp/ox.el | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lisp/ox.el b/lisp/ox.el
index 5fe894569..a8014d401 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -524,7 +524,7 @@ e.g. \"H:2\"."
   "The default language for export and clocktable translations, as a string.
 This may have an association in
 `org-clock-clocktable-language-setup',
-`org-export-smart-quotes-alist' and `org-export-dictionary'.
+`org-export-smart-quotes-' and `org-export-dictionary'.
 This option can also be set with the LANGUAGE keyword."
   :group 'org-export-general
   :type '(string :tag "Language")
@@ -5437,6 +5437,16 @@ transcoding it."
      (secondary-closing
       :utf-8 "‘" :html "&lsquo;" :latex "\\grq{}" :texinfo "@quoteleft{}")
      (apostrophe :utf-8 "’" :html "&rsquo;"))
+    ("el"
+     (primary-opening
+      :utf-8 "«" :html "&laquo;" :latex "\\guillemotleft{}"
+      :texinfo "@guillemetleft{}")
+     (primary-closing
+      :utf-8 "»" :html "&raquo;" :latex "\\guillemotright{}"
+      :texinfo "@guillemetright{}")
+     (secondary-opening :utf-8 "“" :html "&ldquo;" :latex "``" :texinfo "``")
+     (secondary-closing :utf-8 "”" :html "&rdquo;" :latex "''" :texinfo "''")
+     (apostrophe :utf-8 "’" :html "&rsquo;"))
     ("en"
      (primary-opening :utf-8 "“" :html "&ldquo;" :latex "``" :texinfo "``")
      (primary-closing :utf-8 "”" :html "&rdquo;" :latex "''" :texinfo "''")
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] ox.el: add smart quotes for Greek
  2021-09-19 16:30 [PATCH] ox.el: add smart quotes for Greek Juan Manuel Macías
@ 2021-09-20 14:54 ` Max Nikulin
  2021-09-21 20:20   ` Juan Manuel Macías
  0 siblings, 1 reply; 9+ messages in thread
From: Max Nikulin @ 2021-09-20 14:54 UTC (permalink / raw)
  To: orgmode; +Cc: Juan Manuel Macías

On 19/09/2021 23:30, Juan Manuel Macías wrote:
> 
> I attach here a tiny patch to add Greek smart quotes. Finally, I apply
> the second level quotation marks that Protesilaos Stavrou proposed in this
> previous thread:
> https://orgmode.org/list/87o89yv1mz.fsf@cnu407c2zx.nsn-intra.net/#r

Since the choice of secondary opening quote character was uncertain at 
first, I suppose, it would be nice to have this decision documented 
somewhere in Org source repository for the case that it might be 
revisited later. (Disclaimer: unsure that Org developers have the same 
opinion.)

I mean the citation and the reference to the paper by Yannis Haralambous 
to make clear that such variant was considered, the title of EU 
recommendations since nobody has provided more authoritative reference 
of Greek typography traditions.

Possible options:
- Add the note directly to the .el file. I am afraid, as inline comment 
it could be considered too long.
- To a file in the "doc" directory dedicated to such decisions (there is 
no such file yet however) with a reference from the .el file.
- Commit message. It is acceptable but not apparent for a person who 
reads the code that git log may provide detailed explanation of 
particular choice.

Mail archives are not permanent, e.g. web interface to Gmane was shut 
down due to some problems, the same might happen with public inbox 
mirrors. That is why, I think, a more detailed note should be added to 
Org sources.

By the way, Common Locale Data Repository https://cldr.unicode.org/
defines U+201C (&#8220;) and U+201D (&#8221;) characters as well

ag quotation common/main/el*
common/main/el.xml
1224:		<quotationStart>«</quotationStart>
1225:		<quotationEnd>»</quotationEnd>
1226:		<alternateQuotationStart>“</alternateQuotationStart>
1227:		<alternateQuotationEnd>”</alternateQuotationEnd>

Unfortunately this part of Unicode databases is not available form Emacs.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ox.el: add smart quotes for Greek
  2021-09-20 14:54 ` Max Nikulin
@ 2021-09-21 20:20   ` Juan Manuel Macías
  2021-09-22 17:19     ` Max Nikulin
  0 siblings, 1 reply; 9+ messages in thread
From: Juan Manuel Macías @ 2021-09-21 20:20 UTC (permalink / raw)
  To: Max Nikulin; +Cc: orgmode

Hi Maxim,

Max Nikulin writes:

> [...]
> Possible options:
> - Add the note directly to the .el file. I am afraid, as inline
>   comment it could be considered too long.
> - To a file in the "doc" directory dedicated to such decisions (there
>   is no such file yet however) with a reference from the .el file.
> - Commit message. It is acceptable but not apparent for a person who
>   reads the code that git log may provide detailed explanation of 
> particular choice.

Thanks for your suggestions. Maybe I could add a link to the Haralambous
paper in the commit message, along with a very short note... In any
case, the only issue is with the second level opening quotes.
Haralambous asserts that the (pretty rare) character U+201F must be
used, and not the character U+201C, which is the one used in English
(among many other languages) and in Spanish second level quotes, and the
one that I have applied (proposed by Protesilaos) to the patch.
Haralambous is a great TeX guru, and a great scholar and theorist of
Greek typography, but... I would say that in this case his mind is more
focused on a historical tradition probably abandoned before the digital
age. I really don't know. Moreover, it is difficult to find specimens of
the use of second-level quotation marks. I have looked in Greek books
printed in the early and middle of the last century, and I have not
found anything. My suspicion is that in Greek nowadays the character
U+201C (common in other languages ---as I said before--- and therefore
better known) has ended up standardizing for second level opening
quotes. Maybe all the above could be summarized in less than one line
inside the commit message ;-). A quick search, by the way, of the term
'εισαγωγικά' (= 'quotation marks') on www.greek-language.gr returns this
result, where it is seen clearly the character U+201C:

... (« » ή “ ”) ...

https://www.greek-language.gr/greekLang/modern_greek/tools/lexica/search.html?lq=%CE%B5%CE%B9%CF%83%CE%B1%CE%B3%CF%89%CE%B3%CE%B9%CE%BA%CE%AC

Best regards,

Juan Manuel 





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ox.el: add smart quotes for Greek
  2021-09-21 20:20   ` Juan Manuel Macías
@ 2021-09-22 17:19     ` Max Nikulin
  2021-09-22 19:55       ` Juan Manuel Macías
  0 siblings, 1 reply; 9+ messages in thread
From: Max Nikulin @ 2021-09-22 17:19 UTC (permalink / raw)
  To: emacs-orgmode

I believe, the patch is an improvement. It would be nice to have a 
comment clarifying the choice of secondary opening quote mark, but it is 
not required. It seems there is no recommendations or established 
practice for documenting of such decisions. I have not tested the patch 
though.

> -`org-export-smart-quotes-alist' and `org-export-dictionary'.
> +`org-export-smart-quotes-' and `org-export-dictionary'.

It it intentional change? I have not found other variables having the 
same prefix.

On 22/09/2021 03:20, Juan Manuel Macías wrote:
>> [...]
>> Possible options:
>> - Add the note directly to the .el file. I am afraid, as inline
>>    comment it could be considered too long.
>> - To a file in the "doc" directory dedicated to such decisions (there
>>    is no such file yet however) with a reference from the .el file.
>> - Commit message. It is acceptable but not apparent for a person who
>>    reads the code that git log may provide detailed explanation of
>> particular choice.
> ...
> Haralambous is a great TeX guru, and a great scholar and theorist of
> Greek typography, but... I would say that in this case his mind is more
> focused on a historical tradition probably abandoned before the digital
> age.

That character could get better support in future. I know, such chance 
is almost improbable, but imagine, a person familiar with the paper of 
Haralambous would consider change of the quote mark in question 
believing that Org developers were not aware of the "right" symbol. A 
comment in the source code may provide a hint that the choice was conscious.

I forgot to mention it in my message from 2020-08-15 that I did not find 
the U+201F character in TeX pre-unicode LG* encodings for Greek.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ox.el: add smart quotes for Greek
  2021-09-22 17:19     ` Max Nikulin
@ 2021-09-22 19:55       ` Juan Manuel Macías
  2021-09-23 16:10         ` Max Nikulin
  0 siblings, 1 reply; 9+ messages in thread
From: Juan Manuel Macías @ 2021-09-22 19:55 UTC (permalink / raw)
  To: Max Nikulin; +Cc: orgmode

Max Nikulin writes:

> I believe, the patch is an improvement. It would be nice to have a
> comment clarifying the choice of secondary opening quote mark, but it
> is not required. It seems there is no recommendations or established 
> practice for documenting of such decisions. I have not tested the
> patch though.

Since it's a "orthotypographical" addition, where there is a reasonable
doubt in one of the characters, I agree that a minimal explanatory note
in the commit message would be desirable. But it would have (IMHO) to be
something very brief.

>> -`org-export-smart-quotes-alist' and `org-export-dictionary'.
>> +`org-export-smart-quotes-' and `org-export-dictionary'.
>
> It it intentional change? I have not found other variables having the
> same prefix.

Oh, sorry. It's a horrible typo: I modified that part involuntarily, and
I didn't see it :-(.

> That character could get better support in future. I know, such chance
> is almost improbable, but imagine, a person familiar with the paper of 
> Haralambous would consider change of the quote mark in question
> believing that Org developers were not aware of the "right" symbol. A 
> comment in the source code may provide a hint that the choice was conscious.
>
> I forgot to mention it in my message from 2020-08-15 that I did not
> find the U+201F character in TeX pre-unicode LG* encodings for Greek.

In fact, the character is only problematic in pdfTeX. In XeTeX and
LuaTeX there is no problem, and you can also use the csquotes package.
But in pdfTeX you can't even get it with the
\usepackage[utf8x]{inputenc} option, which is to be expected, since
Unicode support of imputenc is very limited. LuaTeX is the natural
replacement for pdfTeX, but at the moment we have to maintain backward
compatibility and I can't find a way to represent that character in
pdfTeX. This second level quotes issue is not mentioned by Apostolos
Syropoulos in the babel greek documentation:
(https://www.ctan.org/pkg/babel-greek). There is probably no support for
this character in babel-greek.

Before uploading a corrected version of the patch (with a small
explanatory note), I could consult Haralambous himself by mail, and ask
him what he thinks of this question...

Best regards,

Juan Manuel 




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ox.el: add smart quotes for Greek
  2021-09-22 19:55       ` Juan Manuel Macías
@ 2021-09-23 16:10         ` Max Nikulin
  2021-09-23 17:17           ` Juan Manuel Macías
  0 siblings, 1 reply; 9+ messages in thread
From: Max Nikulin @ 2021-09-23 16:10 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: orgmode

On 23/09/2021 02:55, Juan Manuel Macías wrote:
> 
> Before uploading a corrected version of the patch (with a small
> explanatory note), I could consult Haralambous himself by mail, and ask
> him what he thinks of this question...

Juan Manuel, I feel some misunderstanding. I am not asking for more 
arguments in support of current variant of patch. CLDR entry, EU 
recommendations, the mail from Protesilaos, absence of named HTML 
entity, complications with pdfTeX are more than enough.

Some degree of uncertainty during software development is unavoidable, 
so it is perfectly OK to proceed with the variant you have proposed. It 
is better to address other issues.

I suggest just to document the decision, to mention pros and cons. There 
is a little chance that the decision might be reconsidered later and it 
is not a problem. It would be nice to provide useful hints for 
participants of future discussion. Even information that another 
language was added not just for completeness and with guessed values 
might be helpful.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ox.el: add smart quotes for Greek
  2021-09-23 16:10         ` Max Nikulin
@ 2021-09-23 17:17           ` Juan Manuel Macías
  2021-09-25 19:56             ` Juan Manuel Macías
  0 siblings, 1 reply; 9+ messages in thread
From: Juan Manuel Macías @ 2021-09-23 17:17 UTC (permalink / raw)
  To: Max Nikulin; +Cc: orgmode

Hi Maxim,

Max Nikulin writes:

> Juan Manuel, I feel some misunderstanding. I am not asking for more
> arguments in support of current variant of patch. CLDR entry, EU 
> recommendations, the mail from Protesilaos, absence of named HTML
> entity, complications with pdfTeX are more than enough.

I completely agree with what you say, but I think I have explained wrong
in my previous mail. I said about consulting YH because his article is
something old (90s), and his current opinion on "the state of the
question" could help me compose my little explanatory note. And in any
case, I think everyone here agrees that the character that he proposed
in his paper is unfeasible in Org, for all the reasons you have
summarized. On the other hand, the orthographic norms are not sacred
norms; rather, they are determined by use and customs. For example, here
in Spain the manuals and treatises tend to disagree on certain issues.
In my opinion, many times it is better to talk about trends more than
norms[1], and trends that more or less end imposing, almost by mere
natural selection (another matter is that sometimes bad habits are also
imposed, for using inappropriate software, but this is not the case
where we are).

[1] For example, in Spanish of Spain, the quotation marks are «“ ”»,
But in Mexican Spanish they use “‘’” as in English. In fact the
csquotes LaTeX package includes both styles.

Best regards,

Juan Manuel


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] ox.el: add smart quotes for Greek
  2021-09-23 17:17           ` Juan Manuel Macías
@ 2021-09-25 19:56             ` Juan Manuel Macías
  2021-09-25 20:54               ` Bastien
  0 siblings, 1 reply; 9+ messages in thread
From: Juan Manuel Macías @ 2021-09-25 19:56 UTC (permalink / raw)
  To: orgmode; +Cc: Max Nikulin

[-- Attachment #1: Type: text/plain, Size: 1391 bytes --]

Hi again,

I am attaching a new version of the patch, with some typos fixed and a
explanatory note in the commit message on the choice of the character
U+201C as Greek second-level opening quotes.

In case anyone is interested in what Yanis Haralambous answered me in a
recent mail, I reproduce here (with his permission) a fragment of the
message:

#+begin_quote
[...] to answer your question, the average Greek writer would use
U+201C. For those that seek Greek typographic tradition, there should be
a substitution [...], but it would be more appropriate to do it
on the glyph level. From a grapholinguistic point of view there is
absolutely no need of using U+201F, the difference should be on the
alllographic level, the grapheme should only carry the information
"CLOSING DOUBLE SECOND-LEVEL QUOTATION MARK" and U+201C is a good choice
for representing that grapheme since it is used in most countries of the
world…
#+end_quote

Therefore, if someone wishes to use the historical character [in a
LuaTeX or XeTeX document] (represented by U+201F), I agree with Yannis
that it is better to use that symbol at the glyph level and not at the
character level. For this scenario a GSUB opentype feature would work
very well, since it is a historical character (as in the case of
historical ligatures, alternate glyphs, etc.). 

Best regards,

Juan Manuel


[-- Attachment #2: 0001-ox.el-add-smart-quotes-for-greek.patch --]
[-- Type: text/x-patch, Size: 2062 bytes --]

From 86edfd424d01a08cc277540644e0cdc7df075b72 Mon Sep 17 00:00:00 2001
From: Juan Manuel Macias <maciaschain@posteo.net>
Date: Sat, 25 Sep 2021 20:41:43 +0200
Subject: [PATCH] ox.el: add smart quotes for greek

* lisp/ox.el (org-export-smart-quotes-alist): The correct quotes for
Greek have been established with the help of Protesilaos Stavrou, who
has contributed a style guide for the European institutions:
http://publications.europa.eu/code/el/el-4100107el.htmq On the correct
character for Greek second-level opening quotes, according to Yannis
Haralambous (`From Unicode to Typography, a Case Study: the Greek
Script' (1999, p. 20), a symbol equivalent to the Unicode character
U+201F is historically attested. But it seems that the current trend
in Greece is to apply the character U+201C, more commonly used in
other languages. Haralambous himself, in a recent consultation,
states: `[...] U+201C is a good choice for representing that grapheme
since it is used in most countries of the world...'
---
 lisp/ox.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lisp/ox.el b/lisp/ox.el
index 18b13a326..89a3ff5f1 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -5437,6 +5437,16 @@ transcoding it."
      (secondary-closing
       :utf-8 "‘" :html "&lsquo;" :latex "\\grq{}" :texinfo "@quoteleft{}")
      (apostrophe :utf-8 "’" :html "&rsquo;"))
+    ("el"
+     (primary-opening
+      :utf-8 "«" :html "&laquo;" :latex "\\guillemotleft{}"
+      :texinfo "@guillemetleft{}")
+     (primary-closing
+      :utf-8 "»" :html "&raquo;" :latex "\\guillemotright{}"
+      :texinfo "@guillemetright{}")
+     (secondary-opening :utf-8 "“" :html "&ldquo;" :latex "``" :texinfo "``")
+     (secondary-closing :utf-8 "”" :html "&rdquo;" :latex "''" :texinfo "''")
+     (apostrophe :utf-8 "’" :html "&rsquo;"))
     ("en"
      (primary-opening :utf-8 "“" :html "&ldquo;" :latex "``" :texinfo "``")
      (primary-closing :utf-8 "”" :html "&rdquo;" :latex "''" :texinfo "''")
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] ox.el: add smart quotes for Greek
  2021-09-25 19:56             ` Juan Manuel Macías
@ 2021-09-25 20:54               ` Bastien
  0 siblings, 0 replies; 9+ messages in thread
From: Bastien @ 2021-09-25 20:54 UTC (permalink / raw)
  To: Juan Manuel Macías; +Cc: Max Nikulin, orgmode

Hi Juan,

> I am attaching a new version of the patch, with some typos fixed and a
> explanatory note in the commit message on the choice of the character
> U+201C as Greek second-level opening quotes.

Applied, thanks a lot for patiently taking care of this.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-09-25 20:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-19 16:30 [PATCH] ox.el: add smart quotes for Greek Juan Manuel Macías
2021-09-20 14:54 ` Max Nikulin
2021-09-21 20:20   ` Juan Manuel Macías
2021-09-22 17:19     ` Max Nikulin
2021-09-22 19:55       ` Juan Manuel Macías
2021-09-23 16:10         ` Max Nikulin
2021-09-23 17:17           ` Juan Manuel Macías
2021-09-25 19:56             ` Juan Manuel Macías
2021-09-25 20:54               ` Bastien

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