From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: [Discuss] make :tangle header argument respect :dir could save info typing Date: Tue, 05 Mar 2019 14:02:12 +0800 Message-ID: <87d0n55063.fsf@gmail.com> References: <87ftsk9w03.fsf@gmail.com> <87a7id3mf0.fsf@gmail.com> <8736o4h15m.fsf@gmail.com> <87k1hge652.fsf@nicolasgoaziou.fr> <871s3ogfbe.fsf@gmail.com> <87imwy2sd6.fsf@nicolasgoaziou.fr> Reply-To: numbchild@gmail.com Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([209.51.188.92]:32987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h139h-00058f-IL for emacs-orgmode@gnu.org; Tue, 05 Mar 2019 01:02:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h139g-0006fi-Lw for emacs-orgmode@gnu.org; Tue, 05 Mar 2019 01:02:21 -0500 Received: from [61.175.244.13] (port=50351 helo=dark.localdomain) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h139g-0006X0-46 for emacs-orgmode@gnu.org; Tue, 05 Mar 2019 01:02:20 -0500 In-reply-to: <87imwy2sd6.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: Org Mode 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