GNU bug report logs - #13949
24.3.50; `fill-paragraph' should not always put the buffer as modified

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Wed, 13 Mar 2013 22:11:01 UTC

Severity: wishlist

Tags: fixed

Merged with 21155

Found in versions 24.3.50, 24.4.1, 25.0.50

Fixed in version 26.1

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #200 received at 13949 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Óscar Fuentes <ofv <at> wanadoo.es>, jwiegley <at> gmail.com,
 j_k_v <at> ro.ru, 13949 <at> debbugs.gnu.org
Subject: Re: bug#13949: 24.4.1;
 `fill-paragraph' should not always put the buffer as modified
Date: Sun, 27 Mar 2016 17:46:53 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> +  (when (and (not (string= h ""))
>> +             (string= h (secure-hash 'md5 (current-buffer))))
>> +    (set-buffer-modified-p nil)))
>
> Thanks, but I'm not sure computing the hash is enough: the functions
> involved in refilling can change text properties, so the test should
> also account for that.

True.  Do we have an efficient way to get the text properties, too?  (I
mean, without doing a `buffer-substring'...)

Hm...  looking at `secure-hash', it seems incredibly inefficient.
(Unless I'm misreading the code.)  All the coding system conversion
stuff is completely irrelevant for this usage...  

What we basically need is a fast hashing function for the buffer,
including text properties.  So it would basically do:

1) move the gap out of the way
2) call the hashing function on the buffer contents
c) call the hashing function on the text properties
4) hash them together

This should be really fast, I think?  If the text properties are
available in a fashion where we can do some hashing on them without
copying them around a lot.  And I know nothing about how text properties
are represented.

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




This bug report was last modified 8 years and 166 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.