unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 70587@debbugs.gnu.org, jidanni@jidanni.org
Subject: bug#70587: More buffers that ought to be read-only
Date: Sun, 28 Apr 2024 08:13:48 +0300	[thread overview]
Message-ID: <86bk5uul0z.fsf@gnu.org> (raw)
In-Reply-To: <jwvpluajiyh.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Sat, 27 Apr 2024 23:02:16 -0400)

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: Dan Jacobson <jidanni@jidanni.org>,  70587@debbugs.gnu.org
> Date: Sat, 27 Apr 2024 23:02:16 -0400
> 
> > Stefan, this seems to be due to your changes in b2e4481906ec: you
> > added '(setq buffer-read-only t)' which was not there before (in fact,
> > the code before those changes did the opposite:
> >
> > --- a/lisp/vc/diff.el
> > +++ b/lisp/vc/diff.el
> > @@ -131,37 +147,32 @@
> > -        (thisdir default-directory)
> > -        proc)
> > -    (save-excursion
> > -      (display-buffer buf)
> > -      (set-buffer buf)
> > -      (setq buffer-read-only nil)
> > +    (with-current-buffer buf
> > +      (setq buffer-read-only t)
> >
> > So I suggest to remove the setting of buffer-read-only there'
> > diff-mode will do TRT according to diff-default-read-only.
> 
> There is no right or wrong answer here.  The current design reflects the
> behavior I think makes more sense, but that's largely just my
> personal preference.  The above patch was no mistake.

If your personal preference is that diff-mode buffers should be
read-only, then you (and those who agree with you) should customize
diff-default-read-only to a non-nil value.  What we have now is a
mess: some cases which invoke diff-mode behave according to
diff-default-read-only, while others behave differently
unconditionally.

However, if by "no mistake" you mean something else, please elaborate
why it was no mistake.

> But if we install the above patch, then *vc-diff* will suddenly not be
> read-only any more, so we should arguably change
> `diff-default-read-only` at the same time, which will in turn cause
> another behavior change when people open a `.diff` file.

Why should *vc-diff* be read-only regardless of
diff-default-read-only?  And why visiting a .diff file is different in
this regard?





  parent reply	other threads:[~2024-04-28  5:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26  1:16 bug#70587: More buffers that ought to be read-only Dan Jacobson
2024-04-26  9:58 ` Sean Whitton
2024-04-26 10:48 ` Eli Zaretskii
2024-04-26 11:02   ` Dan Jacobson
2024-04-26 11:13     ` Eli Zaretskii
2024-04-27  7:24       ` Dan Jacobson
2024-04-27  7:57         ` Eli Zaretskii
2024-04-27  8:15           ` bug#70602: Add hooks to control *Shell Command Output* Dan Jacobson
2024-04-28  3:02           ` bug#70587: More buffers that ought to be read-only Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-28  4:26             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-28  5:13             ` Eli Zaretskii [this message]
2024-04-28  9:04               ` Dan Jacobson
2024-04-28 14:57               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-28 15:18                 ` Eli Zaretskii
2024-04-28 15:30                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-04 11:22                     ` Eli Zaretskii
2024-05-04 14:36                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-04 21:40                         ` Dan Jacobson
2024-05-05  5:36                           ` Eli Zaretskii
2024-04-28 20:35               ` Dmitry Gutov
2024-04-29  6:57                 ` Eli Zaretskii
2024-04-30  9:56                 ` Dan Jacobson

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=86bk5uul0z.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=70587@debbugs.gnu.org \
    --cc=jidanni@jidanni.org \
    --cc=monnier@iro.umontreal.ca \
    /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).