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 wK5fIsABrl/cfQAA0tVLHw (envelope-from ) for ; Fri, 13 Nov 2020 03:47:12 +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 COIuHsABrl+wOgAA1q6Kng (envelope-from ) for ; Fri, 13 Nov 2020 03:47:12 +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 BF91B94011D for ; Fri, 13 Nov 2020 03:47:11 +0000 (UTC) Received: from localhost ([::1]:57848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kdQ3K-0001qM-75 for larch@yhetil.org; Thu, 12 Nov 2020 22:47:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdQ2v-0001qD-BT for emacs-orgmode@gnu.org; Thu, 12 Nov 2020 22:46:45 -0500 Received: from pb-smtp21.pobox.com ([173.228.157.53]:51188) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kdQ2r-00077e-R1 for emacs-orgmode@gnu.org; Thu, 12 Nov 2020 22:46:44 -0500 Received: from pb-smtp21.pobox.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 7362AFDF0B; Thu, 12 Nov 2020 22:46:37 -0500 (EST) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:in-reply-to:references:date:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=5Ml6YhSK5oBv P/tF0CyM7T7BK6A=; b=EOAw08Sfc4uIJqVTUs51G4ZWtBSGr99XdZu6wKN9Rlxb vLDmtX4/BpJv4o7mOPlU8jki5NdaIGRU5B0PzNfExxEKb1M5XhjyG3pNv/z0rh/z IzhKEYfYd2Jo+rBWGpojSaTjmTQTwQOzjTXd1kt5QCgXeZ5DLf2FdMj7n0A4jM8= Received: from pb-smtp21.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp21.pobox.com (Postfix) with ESMTP id 6C391FDF0A; Thu, 12 Nov 2020 22:46:37 -0500 (EST) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:cc:subject:in-reply-to:references:date:message-id:mime-version:content-type:content-transfer-encoding; s=mesmtp; bh=TjXCdjbpSfcjfU9vNZ7sZx8OL3iQ4XlvzQ+7nyEUbJM=; b=HZLwG4nTHczp2q29unyO1n4hY9huDkd/pdV3FXVM7LL8k3gi8V2/lqPZ3bwNZxxJAOkfHasDb2dLEJEc8x93020DWoqiSNJq7tUuwxbPgLUizR+2Ikof5KVcEsF6jXGiHNI9kNOnToICuCfv0S8v35PLOp4uOgiYXMCZhwjVGQY= Received: from localhost (unknown [45.33.91.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp21.pobox.com (Postfix) with ESMTPSA id D9922FDF09; Thu, 12 Nov 2020 22:46:34 -0500 (EST) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: ian martins Subject: Re: [PATCH] ob-java.el: Allow for more whitespace In-Reply-To: References: Date: Thu, 12 Nov 2020 22:46:32 -0500 Message-ID: <87d00h7wbr.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Pobox-Relay-ID: D36C2B98-2562-11EB-AE04-D609E328BF65-24757444!pb-smtp21.pobox.com Received-SPF: pass client-ip=173.228.157.53; envelope-from=kyle@kyleam.com; helo=pb-smtp21.pobox.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/12 22:46:37 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, 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 mailing list Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pobox.com header.s=sasl header.b=EOAw08Sf; dkim=pass header.d=kyleam.com header.s=mesmtp header.b=HZLwG4nT; dmarc=none; 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.21 X-TUID: JwV4zm8fCjg8 ian martins writes: > Subject: [PATCH 1/2] ob-java.el: Do not wrap a main method in a main meth= od > > * lisp/ob-java.el (org-babel-expand-body:java): The code was checking > for existence of a class declaration before wrapping the content of > the code block in a main method, but it should be checking for > existence of a main method. Sounds good. > Subject: [PATCH 2/2] ob-java.el: Allow for more whitespace in java code > > * lisp/ob-java.el (defconst *-re): Updated regexps to allow for more > whitespace in the content of java code blocks, and removed some > redundancies. Sorry, more change log nitpicking from me (which is even less fun to do than other nitpicking because I dislike the practice of including change logs in commit messages). Please name each variable in full. Here's the relevant bit from the guidelines that Emacs's CONTRIBUTE points to: If you mention the names of the modified functions or variables, it=E2=80=99s important to name them in full. Don=E2=80=99t abbreviate = function or variable names, and don=E2=80=99t combine them. Subsequent maintainers= will often search for a function name to find all the change log entries that pertain to it; if you abbreviate the name, they won=E2=80=99t find= it when they search. https://www.gnu.org/prep/standards/html_node/Style-of-Change-Logs.html#Styl= e-of-Change-Logs We should probably link to that in worg's org-contribute.org. > * testing/lisp/test-ob-java.el (ob-java/simple-with-main-whitespace): > Added test case with lots of whitespace. Is this related to Jarmo's report at ? If so, it'd be good to include a Reported-by trailer as well as a link. > -(defconst org-babel-java--package-re "^[[:space:]]*package[[:space:]]+\\= \([[:alnum:]_\.]+\\\);$" > +(defconst org-babel-java--package-re "^[[:space:]]*package[[:space:]]+\\= \([[:alnum:]_\.]+\\\)[[:space:]]*;$" > "Regexp for the package statement.") > -(defconst org-babel-java--imports-re "^[[:space:]]*import[[:space:]]+\\\= ([[:alnum:]_\.]+\\\);$" > +(defconst org-babel-java--imports-re "^[[:space:]]*import[[:space:]]+\\\= ([[:alnum:]_\.]+\\\)[[:space:]]*;$" > "Regexp for import statements.") > -(defconst org-babel-java--class-re "^[[:space:]]*\\\(?:public[[:space:]]= +\\\)?class[[:space:]]+\\\([[:alnum:]_]+\\\)[[:space:]]*\n?[[:space:]]*{" > +(defconst org-babel-java--class-re "^[[:space:]]*\\\(?:public[[:space:]]= +\\\)?class[[:space:]]+\\\([[:alnum:]_]+\\\)[[:space:]]*{" > "Regexp for the class declaration.") > -(defconst org-babel-java--main-re "public static void main(String\\\(?:\= \[]\\\)?[[:space:]]+[^ ]+\\\(?:\\[]\\\)?).*\n?[[:space:]]*{" > +(defconst org-babel-java--main-re "public[[:space:]]+static[[:space:]]+v= oid[[:space:]]+main[[:space:]]*([[:space:]]*String[[:space:]]*.*[[:space:]]= *)[[:space:]]*.*[[:space:]]*{" > "Regexp for the main method declaration.") > -(defconst org-babel-java--any-method-re "public .*(.*).*\n?[[:space:]]*{" > +(defconst org-babel-java--any-method-re "public[[:space:]]+.*[[:space:]]= *([[:space:]]*.*[[:space:]]*)[[:space:]]*.*[[:space:]]*{" > "Regexp for any method.") Not speaking Java, I don't have anything actually valuable to say about this change, but I wouldn't complain if these regular expressions were switched over to rx (or at least tamed a bit in terms of line length). Thanks for the fixes.