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

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

bug#23824: 25.0.95; Do not prompt twice to save a buffer


From: Eli Zaretskii
Subject: bug#23824: 25.0.95; Do not prompt twice to save a buffer
Date: Sat, 25 Jun 2016 13:26:37 +0300

> From: Tino Calancha <f92capac@gmail.com>
> Date: Fri, 24 Jun 2016 22:16:06 +0900 (JST)
> cc: f92capac@gmail.com, 23824@debbugs.gnu.org
> 
> >(highlight-markup-buffers BUF-A FILE-B BUF-A FILE-B)
> >will prompt you twice to save BUF-A when BUF-A is modified.
> >It prompts you to save buf-a again even if you saved buf-a after
> >the first prompt: this is because `highlight-markup-buffers'
> >save the bit on the modification status of BUF-A and BUF-B at the
> >top of the function.
> 
> User should be prompted just one in this case.
> I propose following patch:
> 
> >From 67eb8473757392f893c3f83227cbdfd184499e25 Mon Sep 17 00:00:00 2001
> From: Tino Calancha <f92capac@gmail.com>
> Date: Fri, 24 Jun 2016 21:53:56 +0900
> Subject: [PATCH] Do not prompt twice to save a buffer
> 
> * lisp/hilit-chg.el (highlight-markup-buffers): (Bug#23824).
> ---
>   lisp/hilit-chg.el | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lisp/hilit-chg.el b/lisp/hilit-chg.el
> index 8f042b6..d4276ce 100644
> --- a/lisp/hilit-chg.el
> +++ b/lisp/hilit-chg.el
> @@ -782,7 +782,7 @@ highlight-markup-buffers
>          a-start a-end len-a
>          b-start b-end len-b
>          (bufa-modified (buffer-modified-p buf-a))
> -        (bufb-modified (buffer-modified-p buf-b))
> +        (bufb-modified (and (not (eq buf-a buf-b)) (buffer-modified-p 
> buf-b)))
>          (buf-a-read-only (with-current-buffer buf-a buffer-read-only))
>          (buf-b-read-only (with-current-buffer buf-b buffer-read-only))
>          temp-a temp-b)
> -- 
> 2.8.1

LGTM, thanks.





reply via email to

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