unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: buffer-modified indicator in mode line - distinguish savable from unsavable changes
Date: Sat, 1 Jul 2006 19:42:25 -0700	[thread overview]
Message-ID: <MEEKKIABFKKDFJMPIOEBIENFDCAA.drew.adams@oracle.com> (raw)

The buffer-modified indicator in the mode line reflects two kinds of changes
to the buffer: 1) changes that will make a difference if the buffer is saved
and 2) changes that will not make any difference (the saved file will be the
same, whether or not the buffer was changed in this way only).

An example of a type 1 change is typing or deleting text. An example of a
type 2 change is changing the face of a some text (e.g. using the facemenu).

Type 1 changes let you rely upon interpreting ** in the mode line to mean
that the buffer has not been saved since the last change. Well, that's true
for type 2 changes too, but in that case saving makes no difference: type 2
changes are not saved.

I think it would be more useful to distinguish these two kinds of changes in
some way, in the mode line. While it can sometimes be useful to know if a
type 2 change actually took effect, most of the time I only want to see if
the buffer needs saving, and for that type 2 changes are irrelevant.

I would like to have the buffer-modified flag show 3 states: 1) unchanged,
2) type 2 changes only, 3) at least one type 1 change. The indicator might
show this, for example: -- for unchanged (1), ++ for type 2 changes only
(2), ** for at least one type 1 change (3). That way, ++ would show that
something unsavable has changed, and ** would show that something savable
has changed. For -- and ++, there is no need to save the buffer. When
undoing, it is enough, for purposes of getting back to the saved buffer, to
undo until ** changes to ++ (or --).

WDOT? If others don't like that idea, how about at least having a user
option that let's the buffer-modified indicator ignore type 2 changes, if a
user prefers that (which I do)? With that option turned on, ** would always
mean that a savable change has been made since the last save, and -- would
always mean that the buffer does not need to be saved (any changes made so
far are unsavable).

             reply	other threads:[~2006-07-02  2:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-02  2:42 Drew Adams [this message]
2006-07-02  9:03 ` buffer-modified indicator in mode line - distinguish savable from unsavable changes Alan Mackenzie
2006-07-02 15:14   ` Drew Adams
2006-07-02 22:30 ` Richard Stallman

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=MEEKKIABFKKDFJMPIOEBIENFDCAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    /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).