From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#60787: setq-mode-local doesn't work for buffers not visiting files Date: Thu, 19 Jan 2023 08:31:57 +0200 Message-ID: <83358711cy.fsf@gnu.org> References: <86sfg9bpto.fsf@mail.linkov.net> <87zgafea71.fsf@melete.silentflame.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3190"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60787@debbugs.gnu.org, juri@linkov.net To: Sean Whitton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 19 07:32:20 2023 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 1pIOTD-0000bT-F1 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Jan 2023 07:32:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIOT1-0000ZL-Ig; Thu, 19 Jan 2023 01:32:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pIOSw-0000Z7-IS for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2023 01:32:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIOSw-0004F0-86 for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2023 01:32:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pIOSv-0005U6-TQ for bug-gnu-emacs@gnu.org; Thu, 19 Jan 2023 01:32:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Jan 2023 06:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60787 X-GNU-PR-Package: emacs Original-Received: via spool by 60787-submit@debbugs.gnu.org id=B60787.167410991021062 (code B ref 60787); Thu, 19 Jan 2023 06:32:01 +0000 Original-Received: (at 60787) by debbugs.gnu.org; 19 Jan 2023 06:31:50 +0000 Original-Received: from localhost ([127.0.0.1]:42379 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIOSk-0005Te-BG for submit@debbugs.gnu.org; Thu, 19 Jan 2023 01:31:50 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pIOSi-0005TQ-VY for 60787@debbugs.gnu.org; Thu, 19 Jan 2023 01:31:49 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pIOSc-0004C0-SG; Thu, 19 Jan 2023 01:31:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=34GDZ9RfREZEa4BGuaE/XnSrd/yGbIIp6zACX5BMklI=; b=LD1FcHuWLA9f 1neBAMqvIvkPcLWl5acNlk6kt1dUfj/c5uCcxNnmsqA529EWg8LODRAA+mPziMnIhmQ14zRxB4vya X//+ja9H7ei42QwySpS/nRMOXyRbWg0FAvQrYJ5yHrE89vWYb1r60VEZRcMfHkDSJarlUegwiKM0g kavu9/lmS2aBamEKzamTrp8OLs2lpCYkWLfQpA+FcWcvuMcjaOaJxEJUU8OCmpZ/8Cfgr/utlr11z GA2n/SXwkT5NBI3tcaXmlABDkNJ2Bl0MHWbvk3NX7Lfz6PJwphu87RsQynKFbKHZnIS29cqdpKjYX cFy4hST04zFwtwr5Msg6eg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pIOSb-0003zp-V4; Thu, 19 Jan 2023 01:31:42 -0500 In-Reply-To: <87zgafea71.fsf@melete.silentflame.com> (message from Sean Whitton on Wed, 18 Jan 2023 15:42:42 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:253677 Archived-At: > Cc: 60787@debbugs.gnu.org > From: Sean Whitton > Date: Wed, 18 Jan 2023 15:42:42 -0700 > > On Tue 17 Jan 2023 at 09:31AM +02, Juri Linkov wrote: > > >> (setq-mode-local diff-mode view-read-only nil) > >> > >> doesn't affect *vc-diff* buffers, but it should, according to the docstring of > >> setq-mode-local. > > > > Is this because of the condition `(buffer-file-name b)` > > in mode-local-map-file-buffers? > > Yes, but also how setq-mode-local relies on find-file-hook. All of mode-local.el is written under the assumption that only file-visiting buffers are supported. Evidently, it assumes that modes for buffers that don't visit files are "not interesting" enough. This assumption is explicitly in the doc strings of some of its functions. I don't know why this was the assumption (maybe because CEDET was about support of editing program source files?), but if we want to lift the restriction, it would require changing many of the functions in the package, not just this one. Maybe we should do that. mode-local.el wasn't significantly changed since it was added to Emacs as part of CEDET merge, so maybe it's time to extend it?