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: Tue, 18 Feb 2020 02:06:48 +0200 Message-ID: <87o8twep2f.fsf@mail.linkov.net> References: <875zh73dg8.fsf@betli.tmit.bme.hu> <8736c921s6.fsf@mail.linkov.net> <875zh13e5d.fsf@mail.linkov.net> <87h80iqafm.fsf@betli.tmit.bme.hu> <87ftg0fnyb.fsf@mail.linkov.net> <87d0b3qz3m.fsf@betli.tmit.bme.hu> <871rrhkgkm.fsf@mail.linkov.net> <87v9os914e.fsf@betli.tmit.bme.hu> <87a764y35u.fsf@mail.linkov.net> <87r1zd8gvx.fsf@betli.tmit.bme.hu> <87imknqogu.fsf@mail.linkov.net> <87lfpi548j.fsf@mail.linkov.net> <87a75wek14.fsf@mail.linkov.net> <87sgjj7njt.fsf@betli.tmit.bme.hu> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="30433"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: 39190@debbugs.gnu.org, Stefan Monnier To: Felician Nemeth Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 18 01:16:21 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 1j3qYk-0007kM-J3 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Feb 2020 01:16:18 +0100 Original-Received: from localhost ([::1]:54914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3qYi-0008R2-IW for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 17 Feb 2020 19:16:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37878) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j3qYV-0008Le-SA for bug-gnu-emacs@gnu.org; Mon, 17 Feb 2020 19:16:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j3qYU-0001a7-Rz for bug-gnu-emacs@gnu.org; Mon, 17 Feb 2020 19:16:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33414) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j3qYU-0001a2-Ou for bug-gnu-emacs@gnu.org; Mon, 17 Feb 2020 19:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j3qYU-0000t9-Kz for bug-gnu-emacs@gnu.org; Mon, 17 Feb 2020 19:16: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, 18 Feb 2020 00:16: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.15819849133339 (code B ref 39190); Tue, 18 Feb 2020 00:16:02 +0000 Original-Received: (at 39190) by debbugs.gnu.org; 18 Feb 2020 00:15:13 +0000 Original-Received: from localhost ([127.0.0.1]:39383 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j3qXh-0000rm-7Y for submit@debbugs.gnu.org; Mon, 17 Feb 2020 19:15:13 -0500 Original-Received: from aye.elm.relay.mailchannels.net ([23.83.212.6]:59050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j3qXf-0000rc-2l for 39190@debbugs.gnu.org; Mon, 17 Feb 2020 19:15:12 -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 9E3F4502768; Tue, 18 Feb 2020 00:15:09 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a38.g.dreamhost.com (100-96-215-16.trex.outbound.svc.cluster.local [100.96.215.16]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 239A3501CA1; Tue, 18 Feb 2020 00:15:09 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a38.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, 18 Feb 2020 00:15:09 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Madly-Madly: 5d3b3af3508a6a91_1581984909464_2333617828 X-MC-Loop-Signature: 1581984909464:3569247042 X-MC-Ingress-Time: 1581984909463 Original-Received: from pdx1-sub0-mail-a38.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a38.g.dreamhost.com (Postfix) with ESMTP id DB3BEB27A0; Mon, 17 Feb 2020 16:15: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=jqub7Im429NW7TDB7EKiyk1t8G0=; b= C8SO5Op7SghZBCVJKO07TWgU8mdmEs2y3NhF3dMGMb5lo7BUYPuYc2FrhUzneFOe BXFi1JAaWHt0hvKDFPfvSkyo1Nf/AlrA3j2B8iOD3C/ryhk+OF1LCqy14jBR3kk3 6A0cAQ8s035rhm8pqtFpqUT15Rqa/os42bewl+Ao/gw= Original-Received: from localhost.linkov.net (m91-129-103-27.cust.tele2.ee [91.129.103.27]) (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-a38.g.dreamhost.com (Postfix) with ESMTPSA id A346CB2700; Mon, 17 Feb 2020 16:15:00 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a38 In-Reply-To: <87sgjj7njt.fsf@betli.tmit.bme.hu> (Felician Nemeth's message of "Sun, 09 Feb 2020 17:06:30 +0100") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedugedrjeejgddulecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdefrddvjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehlohgtrghlhhhoshhtrdhlihhnkhhovhdrnhgvthdpihhnvghtpeeluddruddvledruddtfedrvdejpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepfhgvlhhitghirghnrdhnvghmvghthhesghhmrghilhdrtghomh 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:176173 Archived-At: >>> delay-mode-hooks was intended as the safest workaround to install in emacs-27. >> >> delay-mode-hooks is now in emacs-27. > > This makes the original problem disappear. Thank you. Unfortunately, this change broke diff-syntax font-lock of conf-space-mode - font-lock from files in conf-space-mode is not displayed in diffs anymore. First, these steps show how it used to work when set-auto-mode was called from diff-syntax-fontify-props without wrapping in delay-mode-hooks macro: - diff-syntax-fontify-props calls set-auto-mode - in auto-mode-alist a file extension is associated with conf-mode-maybe - conf-mode-maybe calls conf-mode - conf-mode checks for the variable 'delay-mode-hooks': - initially delay-mode-hooks is nil, so call conf-space-mode - conf-space-mode calls its parent mode conf-mode again - when conf-mode is called again, its delay-mode-hooks is t and it sets its mode variables. Now the failure caused by wrapping (delay-mode-hooks (set-auto-mode)) in diff-syntax-fontify-props is because on the first call of conf-mode, the variable 'delay-mode-hooks' is already t, not nil as it was before the change. All this due to such trick used in conf-mode with these comments: (defun conf-mode () ... ;; `conf-mode' plays two roles: it's the parent of several sub-modes ;; but it's also the function that chooses between those submodes. ;; To tell the difference between those two cases where the function ;; might be called, we check `delay-mode-hooks'. ;; (adopted from tex-mode.el) (if (not delay-mode-hooks) ;; try to guess sub-mode of conf-mode based on buffer content So it detects the situation when define-derived-mode runs the parent with delay-mode-hooks. I have no idea what to do in this case.