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 mFFvGkKmr186CwAA0tVLHw (envelope-from ) for ; Sat, 14 Nov 2020 09:41:22 +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 0LBFFkKmr1/DQwAAB5/wlQ (envelope-from ) for ; Sat, 14 Nov 2020 09:41:22 +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 BC87694050F for ; Sat, 14 Nov 2020 09:41:21 +0000 (UTC) Received: from localhost ([::1]:58766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kds3c-0003sh-DD for larch@yhetil.org; Sat, 14 Nov 2020 04:41:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kds31-0003rh-VM for emacs-orgmode@gnu.org; Sat, 14 Nov 2020 04:40:47 -0500 Received: from mail-ej1-f65.google.com ([209.85.218.65]:42743) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kds2z-00066Q-Ss for emacs-orgmode@gnu.org; Sat, 14 Nov 2020 04:40:43 -0500 Received: by mail-ej1-f65.google.com with SMTP id i19so17361686ejx.9 for ; Sat, 14 Nov 2020 01:40:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=p7r5Yeg5keqRjWwcWkkglF/2sN1Deuq7ijxj9jEhP0k=; b=XHGF8f8p/PlcKsAoDdaNJc2lkM7zqMG1JVrhw0jS80X9lP+Mfy34AS3ZSFswdRVs81 QyxUVvh4Lu38jih4Rbrct0Nx3FK8JFR3Ac2Zw/IWDR/6bRltb9AD63jKXHhtPH95zyyz HIEYeybqox9jZaGe7fpBDw48AbQkKtAFGb76puwApEEG/7XsLtUPIidmpj+D/XUTqdI2 3Qub8YFfLUbvZVFajAOiW4Do/OkVrJZdyRTNLIUJLVMU4CRB7o4epDVoRApgj45PSFwc KuBiMoKkQBebdF8h9K8LZhFnjmK+VCy2WtkBRpcfCCxVfyvh2dPK+/RKappGMaEBsRUS PtDg== X-Gm-Message-State: AOAM532TB2pVSiSZB9n+E2rBx65RPD+FZrjL/Bl5g7e+QFN/4OyFVAY1 iV/uQ6Glr62IWDzzcqrRm4KYMKZ080tITOI9GRNj+MyiQBU= X-Google-Smtp-Source: ABdhPJwXXL0eDsSJTj0wiYNPz+j22OMl3s4jYjVkLlk8Uq4rHemg6nWY8+V7425bvdIUHVL/8gBmkKI/VQRuMOMbqcc= X-Received: by 2002:a17:906:3daa:: with SMTP id y10mr5850523ejh.23.1605346839682; Sat, 14 Nov 2020 01:40:39 -0800 (PST) MIME-Version: 1.0 References: <87d00h7wbr.fsf@kyleam.com> In-Reply-To: <87d00h7wbr.fsf@kyleam.com> From: ian martins Date: Sat, 14 Nov 2020 04:40:28 -0500 Message-ID: Subject: Re: [PATCH] ob-java.el: Allow for more whitespace To: Kyle Meyer Content-Type: multipart/mixed; boundary="0000000000001f084a05b40df026" Received-SPF: pass client-ip=209.85.218.65; envelope-from=ianxm1@gmail.com; helo=mail-ej1-f65.google.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/14 04:40:40 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=jhu.edu (policy=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: 0.19 X-TUID: 9t6fsS61MMEV --0000000000001f084a05b40df026 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Nov 12, 2020 at 10:46 PM Kyle Meyer wrote: > > ian martins writes: > > > 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). No problem. Gathering the list of changed names is easy (I use emacs). I thought the long list would make the entry less useful, but I can see how it makes it more searchable this way. Of course, people could search the code diffs instead and then the commit logs could just be written for people. > 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 abbreviat= e function or > variable names, and don=E2=80=99t combine them. Subsequent maintaine= rs 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 fi= nd it > when they search. > > https://www.gnu.org/prep/standards/html_node/Style-of-Change-Logs.html#St= yle-of-Change-Logs > > We should probably link to that in worg's org-contribute.org. Thanks for providing the reference. I'll add a link to worg if there isn't = one. > > * 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. Yes. The updated patch includes Reported-by. That is just text in the commit message, not a git option, right? > > -(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:]]= +void[[: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 suggestion. I hadn't seen `rx' before. It's beautiful. I converted it. That was a joy. --0000000000001f084a05b40df026 Content-Type: text/x-patch; charset="US-ASCII"; name="0002-ob-java.el-Allow-for-more-whitespace-in-java-code.patch" Content-Disposition: attachment; filename="0002-ob-java.el-Allow-for-more-whitespace-in-java-code.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_khhhx5jv1 RnJvbSA0Nzg0ZWExZTkyNmRhMDE0ZTMwYmJiYWEyNDFiMzc3OWExNDExOWY0IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBJYW4gTWFydGlucyA8aWFueG1Aamh1LmVkdT4KRGF0ZTogVGh1 LCAxMiBOb3YgMjAyMCAwNToxODo0OCAtMDUwMApTdWJqZWN0OiBbUEFUQ0ggMi8yXSBvYi1qYXZh LmVsOiBBbGxvdyBmb3IgbW9yZSB3aGl0ZXNwYWNlIGluIGphdmEgY29kZQoKKiBsaXNwL29iLWph dmEuZWwgKG9yZy1iYWJlbC1qYXZhLS1wYWNrYWdlLXJlKQoob3JnLWJhYmVsLWphdmEtLWltcG9y dHMtcmUsIG9yZy1iYWJlbC1qYXZhLS1jbGFzcy1yZSkKKG9yZy1iYWJlbC1qYXZhLS1tYWluLXJl LCBvcmctYmFiZWwtamF2YS0tYW55LW1ldGhvZC1yZSk6ClVwZGF0ZWQgcmVnZXhwcyB0byBhbGxv dyBmb3IgbW9yZSB3aGl0ZXNwYWNlIGluIHRoZSBjb250ZW50IG9mIGphdmEKY29kZSBibG9ja3Mu ICBDb252ZXJ0IHJ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