From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 39190@debbugs.gnu.org, felician.nemeth@gmail.com, juri@linkov.net
Subject: bug#39190: 28.0.50; two buffers with same buffer-file-name (diff-syntax-fontify-props)
Date: Tue, 28 Jan 2020 08:58:32 -0500 [thread overview]
Message-ID: <jwvk15bhevv.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <83blqontlu.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 28 Jan 2020 05:32:45 +0200")
> I wasn't following this thread closely, so I don't have a clear idea
> what problems does this change try to solve. Could you humor me with
> a summary, please? Why isn't buffer-file-name enough?
Some packages set `buffer-file-name` in temp-buffers in order to
activate the major mode of the corresponding file. As you can see in
the patch it's used in various circumstances.
Most of the time this is harmless because it's transient, but it is
fundamentally a lie (it more or less claims that this temp buffer holds
the content of that file, even though it's not the case (not only
because the content doesn't match, but the buffer is usually not fully
set up as a proper file buffer, it can lead to get-file-buffer returning
the wrong buffer, ...) and even though it's transient it can cause
problems because hooks are run during this time (e.g. major mode hooks)
which may take action under the mistaken assumption that this buffer
really correspond to the file.
In the original bug report the problem was that the major mode activated
`eglot-mode` in this temp buffer. There are many ways for this to
create problems. The immediate error can be avoided in eglot of course,
but I think the problem goes deeper and we should fix it by making it
possible to set the major mode without having to lie about
`buffer-file-name`.
Stefan
next prev parent reply other threads:[~2020-01-28 13:58 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-19 11:14 bug#39190: 28.0.50; two buffers with same buffer-file-name (diff-syntax-fontify-props) Felician Nemeth
2020-01-20 22:56 ` Juri Linkov
2020-01-20 23:34 ` Stefan Monnier
2020-01-24 0:13 ` Juri Linkov
2020-01-24 14:18 ` Stefan Monnier
2020-01-28 0:01 ` Juri Linkov
2020-01-28 1:30 ` Stefan Monnier
2020-01-28 3:32 ` Eli Zaretskii
2020-01-28 13:58 ` Stefan Monnier [this message]
2020-01-28 14:54 ` Dmitry Gutov
2020-01-28 22:53 ` Juri Linkov
2020-01-28 17:54 ` Eli Zaretskii
2020-01-28 20:12 ` Stefan Monnier
2020-01-28 20:23 ` Eli Zaretskii
2020-01-28 23:17 ` Stefan Monnier
2020-01-29 17:13 ` Eli Zaretskii
2020-01-29 21:33 ` Stefan Monnier
2020-01-30 14:17 ` Eli Zaretskii
2020-01-30 14:34 ` Stefan Monnier
2020-01-30 22:50 ` Juri Linkov
2020-01-30 23:09 ` Stefan Monnier
2020-01-30 23:31 ` Dmitry Gutov
2020-01-26 19:34 ` Felician Nemeth
2020-01-28 0:05 ` Juri Linkov
2020-01-28 17:18 ` Felician Nemeth
2020-01-29 23:07 ` Juri Linkov
2020-01-30 19:48 ` Felician Nemeth
2020-01-30 22:45 ` Juri Linkov
2020-02-02 9:42 ` Felician Nemeth
2020-02-02 13:50 ` Stefan Monnier
2020-02-02 23:41 ` Juri Linkov
2020-02-03 13:14 ` Dmitry Gutov
2020-02-03 22:44 ` Juri Linkov
2020-02-04 13:08 ` Dmitry Gutov
2020-02-03 22:45 ` Juri Linkov
2020-02-04 13:36 ` Stefan Monnier
2020-02-04 23:20 ` Juri Linkov
2020-02-05 22:39 ` Juri Linkov
2020-02-09 16:06 ` Felician Nemeth
2020-02-18 0:06 ` Juri Linkov
2020-02-18 13:33 ` Stefan Monnier
2020-02-18 22:53 ` Juri Linkov
2020-02-18 23:07 ` Stefan Monnier
2020-02-18 23:31 ` Stefan Monnier
2020-02-19 0:49 ` Juri Linkov
2020-02-19 13:20 ` Stefan Monnier
2020-02-20 0:58 ` Juri Linkov
2020-03-24 21:37 ` Juri Linkov
2020-03-24 22:29 ` Stefan Monnier
2020-03-25 20:39 ` Juri Linkov
2020-03-25 21:13 ` Stefan Monnier
2020-03-25 21:48 ` Juri Linkov
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=jwvk15bhevv.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=39190@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=felician.nemeth@gmail.com \
--cc=juri@linkov.net \
/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).