From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matthias Meulien Newsgroups: gmane.emacs.bugs Subject: bug#54034: 29.0.50; Diff prettify broken for empty files Date: Fri, 01 Jul 2022 20:56:23 +0200 Message-ID: <87edz44q7c.fsf@gmail.com> References: <87iltex7bo.fsf@gmail.com> <87v8xakm0i.fsf@gmail.com> <87bkz1jxd9.fsf@gmail.com> <87sfsbakqo.fsf@gmail.com> <87ee3v9ylm.fsf@gmail.com> <87wng1omfa.fsf@gmail.com> <87sfqpnzar.fsf@gmail.com> <87o81dnyxl.fsf@gmail.com> <87fsmpm6n6.fsf@gmail.com> <87sfnvxb1c.fsf@tcd.ie> <87iloj49fb.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31159"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: "Basil L. Contovounesios" , 54034@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 01 20:58:30 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o7LqW-0007tg-TK for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Jul 2022 20:58:28 +0200 Original-Received: from localhost ([::1]:50544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7LqV-0004vh-HT for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Jul 2022 14:58:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7Lp9-0003ba-0Q for bug-gnu-emacs@gnu.org; Fri, 01 Jul 2022 14:57:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45264) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7Lp7-00046g-Mv for bug-gnu-emacs@gnu.org; Fri, 01 Jul 2022 14:57:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o7Lp7-0003T2-Jb for bug-gnu-emacs@gnu.org; Fri, 01 Jul 2022 14:57:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Matthias Meulien Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Jul 2022 18:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54034 X-GNU-PR-Package: emacs Original-Received: via spool by 54034-submit@debbugs.gnu.org id=B54034.165670179413285 (code B ref 54034); Fri, 01 Jul 2022 18:57:01 +0000 Original-Received: (at 54034) by debbugs.gnu.org; 1 Jul 2022 18:56:34 +0000 Original-Received: from localhost ([127.0.0.1]:39161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7Log-0003SC-HL for submit@debbugs.gnu.org; Fri, 01 Jul 2022 14:56:34 -0400 Original-Received: from mail-wr1-f42.google.com ([209.85.221.42]:45963) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7Lod-0003Rx-Sa for 54034@debbugs.gnu.org; Fri, 01 Jul 2022 14:56:33 -0400 Original-Received: by mail-wr1-f42.google.com with SMTP id k7so4422274wrc.12 for <54034@debbugs.gnu.org>; Fri, 01 Jul 2022 11:56:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :user-agent:mime-version; bh=E4HIefzdcnDqJM0yeujOrOU7dx78jm3TR7azyHqfOtk=; b=gHLLcG79SHj/SJWir8+wjQdJFgrOqvA0CgcwWAQFf0Aqt4s5QKXqsNYzIpXOyZtVIZ uNBkXdev5w53OMIIid5GRaXRf31zlxojLDhjopebAWWaAjJfSe0ka+r3Bf1uDY2GP/gk IKfNOov+kXKr4auS4Ct7U0Mn6WHw1VaPilPZH9DPvw0qaJdvOCTrTLSqQGyavpnmKcQG ARugsAcHeYcFga7pC9K8G+AoUltsqYhCmGmFCYABfOjmnENzFLHWr6MGB9m9GuDrsvgt 0iRhnIm9QH+b5Wd5R9MW8qzaxRoZKGHmXndm3Nwlxrp6NoNuzUCxqAD0XDGzJFn88Ky2 OqMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:user-agent:mime-version; bh=E4HIefzdcnDqJM0yeujOrOU7dx78jm3TR7azyHqfOtk=; b=zSuh+CjhsiZQAkTBJaSPD4InIn2I9QtUm0GHqHLEDJILasvldALVxzLE64OIVjt4/j fMP+B3eN7kie//Rnz/+yGoOZw8u61JGn/U/Ibrvs0JbV8eCYKrQoCyV9v2FJal84qEqw AITJQVqljy6a45LVD2tch/DkMKDGizepEW4xmFPNIdCPhUMykh2wLZFOzT4wdxETmhsz DSL7K1phQJunSyLkgIuJevyrBpD3+ne/eQ6ejwuSA1NjVvnZ26DLAwF6/9rLuAnoD+lq 0GLhoWiIAxhluDIOL5ygn1BDIBSfvOzDvKgvWeuga4wZwHYppQR1MSAIv1XHdUZzX65X pMSQ== X-Gm-Message-State: AJIora/rTgbqkY1bBWItLbDDOP4UzGM6+QflOC20Q8cIz2IGcTuXa1WB AFD7RlIpWrB+/4BX2K+HUuSo3iagN7E= X-Google-Smtp-Source: AGRyM1ucvlSiSZoUTtsqRHdWiOFszliMRpaqZ4JpHvZWMBwyRgmVpaXIjs2KocIqhqrXP/tfaklV+w== X-Received: by 2002:a5d:6d8b:0:b0:21b:9804:1959 with SMTP id l11-20020a5d6d8b000000b0021b98041959mr14902119wrs.605.1656701785786; Fri, 01 Jul 2022 11:56:25 -0700 (PDT) Original-Received: from carbon.localdomain ([2a01:e0a:245:c850:98f5:429a:aa8e:95bb]) by smtp.gmail.com with ESMTPSA id c8-20020a05600c0a4800b003a02f957245sm4910191wmq.26.2022.07.01.11.56.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 11:56:25 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Wed, 29 Jun 2022 14:55:18 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:235839 Archived-At: Stefan Monnier writes: >> Wouldn't it be safer to simply disable prettification of the "diff >> header" when diff-buffer-type isn't equal to git? > > Could be, tho I think the current code ends up doing something similar. > > FWIW, I tend to prefer using the buffer's content rather than the value > of a buffer-local variable (to the extend possible) when deciding > whether a given diff header can be prettified. The buffer-local variable is currently initialized from the buffer content! > > [ After all, some diffs may be the result of running several commands, > some of which are Git but not all, so the "type" may be different for > different headers in the same buffer. ] Ok, I understand your point. I can't see how a regex can distinguish diff output generated in the context of a call to diff-buffers (where compared files are temporary files and a prettified message should refer to the corresponding buffer names) and a generic diff output where a user may have used any diff option including --label for whatever reason. -- Matthias