From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: [babel] org-babel: tangling to latex .sty/.cls files Date: Wed, 17 Mar 2010 11:24:02 -0400 Message-ID: <87iq8vynsd.fsf@stats.ox.ac.uk> References: <51b0095d1003161510w1f94a1cfk60076dc2d5a5b6f4@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nrv6X-0005EO-Bg for emacs-orgmode@gnu.org; Wed, 17 Mar 2010 11:24:17 -0400 Received: from [140.186.70.92] (port=33741 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nrv6R-0005CO-VT for emacs-orgmode@gnu.org; Wed, 17 Mar 2010 11:24:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Nrv6O-0003fB-0C for emacs-orgmode@gnu.org; Wed, 17 Mar 2010 11:24:11 -0400 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:52363) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Nrv6N-0003f5-Pm for emacs-orgmode@gnu.org; Wed, 17 Mar 2010 11:24:07 -0400 In-Reply-To: <51b0095d1003161510w1f94a1cfk60076dc2d5a5b6f4@mail.gmail.com> (Nicolas Girard's message of "Tue, 16 Mar 2010 23:10:17 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Girard Cc: emacs-orgmode Unless I hear views to the contrary from other org-babel users, I'm going to change this later today so that, when a file name is supplied for tangling, org-babel no longer attempts to guess the file extension. The only situation when tangling will guess the file name extension is if you supply ':tangle yes' in which case the behaviour will be as it is currently (i.e. the org file name, minus .org, plus the extension defined in org-babel-tangle-langs.) The patch I propose to apply is below. For a file named z.org, here are what some blocks will tangle to with this patch. #+begin_src sh :tangle yes => z.sh #+begin_src latex :tangle latex-code => latex-code #+begin_src latex :tangle latex-code.tex => latex-code.tex #+begin_src latex :tangle a.cls => a.cls Dan --8<---------------cut here---------------start------------->8--- diff --git a/contrib/babel/lisp/org-babel-tangle.el b/contrib/babel/lisp/org-babel-tangle.el index dd76195..4880118 100644 --- a/contrib/babel/lisp/org-babel-tangle.el +++ b/contrib/babel/lisp/org-babel-tangle.el @@ -109,7 +109,7 @@ exported source code blocks by language." target-file)) (file-name (when base-name ;; decide if we want to add ext to base-name - (if (and ext (not (string= (file-name-extension base-name) ext))) + (if (and ext (string= "yes" tangle)) (concat base-name "." ext) base-name)))) ;; ;; debugging ;; (message --8<---------------cut here---------------end--------------->8--- Nicolas Girard writes: > Hi all, > a while ago Babel allowed latex code to be tangled to a file named > f.sty or f.cls ; it's currently not possible any more, because the > tangled file is named f.sty.tex or f.cls.tex. > I tried to deal with it but I'm really missing this feature a lot. > Do you think org-babel could allow this again ? > Thanks very much in advance, > cheers, > Nicolas > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode