emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ob-java: Allow import to end with asterisk


From: ian martins
Subject: Re: [PATCH] ob-java: Allow import to end with asterisk
Date: Tue, 26 Jan 2021 22:21:05 -0500

> I found this case:
> And it seems to me that the import regex dont see the asterisk.
>
> I attached a possible patch.

Thanks again, John.  You're right the regex is missing the asterisk
include. Thanks for the patch fixing. This works but it will add
redundant includes if the source block includes something that is also
in the list of classes to automatically include.

for example, this:

    #+begin_src java :results value
      import java.util.*;
      return "test";
    #+end_src

will end up pulling in

    import java.util.List;
    import java.util.*;

It wouldn't hurt anything, but could probably be prevented by changing
the regexp in =org-babel-java--import-maybe= to look for asterisk as
well as =class=.  Do you feel like updating the patch?

[1] https://code.orgmode.org/bzg/org-mode/src/master/lisp/ob-java.el#L314



reply via email to

[Prev in Thread] Current Thread [Next in Thread]