unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Subject: RE: buffer-modified indicator in mode line - distinguish savable from unsavable changes
Date: Sun, 2 Jul 2006 08:14:02 -0700	[thread overview]
Message-ID: <EIENLHALHGIMHGDOLMIMAEDOCJAA.drew.adams@oracle.com> (raw)
In-Reply-To: <20060702090311.GA1263@muc.de>

    Before anybody else says it, we are talking about Emacs 23 here, aren't
    we?

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.

  reply	other threads:[~2006-07-02 15:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=EIENLHALHGIMHGDOLMIMAEDOCJAA.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).