[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text Properties And Buffer Modification

From: Eli Zaretskii
Subject: Re: Text Properties And Buffer Modification
Date: Wed, 05 Dec 2018 10:30:17 +0200

> From: Joost Kremers <address@hidden>
> Date: Wed, 05 Dec 2018 08:15:36 +0100
> Cc: "T.V Raman" <address@hidden>
> > Because text properties are part of the buffer text: if you copy
> > some of the text into another place, the properties go there as
> > well.
> But isn't that at least somewhat counter-intuitive, given that 
> they are usually not saved to the file the buffer is visiting?

Whether or not the properties are saved depends on the properties and
on the major mode.  E.g., modes that use markup are expected to save
at least some text properties.

> Up until now I've always understood the modified status of a buffer
> to mean that there is a discrepancy between what is on disk and what
> would be on disk if the buffer were saved in its current from. The
> Emacs Manual indeed seems to say so: "If a buffer contains changes
> that have not been saved, we say the buffer is 'modified'" (info
> "(emacs) Visiting").

There's nothing wrong with what the manual says, unless you interpret
"save" too literally, by actually examining what's on the disk file.

As a counter-example, consider "C-x RET f": it doesn't change the
buffer text, but still marks the buffer modified.

So yes, it might take some getting used to, but I see no conceptual
problem with how Emacs treats changes in text properties.  Granted,
I've got used to that many years ago.

> Granted, buffers that are not visiting a file can also be 
> modified, but they are essentially *always* modified, so their 
> modification status is largely irrelevant. (Isn't it?)

No, I don't agree with that.  Don't forget that the modified status is
important for more than just saving to a file: it is important for
redisplaying the buffer, for example.  And some buffers that don't
visit files are "written" in other ways, like email message being

reply via email to

[Prev in Thread] Current Thread [Next in Thread]