Thanks!

However, since rev 1.72 of buffer.c this is not necessary any more.
Buffers with names starting and ending with '*' are considered throw
away and have BFIGNDIRTY set in bnew().

On Sun, Jul 22, 2018 at 12:14:32PM +0200, Joachim Nilsson wrote:
> Hi guys,
> 
> here's a patch to mg I did a couple of years ago to my fork[1], maybe
> it's interesting to other people as well.
> 
> Best regards
>  /Joachim
> 
> [1]: https://github.com/troglobit/mg
> 
> -- 
> 
> From b14456674b9c78fdcabe14d802a9d7315d5a67a2 Mon Sep 17 00:00:00 2001
> From: Joachim Nilsson <troglo...@gmail.com>
> Date: Sat, 14 May 2016 15:44:40 +0200
> Subject: [PATCH] Set ignore-dirty flag on *undo* buffer
> 
> Ignore return value from bclear() and set BFIGNDIRTY flag to always
> force a clear of any existing *undo* buffer.
> 
> Signed-off-by: Joachim Nilsson <troglo...@gmail.com>
> ---
>  undo.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/undo.c b/undo.c
> index 8630b66..f85278b 100644
> --- a/undo.c
> +++ b/undo.c
> @@ -395,8 +395,8 @@ undo_dump(int f, int n)
>        */
>       if ((bp = bfind("*undo*", TRUE)) == NULL)
>               return (FALSE);
> -     bp->b_flag |= BFREADONLY;
> -     bclear(bp);
> +     bp->b_flag |= BFREADONLY | BFIGNDIRTY;
> +     (void)bclear(bp);
>       if ((wp = popbuf(bp, WNONE)) == NULL)
>               return (FALSE);
>  
> 

-- 
I'm not entirely sure you are real.

Reply via email to