unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <rms@gnu.org>, "'Bob Rogers'" <rogers-emacs@rgrjr.dyndns.org>
Cc: emacs-devel@gnu.org
Subject: RE: C-x C-v considered harmful
Date: Sun, 5 Jul 2009 07:56:10 -0700	[thread overview]
Message-ID: <3FE6FCE18E1B42278673EC544B3CE41B@us.oracle.com> (raw)
In-Reply-To: <E1MNOnW-0003Ba-O8@fencepost.gnu.org>

>     But I am really curious to know why Richard changed 
>     this in rev 1.192 to the current (and (buffer-modified-p) 
>     (buffer-file-name)) behavior. Richard, do you remember?
> 
> I don't remember, but I would guess it is becuase most 
> non-file-visiting buffers don't contain precious information.
> I probably did not think about the cases where they do.

To be clear about my own position: I said I think the right test for
`kill-buffer'  to use is `(or buffer-read-only (buffer-modified-p))', but that
is only if people decide that loss of data in non-file buffers is indeed a
problem that needs solving.

Personally, I don't have a problem with the current situation, but if we do
decide to make a change to prevent data loss in such buffers, then I think that
is the best such change.

Another, alternative possibility would be to test whether (besides a modified
file buffer) the buffer belongs to some specified set. The set of buffers to
warn about could be defined using a list of buffer names or regexps that match
buffer names.

I mention this because I think it does make sense that most modified non-file
buffers _not_ warn you when they are killed - perhaps even most that are not
read-only. If `kill-buffer' were to warn each time you kill such a buffer it
might prove annoying.

However, the `buffer-read-only' test would go a long way toward eliminating such
annoyance. Many non-file buffers that would be `buffer-modified-p' are in fact
read-only. That includes buffers such as `*grep*', `*Buffer List*', and Dired.
The "data" in such buffers is not normally something that we worry about losing
accidentally.

I guess the question is whether most other non-file buffers are more like
`*shell*', where a warning might be appropriate, or are more like `*grep*',
where a warning is probably inappropriate. If `*shell*' is rather the exception,
then perhaps it would be best to treat it as an exception, using, say, an option
`kill-buffer-warn-regexps', with a value of, say, `(,(regexp-quote "*shell*"))'.
IOW, do something similar to `same-window-regexps' and
`same-window-buffer-names'.





  reply	other threads:[~2009-07-05 14:56 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-02  1:18 C-x C-v considered harmful Bob Rogers
2009-07-02  2:39 ` Miles Bader
2009-07-02  3:10   ` Bob Rogers
2009-07-02  6:48   ` Kevin Rodgers
2009-07-02 15:17     ` Drew Adams
2009-07-03  1:09       ` Bob Rogers
2009-07-03  3:19         ` Drew Adams
2009-07-03 20:33           ` Bob Rogers
2009-07-03 22:23             ` Drew Adams
2009-07-04 23:16               ` Bob Rogers
2009-07-05  7:13                 ` Drew Adams
2009-07-06  0:39                   ` Bob Rogers
2009-07-06  1:40                     ` Drew Adams
2009-07-07 10:39                       ` Johan Bockgård
2009-07-05 10:18                 ` Richard Stallman
2009-07-05 14:56                   ` Drew Adams [this message]
2009-07-05  0:05               ` Richard Stallman
2009-07-05  7:10                 ` Drew Adams
2009-07-06 15:05                   ` Richard Stallman
2009-07-06 15:59                     ` Drew Adams
2009-07-07 10:05                       ` Richard Stallman
2009-07-06 12:04                 ` Robert J. Chassell
2009-07-06 23:49                 ` Juri Linkov
2009-07-07  1:07                   ` Drew Adams
2009-07-08  0:32                     ` Juri Linkov
2009-07-08 23:28                       ` Juri Linkov
2009-07-09 16:09                         ` Drew Adams
2009-07-09 22:10                           ` Juri Linkov
2009-07-09 22:26                             ` Drew Adams
2009-07-09 22:46                               ` Juri Linkov
2009-07-09 23:21                                 ` Drew Adams
2009-07-10  4:05                                   ` Bob Rogers
2009-07-13 20:05                         ` Juri Linkov
2009-07-16 21:57                           ` Juri Linkov
2009-07-03  2:40       ` M Jared Finder
2009-07-03  2:57         ` Miles Bader
2009-07-03 19:23         ` Richard Stallman
2009-07-03 20:07           ` Andreas Schwab
2009-07-03 20:56           ` Miles Bader
2009-07-03 13:55     ` Markus Triska
2009-07-05 22:15       ` Stefan Monnier
2009-07-05 22:42         ` Bob Rogers
2009-07-11 10:06           ` Stefan Monnier
2009-07-14  2:45             ` Bob Rogers
2009-07-14 18:34               ` Stefan Monnier
2009-07-02 21:03 ` Stefan Monnier

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=3FE6FCE18E1B42278673EC544B3CE41B@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    --cc=rogers-emacs@rgrjr.dyndns.org \
    /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).