unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Sean Whitton <spwhitton@spwhitton.name>
Cc: 60787@debbugs.gnu.org, juri@linkov.net
Subject: bug#60787: setq-mode-local doesn't work for buffers not visiting files
Date: Thu, 19 Jan 2023 08:31:57 +0200	[thread overview]
Message-ID: <83358711cy.fsf@gnu.org> (raw)
In-Reply-To: <87zgafea71.fsf@melete.silentflame.com> (message from Sean Whitton on Wed, 18 Jan 2023 15:42:42 -0700)

> Cc: 60787@debbugs.gnu.org
> From: Sean Whitton <spwhitton@spwhitton.name>
> 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?





  reply	other threads:[~2023-01-19  6:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13 17:32 bug#60787: setq-mode-local doesn't work for buffers not visiting files Sean Whitton
2023-01-17  7:31 ` Juri Linkov
2023-01-18 22:42   ` Sean Whitton
2023-01-19  6:31     ` Eli Zaretskii [this message]
2023-01-19 21:06       ` Sean Whitton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83358711cy.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=60787@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=spwhitton@spwhitton.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).