From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id +OgsJMRMXl8cKwAA0tVLHw (envelope-from ) for ; Sun, 13 Sep 2020 16:45:56 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 6HuvHsRMXl8PDAAA1q6Kng (envelope-from ) for ; Sun, 13 Sep 2020 16:45:56 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1BB429404CA for ; Sun, 13 Sep 2020 16:45:56 +0000 (UTC) Received: from localhost ([::1]:43870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kHV8U-000576-MW for larch@yhetil.org; Sun, 13 Sep 2020 12:45:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33172) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHV7H-0004Ur-E1 for emacs-orgmode@gnu.org; Sun, 13 Sep 2020 12:44:39 -0400 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]:41242) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kHV7F-00060Q-Kb for emacs-orgmode@gnu.org; Sun, 13 Sep 2020 12:44:39 -0400 Received: by mail-lf1-x131.google.com with SMTP id y17so10859433lfa.8 for ; Sun, 13 Sep 2020 09:44:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:message-id:date:mime-version; bh=MHPSEQ5qMmaeZgBATsAaKsmz6YsVwfPrOefrz7vE6Rw=; b=dI0rA58E/HEIRwTNpqZxrzipLoORqkTWaDGBtzrVRC+wKso2tzc41uBAgab2jlX54t PnZpuW1XzFS++fE7jRhtF8Vox+HrdAoIfAEyf4mMDL9LU5RXojfaMpxu+25vnakwlDme 9t3Qb0upts3ITbwi1jZnjvkWtTd527HnILIsUQTjuXoVOV/MU4sYuao7MRHgKsACMFuT F8Eh9VqGp9v38ssAk4XhatLYCXvVrLXBaQxssEA+ylZHX1SNeNnKrS+gIILrvJfUesrP RLMB53HPom/1IQnIpgbxarj0kN4WZff9iBOE5fO3Rwd6jEyeVGvfIlMQUkoQ0znbIlIl 0kJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:message-id:date :mime-version; bh=MHPSEQ5qMmaeZgBATsAaKsmz6YsVwfPrOefrz7vE6Rw=; b=BS9bOgkpl/uX22nPPrXQ8vi9yj/4XR5NqBRxrxXHblmqdDRBvD5CWKIWRNYkw7OoDE iRqva9EF6qMES7RQns0q9W4BQOKl7ocH/WamEgxINGcy+1e7gqMVDK+6mPy9NvRSbzcf JUclzGpaWD0qjrGrYKClyOfU3lVDAhj6vyNoAmtjrMCPylPvo26xyj3REOIru1B8mRPu n+6KXzcHFyVABv3+MI6p4jphLsNr1QJlveJq9G++RC1q7H/NisBIPpRh/6/sB6XNZvgB bf1SNu8J/o+wVej003kFl8pLdgzBqMsu+PjQ/LvsOtYz51RKDpsFwfiufbodOBJOk1+Z 6AOQ== X-Gm-Message-State: AOAM5333+NoXiHzfEt40HdFGI1L63Q1ZImXPC9Gcmze5B0Hrc3UTVZDZ kR/5XQLki2FXLoIjGFNDMDNUicxD9LE= X-Google-Smtp-Source: ABdhPJwEdT0XaCDrHbfpIvUhFqEqeqMNIJJw6o09f9/MRyw7FwxCEBoSPvSF1n75cdMN4xmFblI/SA== X-Received: by 2002:a19:3fd5:: with SMTP id m204mr2819603lfa.233.1600015472946; Sun, 13 Sep 2020 09:44:32 -0700 (PDT) Received: from fnox ([2a02:aa1:1010:875:ba12:2c57:755d:9601]) by smtp.gmail.com with ESMTPSA id y6sm2487094lfh.106.2020.09.13.09.44.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2020 09:44:31 -0700 (PDT) User-agent: mu4e 1.4.13; emacs 27.1 From: John Herrlin To: emacs-orgmode@gnu.org Subject: [PATCH] possible bugfix in ob-java Message-ID: <878sdd7hjn.fsf@gmail.com> Date: Sun, 13 Sep 2020 18:44:29 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::131; envelope-from=jherrlin@gmail.com; helo=mail-lf1-x131.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=dI0rA58E; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.71 X-TUID: XlT14XhWoEiP --=-=-= Content-Type: text/plain Hey, Trying to do the following: #+HEADER: :classname se/my_test_package/Main #+HEADER: :dir src #+HEADER: :cmdline -classpath src:. #+BEGIN_SRC java :results output code package se.my_test_package; class Main { public static void main(String[] args) { System.out.println("Hey from Emacs Org mode!"); } } #+END_SRC I expected this to create Main.java and Main.class in directory src/se/my_test_package/ before running =javac=. Instead I get this: File is missing: "Opening output file", "No such file or directory" "/tmp/src/se/my-test-package/Main.java" In the patch I rearrange so package dirs are created before the Main.java file is written to file system. It fixes the provided case for me. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-ob-java-create-package-dirs-before-write-to-file.patch >From 618b736d895b1e762cdcc8026a673aa6207a0a8b Mon Sep 17 00:00:00 2001 From: John Herrlin Date: Sun, 13 Sep 2020 18:07:22 +0200 Subject: [PATCH] ob-java: create package dirs before write to file * lisp/ob-java.el (org-babel-execute:java): create package-name directories before writing to file. TINYCHANGE --- lisp/ob-java.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/ob-java.el b/lisp/ob-java.el index f5edc6d53..dc5efe5fb 100644 --- a/lisp/ob-java.el +++ b/lisp/ob-java.el @@ -60,12 +60,12 @@ parameters may be used, like javac -verbose" (cmdline (or (cdr (assq :cmdline params)) "")) (cmdargs (or (cdr (assq :cmdargs params)) "")) (full-body (org-babel-expand-body:generic body params))) - (with-temp-file src-file (insert full-body)) - (org-babel-eval - (concat org-babel-java-compiler " " cmpflag " " src-file) "") ;; created package-name directories if missing (unless (or (not packagename) (file-exists-p packagename)) (make-directory packagename 'parents)) + (with-temp-file src-file (insert full-body)) + (org-babel-eval + (concat org-babel-java-compiler " " cmpflag " " src-file) "") (let ((results (org-babel-eval (concat org-babel-java-command " " cmdline " " classname " " cmdargs) ""))) (org-babel-reassemble-table -- 2.28.0 --=-=-=--