GNU bug report logs -
#13949
24.3.50; `fill-paragraph' should not always put the buffer as modified
Previous Next
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: Óscar Fuentes <ofv <at> wanadoo.es>
> Date: Sun, 27 Mar 2016 05:31:19 +0200
> Cc: Jaakov <j_k_v <at> ro.ru>, 13949 <at> debbugs.gnu.org
>
> diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el
> index 100e2a2..9e1f430 100644
> --- a/lisp/textmodes/fill.el
> +++ b/lisp/textmodes/fill.el
> @@ -804,6 +804,7 @@ fill-paragraph
> (interactive (progn
> (barf-if-buffer-read-only)
> (list (if current-prefix-arg 'full) t)))
> + (setq h (if (buffer-modified-p) "" (secure-hash 'md5 (current-buffer))))
> (or
> ;; 1. Fill the region if it is active when called interactively.
> (and region transient-mark-mode mark-active
> @@ -862,7 +863,10 @@ fill-paragraph
> ;; fill-region.
> (fill-region beg end justify)
> (fill-region-as-paragraph beg end justify))))))
> - fill-pfx)))
> + fill-pfx))
> + (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.
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.