From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rasmus Subject: Re: [PATCH (v3)][ox-latex.el] Allow AUTO argument to org-latex-guess-babel-language. Date: Fri, 07 Jun 2013 15:16:43 +0200 Message-ID: <87li6mxdqc.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> <87txlbylja.fsf_-_@pank.eu> <87r4gew128.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkwXM-0002xL-1z for emacs-orgmode@gnu.org; Fri, 07 Jun 2013 09:17:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UkwXK-0005PW-QN for emacs-orgmode@gnu.org; Fri, 07 Jun 2013 09:17:00 -0400 Received: from plane.gmane.org ([80.91.229.3]:39486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UkwXK-0005PS-Jo for emacs-orgmode@gnu.org; Fri, 07 Jun 2013 09:16:58 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UkwXF-0004O2-LZ for emacs-orgmode@gnu.org; Fri, 07 Jun 2013 15:16:53 +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 ; Fri, 07 Jun 2013 15:16:53 +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 ; Fri, 07 Jun 2013 15:16:53 +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: > Hello, > > Rasmus writes: > >> Nicolas Goaziou writes: > >> is the attached patch better? > > It is, thank you. Here is another round of comments. >> + (replace-match (mapconcat 'identity >> + (if language >> + (cond ((member language options) >> + (delete "AUTO") options) >> + ((member "AUTO" options) >> + (dotimes (n (length options) options) >> + (if (equal "AUTO" (nth n options)) >> + (setf (nth n options) language)))) >> + (t (append options (list language)))) >> + (delete "AUTO" options)) > > I suggest to use something like this instead: > > (mapconcat (lambda (option) (if (equal "AUTO" option) language option)) > (cond ((member language options) (delete "AUTO" options)) > ((member "AUTO" options) options) > (t (append options (list language))))) > >> - nil nil header 1)))))) >> + t nil header 1))))) It looks more elegant. I'll try to incorporate it and prepare a v4. > Why do you need to use a non-nil FIXEDCASE argument here? When I don't #+LANGUAGE: en #+LATEX_HEADER: \usepackage[AUTO]{babel} becomes \usepackage[ENGLISH]{babel}. . . Why? I don't know. . . Fixedcase solves it. -- Summon the Mothership!