[Top][All Lists]

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

Re: Thinking about changed buffers

From: Lars Magne Ingebrigtsen
Subject: Re: Thinking about changed buffers
Date: Mon, 28 Mar 2016 20:40:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Lars Magne Ingebrigtsen <address@hidden> writes:

> 2) Text properties.  If you call `add-text-properties' on a buffer, the
> buffer becomes marked as changed.  The hashing function could look at
> the intervals, too, so that's not a problem, but many (most?) of the
> text properties are added by font locking mores with
> `with-silent-modifications'

Ok, I've been grepping through the code a bit.  It also just occurred to
me that people might be using `with-silent-modifications' to make
textual changes in a buffer that "shouldn't" be noticed.  I have not
read all the matches in detail, of course, but I could find only two
instances where text was obviously being modified.  And they both had
this comment:

      ;; FIXME: Why not use a temporary buffer and avoid this
      ;; "insert&delete" business?  --Stef
      (insert-file-contents file)

That is, it's code that inserts something in the buffer and then deletes
it.  Which would work just fine if we'd use a hash to keep track of file
modification-ness.   :-)

Another thing that occurred to me is that `with-silent-modification'
could make `add-text-properties' add a special flag to the interval
saying "this interval should not be counted when computing the hash".  I
think that would be a kinda trivial thing to do...

Hm...  I'm starting to think that this might be feasible.  I didn't
think so when I wrote the original email.  :-)

(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

reply via email to

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