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: Fri, 31 Jan 2020 00:50:37 +0200 Organization: LINKOV.NET Message-ID: <87mua4woci.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="40507"; 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 Fri Jan 31 00:04:42 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 1ixIra-000AU9-4t for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 31 Jan 2020 00:04:42 +0100 Original-Received: from localhost ([::1]:40640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixIrY-0002W3-Vu for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Jan 2020 18:04:41 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34074) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixIq0-0000nX-O6 for bug-gnu-emacs@gnu.org; Thu, 30 Jan 2020 18:03:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ixIpz-0007lA-Lv for bug-gnu-emacs@gnu.org; Thu, 30 Jan 2020 18:03:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58623) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ixIpz-0007ko-H1 for bug-gnu-emacs@gnu.org; Thu, 30 Jan 2020 18:03:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ixIpz-0003Hr-DF for bug-gnu-emacs@gnu.org; Thu, 30 Jan 2020 18:03:03 -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, 30 Jan 2020 23:03:03 +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.158042537712602 (code B ref 39190); Thu, 30 Jan 2020 23:03:03 +0000 Original-Received: (at 39190) by debbugs.gnu.org; 30 Jan 2020 23:02:57 +0000 Original-Received: from localhost ([127.0.0.1]:36360 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ixIpt-0003HC-CV for submit@debbugs.gnu.org; Thu, 30 Jan 2020 18:02:57 -0500 Original-Received: from dog.birch.relay.mailchannels.net ([23.83.209.48]:38546) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ixIpr-0003H3-9o for 39190@debbugs.gnu.org; Thu, 30 Jan 2020 18:02:55 -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 162206A2641; Thu, 30 Jan 2020 23:02:54 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a43.g.dreamhost.com (100-96-7-5.trex.outbound.svc.cluster.local [100.96.7.5]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 9AA0F6A283E; Thu, 30 Jan 2020 23:02:53 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a43.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, 30 Jan 2020 23:02:54 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Grain-Stupid: 4ec81ab408f155a7_1580425373863_405080721 X-MC-Loop-Signature: 1580425373863:1254788712 X-MC-Ingress-Time: 1580425373862 Original-Received: from pdx1-sub0-mail-a43.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a43.g.dreamhost.com (Postfix) with ESMTP id 441577F470; Thu, 30 Jan 2020 15:02:48 -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=d9INx6rlOZX8shirF5GWrUoKnvQ=; b= BNph9yuPXRSxg4HYE68UTmaX5QJo2wyV60oQmpGjfgPLG3pXyKq51SfmX6Y9Zzyf /l6SDwADA0Y8a1QNQ7tFyZtIPR6jpaszRQOEYtKemJZjn5PKKWlPAdN1AQq8Yqqv cHvO1wXCFWgpC0AM06Ru+lHs45217iwIkwOa6FRa0Xk= 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-a43.g.dreamhost.com (Postfix) with ESMTPSA id 936677F104; Thu, 30 Jan 2020 15:02:45 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a43 In-Reply-To: (Stefan Monnier's message of "Mon, 27 Jan 2020 20:30:31 -0500") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedugedrfeelgddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddthedruddvieenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddthedruddviedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehmohhnnhhivghrsehirhhordhumhhonhhtrhgvrghlrdgtrg 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:175459 Archived-At: > And now that I think about it, maybe > > (or buffer-file-name-for-mode buffer-file-name) I encountered more problems with buffer-file-name-for-mode because there are more unexpected places that expect buffer-file-name: Debugger entered--Lisp error: (wrong-type-argument stringp nil) find-file-name-handler(nil file-name-sans-versions) file-name-sans-versions(nil) generic-mode-find-file-hook() diff-syntax-fontify-props(#("/dev/null" 0 9 (face (diff-file-header diff-header) fontified t)) "" (0 0) t) diff-syntax-fontify-hunk(1686 3081 t) diff-syntax-fontify(1686 3081) because it relies on non-nil buffer-file-name: (defun generic-mode-find-file-hook () ... (when (and (eq major-mode 'fundamental-mode) (or (null generic-ignore-files-regexp) (not (string-match-p generic-ignore-files-regexp (file-name-sans-versions buffer-file-name))))) ================ It would be hard to find all occurrences of buffer-file-name where to add buffer-file-name-for-mode. Maybe safer would be to use just (delay-mode-hooks (set-auto-mode))