emacs-devel
[Top][All Lists]
Advanced

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

Re: Text Properties And Buffer Modification


From: T.V Raman
Subject: Re: Text Properties And Buffer Modification
Date: Wed, 05 Dec 2018 09:35:49 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:
Hi Stefan --

One way forward might be to add an additional optional arg to
put-text-property and friends  which if presents doesn't  change the
buffer-modified flag:

so today:

(put-text-property START END PROPERTY VALUE &optional OBJECT)
Future:
(put-text-property START END PROPERTY VALUE &optional OBJECT
leave-unmodified)

Thus, all existing code would continue to behave as before; new code
could explicitly pass leave-unmodified as an additional arg:

1. If object is a string,, leave-unmodified is a no-op and is ignored 
2. if object is a buffer, and leave-unmodified is  non-nil, then the
buffer is not marked as modified after that call.
>> 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.
>
> Right: in 99% of the cases, when text-properties are modified you want
> to wrap it within a with-silent-modifications.
>
> I think when text-properties were added it would have been perfectly
> fine to make them not touch the modified-ticks so the buffer is not
> marked as modified.  Making this change now is a good bit
> more delicate, which is why we haven't made it in the last 10 years,
> even though the situation was already the same 10 years ago.
>
>> 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.
>
> Really?
>
>
>         Stefan
>
>

-- 
Id: kg:/m/0285kf1 



reply via email to

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