emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] "Smart" quotes


From: Mark E. Shoulson
Subject: Re: [O] "Smart" quotes
Date: Wed, 23 May 2012 23:05:18 -0400
User-agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

On 05/23/2012 06:17 PM, Nicolas Goaziou wrote:
Hello,


"Mark E. Shoulson"<address@hidden>  writes:

"Smart" quotes can be annoying when they aren't smart enough. But when
they work you can miss them. I'm attaching a patch that defines a
custom variable org-smart-quotes (nil by default), which when non-nil
causes the " and ' characters to display as “smart” quotes, hopefully
the right ones. They're still ' and " in the underlying text, just
overlaid with “”.
This is not related to entities, so code shouldn't be in org-entities.el.
Agreed.


Also, quotes are dependent on locale[fn:1]. English/US only quotes look
like a niche to me. Would it be possible to modify the patch and have
this feature handle LANGUAGE keyword, or at least have a support for it?
Hm. I like the idea, but it raises some questions for me. It would be particularly good if this could share code/custom variables with the pieces of the (new) exporter that make smart quotes on export. That way we could be sure that what it looks like onscreen would also be what it looked like when exported. Looking at contrib/lisp/org-e-latex.el at an upcoming exporter for such things, I see a variable org-e-latex-quotes, which has nice language-aware parts... but misses an important point. Each language gets to define one regexp for opening quotes, one for closing quotes, and one for single quotes. But don't we want to talk about (at least) two levels of quotes, see your own reference[fn:1]? Single quotes would be for inner, second-level quotes (if we're using double straight quotes according to (American) English usage, I would guess we'd be using single straight quotes the same way). That works okay for English, where a single apostrophe not part of a grouping construct is going to be interpreted as a "close" single quote and look right for an apostrophe. It might not work so good in French where apostrophes are also used, but also single guillemets for inner-level quotes. Does the setup there need to be smarter, or at least more extensible, to allow for more than exactly three entries? Clever enough regexps could distinguish inner quotes from apostrophes, etc. Should/can we consider extending this for the new exporters?

(I'm looking forward to HTML and ODT exporters that can do smart quotes; the straight quotes are really the main jarring things about using Org as a lightweight markup and exporting into something fancier)

~mark




reply via email to

[Prev in Thread] Current Thread [Next in Thread]