Subject: bug#13949: 24.4.1; `fill-paragraph' should not always put the buffer as modified

From: Lars Magne Ingebrigtsen <[email-masked]>
Date: Sun, 27 Mar 2016 18:28:43 +0200

Eli Zaretskii <[email-masked]> writes:

> One could hack something together along the lines of
> compare_string_intervals and intervals_equal, I think.  That is,
> traverse the tree as they do, and compute the hash while at that.

*peruses code*

I see.  Looking at this, and looking at the sha1 reference for all of
two minutes, it looks like we could create a new C-level function called
something like hash_buffer that would look basically like

sha1_init_ctx
sha1_process_bytes(first_part_of_buffer, len)
sha1_process_bytes(last_part_of_buffer, len)
for iterate_over_all_intervals
  sha1_process_bytes(interval, len)
sha1_finish_ctx

and there you have it.  A hashing function that would not allocate
anything much, and it should be fast enough even in huge buffers for
`M-q'.  I think.

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