emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [Proposal] Make header argument :mkdirp yes work for other heade


From: stardiviner
Subject: Re: [O] [Proposal] Make header argument :mkdirp yes work for other header arguments not just :tangle
Date: Sun, 03 Mar 2019 12:32:34 +0800
User-agent: mu4e 1.1.0; emacs 27.0.50

Christopher M. Miles <address@hidden> writes:

> I hope `:mkdirp` header argument can also work for other related header
> arguments like `:dir`, `:file` etc not just `:tangle`. Like following
> example.
>
> #+begin_src sh :mkdirp yes :dir "data/code/mkdirp/dir" :file "test" :results 
> file link
> echo "hello"
> #+end_src
>
> Do you have any idea about this?

I figured out previous question now, it's because ~expand-file-name~ on ~nil~.

    #+begin_example
    Debugger entered--Lisp error: (wrong-type-argument stringp nil)
      expand-file-name(nil)
      (file-name-as-directory (expand-file-name dir))
      (let ((mkdirp (cdr (assq :mkdirp params))) (fnd (file-name-as-directory 
(expand-file-name dir)))) (if (and (string= mkdirp "yes") fnd) (make-directory 
fnd 'parents)) (or (and dir (file-name-as-directory (expand-file-name dir))) 
default-directory))'
    #+end_example

After fix, the patch works fine and passed all tests include my write 
corresponding test.
      

Attachment: 0001-ob-core.el-Make-mkdirp-work-for-dir-too.patch
Description: Text Data

-- 
[ stardiviner ]
       I try to make every word tell the meaning what I want to express.

       Blog: https://stardiviner.github.io/
       IRC(freenode): stardiviner, Matrix: stardiviner
       GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

reply via email to

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