ian martins <ia...@jhu.edu> writes: > On Fri, Jan 8, 2021 at 11:28 AM John Herrlin <jherr...@gmail.com> wrote: > >> I would like to combine imports from header-args with imports from a >> source block. >> ... >> I didnt get the to work so I made a patch. > > John, Sorry that wasn't working. Thanks for investigating and > submitting a fix. I think the problem was that I was missing static > imports, which you fixed in the first chunk of your patch. I don't > think the rest of the change is necessary. Could you revert the other > chunks and re-test?
Thats looks correct! Thanks! Here is a patch with the regexp fix. Take care!
>From 3de5cf1c3173285a7f51ab436f02419f8c9f5ffb Mon Sep 17 00:00:00 2001 From: John Herrlin <jherr...@gmail.com> Date: Sun, 10 Jan 2021 21:47:26 +0100 Subject: [PATCH] ob-java: Include static imports in regex * lisp/ob-java.el (org-babel-java--imports-re): Include static imports in Java import regex. TINYCHANGE --- lisp/ob-java.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/ob-java.el b/lisp/ob-java.el index f70a50192..05f591ee3 100644 --- a/lisp/ob-java.el +++ b/lisp/ob-java.el @@ -86,7 +86,7 @@ like javac -verbose." (1+ space) (group (1+ (in alnum ?_ ?.))) ; capture the package name (0+ space) ?\; line-end) "Regexp for the package statement.") -(defconst org-babel-java--imports-re (rx line-start (0+ space) "import" +(defconst org-babel-java--imports-re (rx line-start (0+ space) "import" (opt space "static") (1+ space) (group (1+ (in alnum ?_ ?.))) ; capture the fully qualified class name (0+ space) ?\; line-end) "Regexp for import statements.") -- 2.30.0