From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#54034: 29.0.50; Diff prettify broken for empty files Date: Wed, 29 Jun 2022 14:55:18 -0400 Message-ID: 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> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6861"; 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: Matthias Meulien Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 29 20:56:31 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 1o6crX-0001bf-1j for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Jun 2022 20:56:31 +0200 Original-Received: from localhost ([::1]:34748 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o6crV-0003d0-SA for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Jun 2022 14:56:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6cr4-0003cf-32 for bug-gnu-emacs@gnu.org; Wed, 29 Jun 2022 14:56:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38097) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o6cr3-00010p-RV for bug-gnu-emacs@gnu.org; Wed, 29 Jun 2022 14:56:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o6cr3-0008Fo-MI for bug-gnu-emacs@gnu.org; Wed, 29 Jun 2022 14:56:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Jun 2022 18:56: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.165652893131684 (code B ref 54034); Wed, 29 Jun 2022 18:56:01 +0000 Original-Received: (at 54034) by debbugs.gnu.org; 29 Jun 2022 18:55:31 +0000 Original-Received: from localhost ([127.0.0.1]:60227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6cqZ-0008Ey-K8 for submit@debbugs.gnu.org; Wed, 29 Jun 2022 14:55:31 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:23295) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6cqV-0008Ec-6P for 54034@debbugs.gnu.org; Wed, 29 Jun 2022 14:55:30 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 52F768070D; Wed, 29 Jun 2022 14:55:21 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id E220A80636; Wed, 29 Jun 2022 14:55:19 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1656528919; bh=m3SbCIOeB8gwzwezdW34owCYMxwnoTN79TXM5pDL5aw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Eys20SxYkBh1/Y/PSDT/M6FQFxlz10vbqtNNcaIoSeeHS39KFsRIj0x7FmTDOKCq3 Uq0BwknRPbXvbC09nc4kQ1QSGoO8gIw/M8WZgjB5fMJpcQogeLWgel7sGnNx+EOaEv 6oJR+pYR5oL0q4dqfzeke3fRq5GxQYN6i39/UjOi3LwmclYpXQsU8Uk/vkS1wfHyUW z6gM9aZpAcyj7cCrGTt1iB+ICAWv1JNvz0n0Vdhm8vCcpgwnjGo4fz9kYVXZUHuP7C bNv4vdz02/w6T60WWbNj0SKs3isBrXw+sEwXxN8lJuqTsHYBR2qH+IrwtGNbhzWNSr RGucT6c8GfyrA== Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C6122120488; Wed, 29 Jun 2022 14:55:19 -0400 (EDT) In-Reply-To: <87iloj49fb.fsf@gmail.com> (Matthias Meulien's message of "Wed, 29 Jun 2022 20:22:00 +0200") 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:235664 Archived-At: > 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. [ 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. ] Stefan