Index | Thread | Search

From:
Han Boetes <hboetes@gmail.com>
Subject:
fix minor Emacs compatibility issue
To:
tech@openbsd.org
Date:
Mon, 23 Feb 2026 20:00:37 +0100

Download raw body.

Thread
  • Han Boetes:

    fix minor Emacs compatibility issue

While testing, I noticed that after running mg without argument, and 
then pressing C-x C-s, mg offers to save the current buffer, whilst 
Emacs replies "(No changes need to be saved)"

This patch fixes this minor compatibility issue.

BR
Han

diff --git a/file.c b/file.c
index b01e818..d088238 100644
--- a/file.c
+++ b/file.c
@@ -565,6 +565,11 @@ static int    makebackup = TRUE;
  int
  filesave(int f, int n)
  {
+    if ((curbp->b_flag & BFCHG) == 0) {
+        ewprintf("(No changes need to be saved)");
+        return (TRUE);
+    }
+
      if (curbp->b_fname[0] == '\0')
          return (filewrite(f, n));
      else