From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id oOIIH5gVEWB9IgAA0tVLHw (envelope-from ) for ; Wed, 27 Jan 2021 07:26:16 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id ODPKGpgVEWCBRgAAB5/wlQ (envelope-from ) for ; Wed, 27 Jan 2021 07:26:16 +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 D2CAF94042B for ; Wed, 27 Jan 2021 07:26:15 +0000 (UTC) Received: from localhost ([::1]:35646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4fDR-0005bP-U4 for larch@yhetil.org; Wed, 27 Jan 2021 02:26:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4fCI-0005bD-Q1 for emacs-orgmode@gnu.org; Wed, 27 Jan 2021 02:25:02 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:45995) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l4fCD-0005Ya-6l for emacs-orgmode@gnu.org; Wed, 27 Jan 2021 02:25:02 -0500 Received: by mail-wr1-x431.google.com with SMTP id m13so775908wro.12 for ; Tue, 26 Jan 2021 23:24:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:message-id :date:mime-version; bh=tX0fyhoS2Hr0Z7UKpHdXJr0SSTgaB8xNXKrl+IbtmsI=; b=XqYWA+4FO+CYgKE0JVYKxYwLZZ1UNTXMKtHlzVIEU7dE1VGoSzkkg1xKPEF+ITyA7a ADVsjVZw/fIOmikUgsdvJ8atoGJfkkURyNSh+fm42liEnCO6uPOMcAN4xqG+0t/batHH 6Wi2FkWT+cgh6v9nQixgcIAtrnaOh2gwLbro6mTLEKhtr4wnLLBEe00qC6Kh8siiarA1 wJbGx3+/8i9mE0RDoaUlx7G2k/X0ZoV1SYjDDFRbamN2C0eweaf3UZJrRYtD4eaowcWi ij3Q5pZaQTMpErusdMw4JbyALVmJGIyoBBs6QuLlxiC/yVZ2tPelR0AjR7Fiof0wuYwj 1yhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:message-id:date:mime-version; bh=tX0fyhoS2Hr0Z7UKpHdXJr0SSTgaB8xNXKrl+IbtmsI=; b=DJHFOVDWoNXm6NcUbbaklR1AhmkmKyuyKu+9ceylJ1yfc/pPq1JL+dr0/OCKE3jW6h XXIFuNGP+TfWKHgTSrpJMWYzm80dZ3+dyp8V08ud2cWNdUOBryuuNmHjNEhHkiEpIG+7 qOigo8FAYubRdYowAt3ldMgS2RvZeJRb1ie/sUM7Mvx28zUV4tVrN0kz22js56EO1cXl /7uzzkp9Z6bOupRafnBZLzljHTSQe9gM+KcScRXhLszvBCT+cPREst1F4ecm3HKAo1c+ TXoKXwk48BQR+v7/8LGV4nsO3Hp+PShTsB4ZaHLwaOYfwNojosRA7z1Qaw9UETYpakl0 X+zg== X-Gm-Message-State: AOAM533gBcmd/LWWRycT3oySYqG41BKtGdX9SJtZ9EfGvSx1C4SfdxK0 /b35e3YnQpOXY154mLNNbNhwKzz6MSM= X-Google-Smtp-Source: ABdhPJy4A/NgVm7gF/Mj4d0c0uXgIFp9pVz3QGhfx6YEqYk96dUaiYBeovWupMeMIrjKI8dUcY4jbA== X-Received: by 2002:adf:f749:: with SMTP id z9mr9541053wrp.327.1611732294948; Tue, 26 Jan 2021 23:24:54 -0800 (PST) Received: from fnox ([194.132.212.123]) by smtp.gmail.com with ESMTPSA id h15sm1751676wrt.10.2021.01.26.23.24.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Jan 2021 23:24:54 -0800 (PST) References: <87sg6o6sn2.fsf@gmail.com> User-agent: mu4e 1.4.13; emacs 27.1 From: John Herrlin To: ian martins Subject: Re: [PATCH] ob-java: Allow import to end with asterisk In-reply-to: Message-ID: <87lfce3kqk.fsf@gmail.com> Date: Wed, 27 Jan 2021 08:24:52 +0100 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=jherrlin@gmail.com; helo=mail-wr1-x431.google.com 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: , Cc: org-mode-email Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.05 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=XqYWA+4F; 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-Migadu-Queue-Id: D2CAF94042B X-Spam-Score: -3.05 X-Migadu-Scanner: scn1.migadu.com X-TUID: jGVedemcQIwS Thank you for the guidence! I will try to figure it out and sending a updated patch soon. ian martins writes: >> 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