emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sean O'Halpin" <sean.ohalpin@gmail.com>
To: numbchild@gmail.com
Cc: Org Mode <emacs-orgmode@gnu.org>
Subject: Re: [Discuss] make :tangle header argument respect :dir could save info typing
Date: Tue, 19 Mar 2019 13:08:29 +0000	[thread overview]
Message-ID: <CAOXM+eXUfM7B7VG=-_e7gew8xYvGF07=sy-hiptA3LN3sng2RQ@mail.gmail.com> (raw)
In-Reply-To: <87d0n55063.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2147 bytes --]

Hi,

=:dir= specifies the directory for code execution, i.e. when you hit =C-c
C-c= what is the environment in which the code is run?

=:mkdirp= forces creation of the directory for tangle output, i.e. when you
=org-babel-tangle= where do you put the output source code?

They are quite separate concerns.

Regards,
Sean

On Tue, 5 Mar 2019 at 06:03, stardiviner <numbchild@gmail.com> wrote:

>
> I realized one thing, the combination of ~:mkdir~, ~:dir~, and ~:tangle~
> does not work
> good enough. Can make ~:tangle~ respect ~:dir~ too. WDYT?
>
> Here is an example:
>
> #+begin_src clojure :mkdirp yes :dir "data/code/clj-crawler-demo" :tangle
> "src/clj_crawler_demo/core.clj"
> (ns clj-crawler-demo.core
>   (:require [clj-http.client :as http])
>   (:require [net.cgrand.enlive-html :as html]))
>
> (html/select
>  (-> (http/get "https://www.baidu.com")
>      :body
>      html/html-snippet)
>  [:div])
> #+end_src
>
> Why need this? If ~:tangle~ respect ~:dir~, it will don't need the
> complete path to
> tangled file. And when the source block has other header argument need dir
> like
> ~:file~, this will make ~:tangle~ and other related header arguments
> shorter.
>
> If ~:tangle~ does not respect ~:dir~, user need to repeat the path:
>
> #+begin_src clojure :mkdirp yes :dir "data/code/clj-crawler-demo" :tangle
> "data/code/clj-crawler-demo/src/clj_crawler_demo/core.clj"
> (ns clj-crawler-demo.core
>   (:require [clj-http.client :as http])
>   (:require [net.cgrand.enlive-html :as html]))
>
> (html/select
>  (-> (http/get "https://www.baidu.com")
>      :body
>      html/html-snippet)
>  [:div])
> #+end_src
>
> This is long, I know there is ~#+headers:~ for source block. But reduce
> info would
> be better. I also consider the disadvantage of this change. Some user's
> existing
> source block might be broken.
>
> Let's level this change for discussion.
>
> --
> [ 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
>
>
>

[-- Attachment #2: Type: text/html, Size: 3031 bytes --]

  reply	other threads:[~2019-03-19 13:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-19  5:40 [Proposal] Make header argument :mkdirp yes work for other header arguments not just :tangle Christopher M. Miles
2019-03-02  4:55 ` stardiviner
2019-03-03  7:23   ` [FEATURE] " stardiviner
2019-03-03  8:03     ` Nicolas Goaziou
2019-03-03 15:15       ` stardiviner
2019-03-04 22:21         ` Nicolas Goaziou
2019-03-05  5:13           ` stardiviner
2019-03-05  6:02           ` [Discuss] make :tangle header argument respect :dir could save info typing stardiviner
2019-03-19 13:08             ` Sean O'Halpin [this message]
2019-03-20  5:47               ` stardiviner
2019-03-03  4:32 ` [Proposal] Make header argument :mkdirp yes work for other header arguments not just :tangle 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='CAOXM+eXUfM7B7VG=-_e7gew8xYvGF07=sy-hiptA3LN3sng2RQ@mail.gmail.com' \
    --to=sean.ohalpin@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=numbchild@gmail.com \
    /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).