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: Eli Zaretskii
Subject: bug#13949: 24.4.1; `fill-paragraph' should not always put the buffer as modified
Date: Sun, 27 Mar 2016 17:56:26 +0300

> From: Óscar Fuentes <ofv@wanadoo.es>
> Date: Sun, 27 Mar 2016 05:31:19 +0200
> Cc: Jaakov <j_k_v@ro.ru>, 13949@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.





reply via email to

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