From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [babel] tangle and Makefile Date: Thu, 28 Jan 2010 10:00:06 -0700 Message-ID: <87r5paxizt.fsf@gmail.com> References: <4B616C72.2000707@ifi.uio.no> <87iqamqlyf.fsf@stats.ox.ac.uk> 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 1NaXjF-0006in-CA for emacs-orgmode@gnu.org; Thu, 28 Jan 2010 12:00:25 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NaXjA-0006hi-A4 for emacs-orgmode@gnu.org; Thu, 28 Jan 2010 12:00:24 -0500 Received: from [199.232.76.173] (port=58669 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaXj9-0006hT-DP for emacs-orgmode@gnu.org; Thu, 28 Jan 2010 12:00:19 -0500 Received: from mail-fx0-f216.google.com ([209.85.220.216]:45172) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NaXj8-0001UT-UB for emacs-orgmode@gnu.org; Thu, 28 Jan 2010 12:00:19 -0500 Received: by fxm8 with SMTP id 8so1257000fxm.26 for ; Thu, 28 Jan 2010 09:00:16 -0800 (PST) In-Reply-To: <87iqamqlyf.fsf@stats.ox.ac.uk> (Dan Davison's message of "Thu, 28 Jan 2010 10:38:00 -0500") 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: Dan Davison Cc: emacs-orgmode@gnu.org This patch has been applied. Thanks -- Eric Dan Davison writes: > "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 wi= thout 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/= org-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= base-name)) > - (concat base-name "." ext) base-na= me)))) > + (if (and ext > + (string=3D base-name > + (file-name-sans-exten= sion base-name))) > + (concat base-name "." ext) base-nam= e)))) > ;; ;; debugging > ;; (message "tangle=3D%S base-name=3D%S file-name=3D%S" > ;; tangle base-name file-name)