bug-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Lars Magne Ingebrigtsen
Subject: bug#13949: 24.4.1; `fill-paragraph' should not always put the buffer as modified
Date: Sun, 27 Mar 2016 18:28:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> 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





reply via email to

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