From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 0BE151F66E for ; Sun, 14 Feb 2021 08:19:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229790AbhBNISY (ORCPT ); Sun, 14 Feb 2021 03:18:24 -0500 Received: from [93.83.142.38] ([93.83.142.38]:36208 "EHLO localhost" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229563AbhBNISY (ORCPT ); Sun, 14 Feb 2021 03:18:24 -0500 X-Greylist: delayed 350 seconds by postgrey-1.27 at vger.kernel.org; Sun, 14 Feb 2021 03:18:23 EST Received: from [IPv6:::1] (localhost [IPv6:::1]) by localhost (Postfix) with ESMTP id 820D31A060; Sun, 14 Feb 2021 09:12:12 +0100 (CET) Subject: Re: [PATCH] userdiff: add support for Emacs Lisp To: =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Adam Spiers Cc: git list , Protesilaos Stavrou References: <20210213192447.6114-1-git@adamspiers.org> <87wnvbbf2y.fsf@evledraar.gmail.com> From: Johannes Sixt Message-ID: Date: Sun, 14 Feb 2021 09:12:12 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <87wnvbbf2y.fsf@evledraar.gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Am 14.02.21 um 02:41 schrieb Ævar Arnfjörð Bjarmason: > Just a cursory "git log -p -- lisp" in emacs.git with your patch shows > e.g. lisp/thingatpt.el where forms in a "defun" aren't indented (before > it selects the "defun", after with yours it's a "put" in the middle of > the function). Note that negative matches can be specified. We use the feature in the cpp case to exclude public:/protected:/private: and label: that happen to be not indented. Perhaps that can be useful here? Oh, and BTW, what the patterns treat as "function" must not match what the language treats as function. The purpose of the hunk header is to spot a place in the source file easily. So, it does not hurt if eval-and-compile forms are captured (as was mentioned in the linked thread) if desired. > > Yours also changes it from e.g.: > > @@ -61,7 +61,7 @@ forward-thing > > to: > > @@ -61,7 +61,7 @@ (defun forward-thing (thing &optional n) > > Is this really desired in elisp? It's common practice to extract the entire line (sans indentation if applicable), not just the function name. Why would somebody want the latter? It doesn't carry as much information as could be possible. > I also note how our tests in > t4018-diff-funcname.sh are really bad in not testing for this at > all. I.e. we just test that we match the right line, not how we extract > a match from it. Oh, well. These are "semi-automated" tests cases. If you have an idea how to achieve the goal without burdening test writers with lots of subtleties, be my guest. ;) > > 1. https://lists.gnu.org/archive/html/emacs-devel/2021-02/msg00739.html > -- Hannes