From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#39190: 28.0.50; two buffers with same buffer-file-name (diff-syntax-fontify-props) Date: Wed, 29 Jan 2020 00:53:27 +0200 Organization: LINKOV.NET Message-ID: <871rrjcgyw.fsf@mail.linkov.net> References: <875zh73dg8.fsf@betli.tmit.bme.hu> <8736c921s6.fsf@mail.linkov.net> <875zh13e5d.fsf@mail.linkov.net> <87imkwfnyv.fsf@mail.linkov.net> <83blqontlu.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="8868"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.60 (x86_64-pc-linux-gnu) Cc: 39190@debbugs.gnu.org, felician.nemeth@gmail.com, Stefan Monnier To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 29 00:18:27 2020 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 1iwa7m-0002EN-Cl for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 29 Jan 2020 00:18:26 +0100 Original-Received: from localhost ([::1]:38564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwa7l-00055w-AO for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Jan 2020 18:18:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49329) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwa7Q-0004yy-OL for bug-gnu-emacs@gnu.org; Tue, 28 Jan 2020 18:18:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iwa7O-0000qR-Om for bug-gnu-emacs@gnu.org; Tue, 28 Jan 2020 18:18:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55286) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iwa7O-0000qK-LA for bug-gnu-emacs@gnu.org; Tue, 28 Jan 2020 18:18:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iwa7O-0001uf-GF for bug-gnu-emacs@gnu.org; Tue, 28 Jan 2020 18:18:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Jan 2020 23:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39190 X-GNU-PR-Package: emacs Original-Received: via spool by 39190-submit@debbugs.gnu.org id=B39190.15802534347277 (code B ref 39190); Tue, 28 Jan 2020 23:18:02 +0000 Original-Received: (at 39190) by debbugs.gnu.org; 28 Jan 2020 23:17:14 +0000 Original-Received: from localhost ([127.0.0.1]:33022 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iwa6b-0001tI-Ks for submit@debbugs.gnu.org; Tue, 28 Jan 2020 18:17:13 -0500 Original-Received: from bongo.elm.relay.mailchannels.net ([23.83.212.21]:56564) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iwa6W-0001t6-TK for 39190@debbugs.gnu.org; Tue, 28 Jan 2020 18:17:11 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 7A84350203A; Tue, 28 Jan 2020 23:17:07 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a93.g.dreamhost.com (100-96-211-48.trex.outbound.svc.cluster.local [100.96.211.48]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id EC81E501FFA; Tue, 28 Jan 2020 23:17:06 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a93.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Tue, 28 Jan 2020 23:17:07 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Lyrical-Spicy: 52c107364b22cf3a_1580253427224_4211542375 X-MC-Loop-Signature: 1580253427224:3012536684 X-MC-Ingress-Time: 1580253427224 Original-Received: from pdx1-sub0-mail-a93.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a93.g.dreamhost.com (Postfix) with ESMTP id 5CFDA80F9A; Tue, 28 Jan 2020 15:17:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=6Kqamy1wXh3ra+2QK9avMYpMS3E=; b= crOe5fGgTIrhTvwypx1ujWrJwnMdImJujsgsLK/MLQk5i2zOOs5xm2N357NiPRKz YyFIOZrxuBBT2KN/9PKanFnqcE8wIjaSzCXrUr09/SgAljkj7odIkO4WVYl86Ryd 74Y9Mh88LnJvNPqoT7ECQwIbndhBNzQ7l5ui6+bw96s= Original-Received: from mail.jurta.org (m91-129-105-126.cust.tele2.ee [91.129.105.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a93.g.dreamhost.com (Postfix) with ESMTPSA id 4D1F480F9C; Tue, 28 Jan 2020 15:16:58 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a93 In-Reply-To: (Dmitry Gutov's message of "Tue, 28 Jan 2020 17:54:23 +0300") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedugedrfeeggdduieehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdehrdduvdeinecuvehluhhsthgvrhfuihiivgepvdenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdehrdduvdeipdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepughguhhtohhvseihrghnuggvgidrrhhu X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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:175370 Archived-At: >> it can cause >> problems because hooks are run during this time (e.g. major mode hooks) >> which may take action under the mistaken assumption that this buffer >> really correspond to the file > > I think diff-mode could also use delay-mode-hooks and then run them (or > not) outside of that let binding. Interesting idea, I see no problem with this: diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 2dbab80208..9035f7643a 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -2719,7 +2719,7 @@ diff-syntax-fontify-props (cl-assert (null buffer-file-name)) (let ((enable-local-variables :safe) ;; to find `mode:' (buffer-file-name file)) - (set-auto-mode) + (delay-mode-hooks (set-auto-mode)) ;; FIXME: Is this really worth the trouble? (when (and (fboundp 'generic-mode-find-file-hook) (memq #'generic-mode-find-file-hook