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, 19 Feb 2020 02:49:21 +0200 Organization: LINKOV.NET Message-ID: <87r1yr2yge.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> <87o8twep2f.fsf@mail.linkov.net> <87sgj78q2o.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="100048"; 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 Wed Feb 19 01:52:16 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 1j4Db5-000PrH-Ft for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Feb 2020 01:52:15 +0100 Original-Received: from localhost ([::1]:43678 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4Db4-0000Q5-Hr for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Feb 2020 19:52:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36508) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4Dat-0000PD-ED for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2020 19:52:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4Das-0006pu-7J for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2020 19:52:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35511) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j4Dar-0006pN-Vv for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2020 19:52:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j4Dar-0001Z5-S5 for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2020 19:52:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 19 Feb 2020 00:52: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.15820734825965 (code B ref 39190); Wed, 19 Feb 2020 00:52:01 +0000 Original-Received: (at 39190) by debbugs.gnu.org; 19 Feb 2020 00:51:22 +0000 Original-Received: from localhost ([127.0.0.1]:41484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j4DaE-0001Y8-58 for submit@debbugs.gnu.org; Tue, 18 Feb 2020 19:51:22 -0500 Original-Received: from bumble.birch.relay.mailchannels.net ([23.83.209.25]:43689) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j4DaC-0001Y0-57 for 39190@debbugs.gnu.org; Tue, 18 Feb 2020 19:51:20 -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 E209A340978; Wed, 19 Feb 2020 00:51:18 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a86.g.dreamhost.com (100-96-0-6.trex.outbound.svc.cluster.local [100.96.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 76DEF3408FB; Wed, 19 Feb 2020 00:51:18 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a86.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); Wed, 19 Feb 2020 00:51:18 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Abortive-Squirrel: 289d15575373896c_1582073478714_2440147367 X-MC-Loop-Signature: 1582073478714:1425273395 X-MC-Ingress-Time: 1582073478714 Original-Received: from pdx1-sub0-mail-a86.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a86.g.dreamhost.com (Postfix) with ESMTP id 572627F04E; Tue, 18 Feb 2020 16:51:15 -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=5M23XJa/NPK24o/8elSt8A9hly0=; b= 21b0m6lujnyCQM+pr5PvojiYiQWEcL9pf4hbPeq+chgFdrNvNmojZ9hxnvwBR86A XhJreMGtzRmbTk56VpucJC+WDzHMY+x1oS7FZAFnnd+bWEsTy4YGTQfEsJQVXoCF kst8BRnoqb3tIqVvc/4mrA6E5Rlrq74Z7RSkUrJyvaI= 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-a86.g.dreamhost.com (Postfix) with ESMTPSA id 123077F027; Tue, 18 Feb 2020 16:51:12 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a86 In-Reply-To: (Stefan Monnier's message of "Tue, 18 Feb 2020 18:31:38 -0500") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedugedrjeelgddvhecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtfedrvdejnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmohguvgepshhmthhppdhhvghloheplhhotggrlhhhohhsthdrlhhinhhkohhvrdhnvghtpdhinhgvthepledurdduvdelrddutdefrddvjedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehmohhnnhhivghrsehirhhordhumhhonhhtrhgvrghlrdgtrg 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:176232 Archived-At: >> That's kinda hard if you want to use define-derived-mode and we do: when >> we call `conf-foo-mode` the first things it does is: bind >> `delay-mode-hooks` and call the parent (`conf-mode`), so the only >> difference between this call to the parent and a direct call to the >> generic entry point is the binding of `delay-mode-hooks`. > > IOW, I think we should start with something like the patch below which > makes `conf-guess-mode` available, after which we can start fixing the > various callers to call `conf-guess-mode` instead. 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). diff --git a/lisp/files.el b/lisp/files.el index 683f4a8ce7..3e1cf5e526 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2813,7 +2813,7 @@ auto-mode-alist ("/config\\.\\(?:bat\\|log\\)\\'" . fundamental-mode) ("/\\.\\(authinfo\\|netrc\\)\\'" . authinfo-mode) ;; Windows candidates may be opened case sensitively on Unix - ("\\.\\(?:[iI][nN][iI]\\|[lL][sS][tT]\\|[rR][eE][gG]\\|[sS][yY][sS]\\)\\'" . conf-mode) + ("\\.\\(?:[iI][nN][iI]\\|[lL][sS][tT]\\|[rR][eE][gG]\\|[sS][yY][sS]\\)\\'" . conf-guess-mode) ("\\.la\\'" . conf-unix-mode) ("\\.ppd\\'" . conf-ppd-mode) ("java.+\\.conf\\'" . conf-javaprop-mode) @@ -2822,15 +2822,15 @@ auto-mode-alist ("\\.desktop\\'" . conf-desktop-mode) ("/\\.redshift.conf\\'" . conf-windows-mode) ("\\`/etc/\\(?:DIR_COLORS\\|ethers\\|.?fstab\\|.*hosts\\|lesskey\\|login\\.?de\\(?:fs\\|vperm\\)\\|magic\\|mtab\\|pam\\.d/.*\\|permissions\\(?:\\.d/.+\\)?\\|protocols\\|rpc\\|services\\)\\'" . conf-space-mode) - ("\\`/etc/\\(?:acpid?/.+\\|aliases\\(?:\\.d/.+\\)?\\|default/.+\\|group-?\\|hosts\\..+\\|inittab\\|ksysguarddrc\\|opera6rc\\|passwd-?\\|shadow-?\\|sysconfig/.+\\)\\'" . conf-mode) + ("\\`/etc/\\(?:acpid?/.+\\|aliases\\(?:\\.d/.+\\)?\\|default/.+\\|group-?\\|hosts\\..+\\|inittab\\|ksysguarddrc\\|opera6rc\\|passwd-?\\|shadow-?\\|sysconfig/.+\\)\\'" . conf-guess-mode) ;; ChangeLog.old etc. Other change-log-mode entries are above; ;; this has lower priority to avoid matching changelog.sgml etc. ("[cC]hange[lL]og[-.][-0-9a-z]+\\'" . change-log-mode) ;; either user's dot-files or under /etc or some such - ("/\\.?\\(?:gitconfig\\|gnokiirc\\|hgrc\\|kde.*rc\\|mime\\.types\\|wgetrc\\)\\'" . conf-mode) + ("/\\.?\\(?:gitconfig\\|gnokiirc\\|hgrc\\|kde.*rc\\|mime\\.types\\|wgetrc\\)\\'" . conf-guess-mode) ;; alas not all ~/.*rc files are like this - ("/\\.\\(?:asound\\|enigma\\|fetchmail\\|gltron\\|gtk\\|hxplayer\\|mairix\\|mbsync\\|msmtp\\|net\\|neverball\\|nvidia-settings-\\|offlineimap\\|qt/.+\\|realplayer\\|reportbug\\|rtorrent\\.\\|screen\\|scummvm\\|sversion\\|sylpheed/.+\\|xmp\\)rc\\'" . conf-mode) - ("/\\.\\(?:gdbtkinit\\|grip\\|mpdconf\\|notmuch-config\\|orbital/.+txt\\|rhosts\\|tuxracer/options\\)\\'" . conf-mode) + ("/\\.\\(?:asound\\|enigma\\|fetchmail\\|gltron\\|gtk\\|hxplayer\\|mairix\\|mbsync\\|msmtp\\|net\\|neverball\\|nvidia-settings-\\|offlineimap\\|qt/.+\\|realplayer\\|reportbug\\|rtorrent\\.\\|screen\\|scummvm\\|sversion\\|sylpheed/.+\\|xmp\\)rc\\'" . conf-guess-mode) + ("/\\.\\(?:gdbtkinit\\|grip\\|mpdconf\\|notmuch-config\\|orbital/.+txt\\|rhosts\\|tuxracer/options\\)\\'" . conf-guess-mode) ("/\\.?X\\(?:default\\|resource\\|re\\)s\\>" . conf-xdefaults-mode) ("/X11.+app-defaults/\\|\\.ad\\'" . conf-xdefaults-mode) ("/X11.+locale/.+/Compose\\'" . conf-colon-mode) @@ -2920,7 +2920,7 @@ conf-mode-maybe (goto-char (point-min)) (looking-at "<\\?xml \\|