From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: [PATCH (new version)][ox-latex.el] Allow AUTO argument to org-latex-guess-babel-language. Date: Thu, 06 Jun 2013 11:36:56 +0200 Message-ID: <87ehcf1sxz.fsf@pank.eu> References: <87sj12bwzj.fsf@pank.eu> <8661xvprju.fsf@somewhere.org> <87ehcj9uh7.fsf@pank.eu> <8638sz1e3b.fsf@somewhere.org> <87obbn8c36.fsf@pank.eu> <86wqqae5n4.fsf@somewhere.org> <87ppw26xe2.fsf_-_@pank.eu> <87y5aollyh.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58384) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkWd8-0003pT-Ck for emacs-orgmode@gnu.org; Thu, 06 Jun 2013 05:37:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkWd3-0001PC-OV for emacs-orgmode@gnu.org; Thu, 06 Jun 2013 05:37:14 -0400 Received: from plane.gmane.org ([80.91.229.3]:60789) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkWd3-0001P2-Hh for emacs-orgmode@gnu.org; Thu, 06 Jun 2013 05:37:09 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UkWd2-0005La-EN for emacs-orgmode@gnu.org; Thu, 06 Jun 2013 11:37:08 +0200 Received: from 87-57-37-160-dynamic.dk.customer.tdc.net ([87.57.37.160]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 06 Jun 2013 11:37:08 +0200 Received: from rasmus by 87-57-37-160-dynamic.dk.customer.tdc.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 06 Jun 2013 11:37:08 +0200 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: emacs-orgmode@gnu.org Nicolas Goaziou writes: >> It changes behavior for your setup in that you can define a LANGUAGE >> that isn't a known abbreviation. > > While I think your patch is overall an improvement, I'm not convinced by > this particular point. Indeed #+LANGUAGE: expects a language code as > value, not just any string. This is important since latex backend is not > the only one to use that keyword. We can discard this, of course. > For example, imagine a user in need for german smart quotes. How do you > explain to him than #+language: german will not work, but #+language: de > will? A combination of `org-latex-babel-language-alist' and 'look at the output' and feeble explanations of translations :) How do we explain that to use his favorite babel, perhaps his own "germanme", is not available extending org-latex-babel-language-alist? Of course, in this case it's just a matter of using a LATEX_HEADER, so it's not worth arguing about, and I'm happy to remove it. > I think special Babel needs can be handled elsewhere. Was this related to the above? > You need to punctuate your sentence. OK. >> + (remove "AUTO" > > You can use `delete' instead of `remove': no need to copy the list. Thanks. > There cannot be any "\n" in the value, so you can use "[ \t]+" instead. > Also, you don't need the `replace-regexp-in-string' part: > (org-split-string (match-string 1 header) ",[ \t]*") I didn't know it was a repexp, thanks! > The problem with this implementation is that it will not put LANGUAGE at > the same place AUTO was. IOW, there's no difference between: > > #+LATEX_HEADER: \usepackage[AUTO,danish]{babel} > > and, > > #+LATEX_HEADER: \usepackage[danish,AUTO]{babel} > > although it matters in LaTeX. Sure that's wasn't part of the 'deal', but I can see how it would matter, and it makes more sense in this way. I'll see if I can fix these bugs. Thanks for the feedback. –Rasmus -- Powered by magic pixies!