unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* buffer-modified indicator in mode line - distinguish savable from unsavable changes
@ 2006-07-02  2:42 Drew Adams
  2006-07-02  9:03 ` Alan Mackenzie
  2006-07-02 22:30 ` Richard Stallman
  0 siblings, 2 replies; 4+ messages in thread
From: Drew Adams @ 2006-07-02  2:42 UTC (permalink / 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).

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-07-02 22:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-02  2:42 buffer-modified indicator in mode line - distinguish savable from unsavable changes Drew Adams
2006-07-02  9:03 ` Alan Mackenzie
2006-07-02 15:14   ` Drew Adams
2006-07-02 22:30 ` Richard Stallman

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).