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: Thu, 20 Feb 2020 02:58:20 +0200 Organization: LINKOV.NET Message-ID: <87wo8ioz0z.fsf@mail.linkov.net> References: <875zh73dg8.fsf@betli.tmit.bme.hu> <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> <87o8twep2f.fsf@mail.linkov.net> <87sgj78q2o.fsf@mail.linkov.net> <87r1yr2yge.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="105277"; 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, Felician Nemeth To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 20 02:00:12 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 1j4aCJ-000RFO-TK for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 20 Feb 2020 02:00:12 +0100 Original-Received: from localhost ([::1]:34428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4aCI-0008Ue-Lp for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Feb 2020 20:00:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55328) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4aCB-0008UU-HY for bug-gnu-emacs@gnu.org; Wed, 19 Feb 2020 20:00:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4aCA-0003NQ-HK for bug-gnu-emacs@gnu.org; Wed, 19 Feb 2020 20:00:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37645) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j4aCA-0003Lq-70 for bug-gnu-emacs@gnu.org; Wed, 19 Feb 2020 20:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j4aCA-0003JB-2H for bug-gnu-emacs@gnu.org; Wed, 19 Feb 2020 20:00: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: Thu, 20 Feb 2020 01:00:01 +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.158216035412630 (code B ref 39190); Thu, 20 Feb 2020 01:00:01 +0000 Original-Received: (at 39190) by debbugs.gnu.org; 20 Feb 2020 00:59:14 +0000 Original-Received: from localhost ([127.0.0.1]:43618 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j4aBO-0003He-9d for submit@debbugs.gnu.org; Wed, 19 Feb 2020 19:59:14 -0500 Original-Received: from fossa.birch.relay.mailchannels.net ([23.83.209.62]:20119) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j4aBM-0003HT-Hk for 39190@debbugs.gnu.org; Wed, 19 Feb 2020 19:59:13 -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 1B46F3417ED; Thu, 20 Feb 2020 00:59:11 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a76.g.dreamhost.com (100-96-217-5.trex.outbound.svc.cluster.local [100.96.217.5]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 911B53416AE; Thu, 20 Feb 2020 00:59:10 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a76.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); Thu, 20 Feb 2020 00:59:11 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Gusty-Irritate: 06edf4115642bad5_1582160350832_3138149028 X-MC-Loop-Signature: 1582160350832:1253166760 X-MC-Ingress-Time: 1582160350832 Original-Received: from pdx1-sub0-mail-a76.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a76.g.dreamhost.com (Postfix) with ESMTP id 0EDD0B071D; Wed, 19 Feb 2020 16:59:06 -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=tXEvO9PQFuYX3pTaNFq/q1laCFU=; b= VtYIvjafSCeenVxAvB1Z1oDylq0lp4PXix6D75AYVX0fKKJinNX6gzALq6FK30YX l6Urj7HOZECy+ilXotvPVpsjwhrCIk0KMqPOIYp+hCx3jF2s+Wr3ZguZALWM2qYl K+YL9qeW2aJZvptUXh/CSjUb3u2s7xuZiQ4yGqFhUTA= 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-a76.g.dreamhost.com (Postfix) with ESMTPSA id A3311B071E; Wed, 19 Feb 2020 16:59:03 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a76 In-Reply-To: (Stefan Monnier's message of "Wed, 19 Feb 2020 08:20:11 -0500") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedugedrkedugddvlecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtfedrvdejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhppdhhvghloheplhhotggrlhhhohhsthdrlhhinhhkohhvrdhnvghtpdhinhgvthepledurdduvdelrddutdefrddvjedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehmohhnnhhivghrsehirhhordhumhhonhhtrhgvrghlrdgtrg 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:176268 Archived-At: >> I tested this with additional patch that replaces `conf-mode` calls with >> `conf-guess-mode`, and see that syntax font-lock now is fixed in diff-mode >> on some conf files (not tested on all possible conf submodes). > > This said. Using delay-mode-hooks in the diff-syntax driver is an ugly > hack and is the real source of the problem, so splitting conf-mode into > two is basically a way to work around the breakage introduced by the hack. Indeed, but it seems it's too late to redesign this in the release branch. So unfontified conf-mode files in diff hunks is a trade-off for not breaking the release. As for changes in master, I tried something like this to use in diff-syntax-fontify-props instead of direct set-auto-mode call: (let ((buffer (make-indirect-buffer (current-buffer) (generate-new-buffer-name (buffer-name))))) (funcall (unwind-protect (with-current-buffer buffer (let ((buffer-file-name "/tmp/foo.el")) (set-auto-mode) major-mode)) (kill-buffer buffer)))) It calls set-auto-mode in a temporary buffer. Do you think this is the right direction?