emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: Joao Cortes <joaooneillcortes@outlook.pt>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Python source block and :dir header arg
Date: Tue, 02 Apr 2019 11:59:11 -0400	[thread overview]
Message-ID: <m2sgv0o0ts.fsf@andrew.cmu.edu> (raw)
In-Reply-To: <AM6PR07MB572021DD7FD9053D0024CD92A3550@AM6PR07MB5720.eurprd07.prod.outlook.com>

That looks different than what I see in org 9.2.1, if it has changed
then it might be a bug indeed.

What I see is:

(default-directory
		   (or (and dir (file-name-as-directory (expand-file-name dir)))
		       default-directory))


I think :mkdirp is only for tangling files, so I wouldn't expect it to
affect this, unless its use has been expanded. Even if it has been
expanded, if the directory exists, it should work fine, but if it
doesn't exist, and :mkdirp is nil or no, then it should fail. If it is
non-nil then the directory should be made I guess.

Joao Cortes <joaooneillcortes@outlook.pt> writes:

> Looking at org-babel-execute-src-block, It seems the only way to get the
> the intended behavihour is adding :mkdirp "yes" or some other
> value that gives a true value to the result of the =and= call in the
> following snippet.
>
> This is the relevant code at ob-core.el, starting at line 681.
> #+begin_src emacs-lisp :line yes
> 		 (default-directory
> 		   (or (and dir
> 			    (not (member mkdirp '("no" "nil" nil)))
> 			    (progn
> 			      (let ((d (file-name-as-directory
> 					(expand-file-name dir))))
> 				(make-directory d 'parents)
> 				d)))
> 		       default-directory))
> #+end_src
>
> This looks like a bug. If the :dir directory already
> exists, the :mkdirp parameter should not stop setting the default
> directory to :dir


--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu

  reply	other threads:[~2019-04-02 15:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-01 17:06 Python source block and :dir header arg Joao Cortes
2019-04-01 18:12 ` John Kitchin
2019-04-01 18:23   ` Joao Cortes
2019-04-01 18:16 ` Joao Cortes
2019-04-02 15:59   ` John Kitchin [this message]
2019-04-03 17:31     ` Joao Cortes
2019-04-05 14:34       ` John Kitchin
2019-04-05  3:07 ` stardiviner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2sgv0o0ts.fsf@andrew.cmu.edu \
    --to=jkitchin@andrew.cmu.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=joaooneillcortes@outlook.pt \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).