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


View this message in rfc822 format

From: Dani Moncayo <dmoncayo <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 13949 <at> debbugs.gnu.org
Subject: bug#13949: 24.3.50; `fill-paragraph' should not always put the buffer as modified
Date: Thu, 14 Mar 2013 19:34:31 +0100
>> In general, I think that a command should flag the buffer as modified
>> only when the buffer contents at the end of the command were different
>> from the contents at the beginning of that  same command.
>
> Then your wish is much broader than the original bug report says.
> E.g., you'd like the following to leave the buffer marked as
> unmodified, right?
>
>   emacs -Q
>   M-<
>   C-d
>   ;
>
> Or how about this:
>
>   emacs -Q
>   M-x overwrite-mode RET
>   M-<
>   ;

These two examples are recipes for modifying the buffer with several
different commands whose global effect is void.  In principle, one
could expect that the buffer be flagged as modified only when the
current text is different from the text in the file.  That makes
sense, and I thought about that, but I agree with you that that
behavior, while desirable, would imply a big impact in performance and
memory consumption, which is not justified at all for such a small
feature.

The expected behavior I described above is not exactly this, though,
because I put it in a command-by-command basis, but anyway, I think
that even then the price to pay would be too high in many cases (one
single command may modify a large portion of text, even the whole
buffer).

> fill-paragraph first removes all the newlines from the paragraph, and
> then inserts only as many as needed to get a filled paragraph.  So the
> buffer gets changed at least twice in the process.

Yes I understood that.  I think that a nicer algorithm would be not to
modify the buffer unless the resulting text is going to be different
to the current one.  But if that would entail too much work, I suggest
to spend your valuable energy in more important things :)


-- 
Dani Moncayo




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

Previous Next


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