From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Mark E. Shoulson" Subject: Re: "Smart" quotes Date: Wed, 23 May 2012 23:05:18 -0400 Message-ID: <4FBDA56E.5030901@kli.org> References: <4FBB08CA.5060705@kli.org> <87d35u8rvk.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:57418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXOMe-0006OK-Ia for emacs-orgmode@gnu.org; Wed, 23 May 2012 23:05:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXOMc-0004cm-K7 for emacs-orgmode@gnu.org; Wed, 23 May 2012 23:05:24 -0400 Received: from pi.meson.org ([96.56.207.26]:44974) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SXOMc-0004cE-FM for emacs-orgmode@gnu.org; Wed, 23 May 2012 23:05:22 -0400 In-Reply-To: <87d35u8rvk.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: org-mode mailing list On 05/23/2012 06:17 PM, Nicolas Goaziou wrote: > Hello, > > > "Mark E. Shoulson" 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