From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: [babel] tangle and Makefile Date: Thu, 28 Jan 2010 10:38:00 -0500 Message-ID: <87iqamqlyf.fsf@stats.ox.ac.uk> References: <4B616C72.2000707@ifi.uio.no> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NaWRr-0001tf-Kd for emacs-orgmode@gnu.org; Thu, 28 Jan 2010 10:38:23 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NaWRm-0001tE-GK for emacs-orgmode@gnu.org; Thu, 28 Jan 2010 10:38:22 -0500 Received: from [199.232.76.173] (port=60970 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaWRm-0001tB-BI for emacs-orgmode@gnu.org; Thu, 28 Jan 2010 10:38:18 -0500 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:55750) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NaWRg-0007ga-N5 for emacs-orgmode@gnu.org; Thu, 28 Jan 2010 10:38:18 -0500 In-Reply-To: <4B616C72.2000707@ifi.uio.no> ("Martin G. =?utf-8?Q?Skj=C3=A6?= =?utf-8?Q?veland=22's?= message of "Thu, 28 Jan 2010 11:52:34 +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: =?utf-8?Q?Martin_G=2E_Skj=C3=A6veland?= Cc: emacs-orgmode@gnu.org "Martin G. Skj=C3=A6veland" writes: > Hi, > > I have two questions regarding org-babel-tangle and Makefile. > > Running org-babel-tangle on the following file > > ----------------------------------start > * test > > #+begin_src makefile :tangle Makefile > test: > echo "hello" > #+end_src > ----------------------------------end > > writes a file 'Makefile.' (with a period). Is it possible to have it > write to a file named 'Makefile' (without a period)? Hi Martin, I've had this problem too. Here's a patch. Eric -- can you apply if it looks OK? Dan >From 5c4d56a2e43a97186bf2971b6406f5fa2257130d Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Thu, 28 Jan 2010 10:23:11 -0500 Subject: [PATCH] babel: prevent trailing periods in tangled file names with= out extensions --- contrib/babel/lisp/org-babel-tangle.el | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/contrib/babel/lisp/org-babel-tangle.el b/contrib/babel/lisp/or= g-babel-tangle.el index c805373..66e2c26 100644 --- a/contrib/babel/lisp/org-babel-tangle.el +++ b/contrib/babel/lisp/org-babel-tangle.el @@ -102,9 +102,10 @@ exported source code blocks by language." ((> (length tangle) 0) tangle)) target-file)) (file-name (when base-name - (if (string=3D base-name - (file-name-sans-extension b= ase-name)) - (concat base-name "." ext) base-name= )))) + (if (and ext + (string=3D base-name + (file-name-sans-extensi= on base-name))) + (concat base-name "." ext) base-name)= ))) ;; ;; debugging ;; (message "tangle=3D%S base-name=3D%S file-name=3D%S" ;; tangle base-name file-name) --=20 1.6.3.3