emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] [babel] tangle and Makefile


From: Eric Schulte
Subject: Re: [Orgmode] [babel] tangle and Makefile
Date: Thu, 28 Jan 2010 10:00:06 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (gnu/linux)

This patch has been applied. Thanks -- Eric

Dan Davison <address@hidden> writes:

> "Martin G. Skjæveland" <address@hidden> 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 <address@hidden>
> Date: Thu, 28 Jan 2010 10:23:11 -0500
> Subject: [PATCH] babel: prevent trailing periods in tangled file names 
> without 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= base-name
> -                                               (file-name-sans-extension 
> base-name))
> -                                      (concat base-name "." ext) 
> base-name))))
> +                                  (if (and ext
> +                                          (string= base-name
> +                                                   (file-name-sans-extension 
> base-name)))
> +                                     (concat base-name "." ext) base-name))))
>                  ;; ;; debugging
>                  ;; (message "tangle=%S base-name=%S file-name=%S"
>                  ;;          tangle base-name file-name)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]