[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: buffer-modified indicator in mode line - distinguish savable from un
RE: buffer-modified indicator in mode line - distinguish savable from unsavable changes
Sun, 2 Jul 2006 08:14:02 -0700
Before anybody else says it, we are talking about Emacs 23 here, aren't
23, 24,... I don't know - after the incipient 22, in any case.
nobody seems to have firmly defined "changed". Currently "changed"
seems to mean something like "there are entries in the undo list". I
think it would be better redefined as "a state in which saving
the buffer would change the file".
That's what I was saying is (to me) the most important distinction: savable
changes. I allow, however, that seeing an indication of non-savable might
also could be interesting, at least to some people, in some contexts (some
of the time).
Thus setting faces would set the changed flag in Enriched Mode, but not
in Emacs Lisp Mode.
Good point. I hadn't thought about Enriched Mode (I'm not familiar with it).
Is there any benefit whatsoever in regarding a "type 2 change" as a
change at all? I don't see one.
It can let you know that a face change, for instance, actually took place.
Depending on the context, some face changes might not be noticeable. And
there are other buffer changes that are always invisible.
A buffer, even a buffer associated with a file, is not just an unsaved file.
A buffer has lots of properties. I imagine that it can sometimes be useful
to know if the buffer has changed in any way.
However, that brings up another point. IIUC, there are some changes of
buffer properties that are not undoable, so they are not reflected in the
mode line. If that's true, then there are these four conditions:
-- no changes
== only non-undoable changes
++ only non-undoable and non-savable changes
** savable changes (plus, perhaps other types)
There is probably no point, and probably no mechanism for, indicating the ==
condition. Today, we don't distinguish -- from ==.
There is a point in distinguishing ++ from ** (see my previous email).
Today, we don't distinguish them. If we don't allow a third mode-line
indicator (++), then I would rather have ++ subsumed by -- than by ** - I am
most interested in knowing whether or not the buffer needs to be saved.
The consequences of the current (lack of) definition are seen in
font-lock.el in the existence of the ugly macro `save-buffer-state'. We
shouldn't need macros like this.
I'm not familiar with that. Can you elaborate?
All in Emacs 23, of course.
Not 22, anyway.