From unknown Wed Jun 18 23:05:32 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#25642 <25642@debbugs.gnu.org> To: bug#25642 <25642@debbugs.gnu.org> Subject: Status: 26.0.50; Save unmodified buffers not visiting a file yet Reply-To: bug#25642 <25642@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:05:32 +0000 retitle 25642 26.0.50; Save unmodified buffers not visiting a file yet reassign 25642 emacs submitter 25642 Tino Calancha severity 25642 wishlist tag 25642 wontfix thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 07 09:09:05 2017 Received: (at submit) by debbugs.gnu.org; 7 Feb 2017 14:09:05 +0000 Received: from localhost ([127.0.0.1]:58483 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cb6S9-0008GZ-Ag for submit@debbugs.gnu.org; Tue, 07 Feb 2017 09:09:05 -0500 Received: from eggs.gnu.org ([208.118.235.92]:47365) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cb6S6-0008Fy-V4 for submit@debbugs.gnu.org; Tue, 07 Feb 2017 09:09:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cb6S1-0000p6-3v for submit@debbugs.gnu.org; Tue, 07 Feb 2017 09:08:57 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49022) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cb6S1-0000p1-0f for submit@debbugs.gnu.org; Tue, 07 Feb 2017 09:08:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cb6Rx-00058N-0b for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2017 09:08:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cb6Rt-0000ho-Qy for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2017 09:08:52 -0500 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:36662) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cb6Rt-0000g8-Ku for bug-gnu-emacs@gnu.org; Tue, 07 Feb 2017 09:08:49 -0500 Received: by mail-pg0-x243.google.com with SMTP id 75so12245094pgf.3 for ; Tue, 07 Feb 2017 06:08:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=XXRGnQjhJeP18tAsSqYwS4Y9GJ2hT6K41os57VpZPoI=; b=P68nDmb/yJWIm0ColAECUhvrPXVupT2FqiX54ymE7OpyqaouAbHcy6Vj9+qsd21e5U DKhzP7gaOBmHvo/vUinVOYTSdOGp3zrVUaj/QFz/QEqDSco24Y/a5QHXG3OblQZU3rNY XJ+EYgKPCBtxSE6nd+SFaN1aAyWV7sM4f8jV4sgDnEE1RchDai7L1ZgmLVKDHrS7+NSv 2TLD6XphKYyU2sb7it31X00ZcdiEsygH9kxxCqYvtDlugNrFNEVNZzhjVBQXqTqUNeVq 754IvUWyg/d5iJ2lnxD4oi/wsM07FrU9hQtxUP3b6l8m3OaWDSN9TyO8IOSfR0O+7cO0 +YCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=XXRGnQjhJeP18tAsSqYwS4Y9GJ2hT6K41os57VpZPoI=; b=snRUKHy1NfmTbFiouETW/CmUUaw+exMkBKDWBpRUsKnxQl9mg+HD+TLBUE4ZgLRdx8 WXGKSpQ7RLzBoofNpDInDtRtQiyukLU+t5gxvTJfKVykghdC0qjglRzjIZBR04Zpmu9l 4E6LCLPpe8W2FlOFAqVO6Zks75yO551JmIi62ErQycloGNolCIokHJJAuy9JFCpHbhFl X3+Iq7BHtshmacbpH3MKmF0afw2p24B6NOs7HN+hNu6nBJ0DAVtDLljZho/j/yQP8JPQ v7mlWWMNZ7Be+K55iHcub6VSStcfGrvGOBk1fEFGqZPwA8I/J6Vr5WFnTy8swBPc5u/W qk/Q== X-Gm-Message-State: AIkVDXIH3zrb9j4LJFR34A33tWzkmsKYqY65vKZeazIpS5YRT+0ryNFYSyBjnC1hI6gzbw== X-Received: by 10.98.149.93 with SMTP id p90mr20276781pfd.72.1486476527103; Tue, 07 Feb 2017 06:08:47 -0800 (PST) Received: from calancha-pc (104.81.147.124.dy.bbexcite.jp. [124.147.81.104]) by smtp.gmail.com with ESMTPSA id w25sm11952785pge.27.2017.02.07.06.08.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 07 Feb 2017 06:08:46 -0800 (PST) From: Tino Calancha To: bug-gnu-emacs@gnu.org Subject: 26.0.50; Save unmodified buffers not visiting a file yet Date: Tue, 07 Feb 2017 23:08:42 +0900 Message-ID: <87mvdyt7o5.fsf@calancha-pc> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) emacs -Q C-x b foo foo ; Insert something. M-: (set-buffer-modified-p nil) RET C-x C-s ; No file is written. It's easy to change that flag for several buffers with `Buffer-menu-not-modified' or `ibuffer-do-toggle-modified'. Then, if you plan to save those buffers and if they have buffer-file-name nil, then you are not offered to save them. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; >From 2e0d336c4889fac79e5621be34e9149eb3064cce Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Tue, 7 Feb 2017 22:53:35 +0900 Subject: [PATCH] Save unmodified buffers not visiting a file yet * lisp/files.el (save-buffer): Set modified flag non-nil before 'basic-save-buffer' call (Bug#25642). --- lisp/files.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/files.el b/lisp/files.el index b7d104853c..c651ef4ee6 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4822,6 +4822,9 @@ save-buffer (not noninteractive) (not save-silently)) (message "Saving file %s..." (buffer-file-name))) + ;; Save it as well when unmodified but not visiting a file yet. + (unless (or modp (buffer-file-name)) + (set-buffer-modified-p t)) (basic-save-buffer (called-interactively-p 'any)) (and modp (memq arg '(4 64)) (setq buffer-backed-up nil)))) -- 2.11.0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; In GNU Emacs 26.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.7) of 2017-02-07 Repository revision: c939075b81b2b06c5ec040d7039fd20433509273 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 07 11:13:17 2017 Received: (at 25642) by debbugs.gnu.org; 7 Feb 2017 16:13:17 +0000 Received: from localhost ([127.0.0.1]:59166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cb8OK-00030o-PX for submit@debbugs.gnu.org; Tue, 07 Feb 2017 11:13:16 -0500 Received: from eggs.gnu.org ([208.118.235.92]:58709) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cb8OJ-00030a-CM for 25642@debbugs.gnu.org; Tue, 07 Feb 2017 11:13:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cb8OA-0006u1-94 for 25642@debbugs.gnu.org; Tue, 07 Feb 2017 11:13:10 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41421) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cb8OA-0006tp-5g; Tue, 07 Feb 2017 11:13:06 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1789 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cb8O9-0004R3-Fc; Tue, 07 Feb 2017 11:13:05 -0500 Date: Tue, 07 Feb 2017 18:13:05 +0200 Message-Id: <83shnq569a.fsf@gnu.org> From: Eli Zaretskii To: Tino Calancha In-reply-to: <87mvdyt7o5.fsf@calancha-pc> (message from Tino Calancha on Tue, 07 Feb 2017 23:08:42 +0900) Subject: Re: bug#25642: 26.0.50; Save unmodified buffers not visiting a file yet References: <87mvdyt7o5.fsf@calancha-pc> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 25642 Cc: 25642@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Tino Calancha > Date: Tue, 07 Feb 2017 23:08:42 +0900 > > emacs -Q > C-x b foo > foo ; Insert something. > M-: (set-buffer-modified-p nil) RET > C-x C-s ; No file is written. > > It's easy to change that flag for several buffers > with `Buffer-menu-not-modified' or > `ibuffer-do-toggle-modified'. Then, if you plan to save those > buffers and if they have buffer-file-name nil, then you > are not offered to save them. > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > >From 2e0d336c4889fac79e5621be34e9149eb3064cce Mon Sep 17 00:00:00 2001 > From: Tino Calancha > Date: Tue, 7 Feb 2017 22:53:35 +0900 > Subject: [PATCH] Save unmodified buffers not visiting a file yet > > * lisp/files.el (save-buffer): Set modified flag non-nil before > 'basic-save-buffer' call (Bug#25642). Please don't, at least not unconditionally. I use this feature all the time, e.g. when composing email messages. I don't actually understand why this would be a problem: the user explicitly wanted to reset the modified status of a buffer, why should Emacs second-guess what the user meant? But if there are some use cases where you find this annoying (please describe them), let's make this an optional behavior, off by default. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 07 12:22:30 2017 Received: (at 25642) by debbugs.gnu.org; 7 Feb 2017 17:22:30 +0000 Received: from localhost ([127.0.0.1]:59221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cb9TK-0004gJ-0h for submit@debbugs.gnu.org; Tue, 07 Feb 2017 12:22:30 -0500 Received: from mail-pg0-f49.google.com ([74.125.83.49]:35188) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cb9TI-0004g5-1x for 25642@debbugs.gnu.org; Tue, 07 Feb 2017 12:22:28 -0500 Received: by mail-pg0-f49.google.com with SMTP id 194so40393639pgd.2 for <25642@debbugs.gnu.org>; Tue, 07 Feb 2017 09:22:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=wNqhXga2ZQC6beY0Hhr+jE7IPLPX8Ks9/O/2QKlW/as=; b=D4v3u/3MvEibBPcCzhTjRXQjtrzpSJDUkuAPR1XVJv6PhVAutQm/UoaFZ4/dT72k7q 3IDhi0/kYxEji7xtIxw8IsaD/noekWgCIoXTxdY+mwcrkk/0OxBd6hcyNWMhqOd6AzMK XE+VgkvQChw4AFXOziH+Bzj3JRnXNCns7QfKrw92VYzsVHqqgSJJQEfExkdreIqFkGrt H0FkUItefeuKTFu8uzpg/Mg8soHieNbBzOkOrGwISPkZ1y6qC7Ch3vYwpDWeN8nE+Dn0 gamq/sckjkhBodJ8y9uGR2uP/2KA1DEVKGeC1iUgfdlVrWlrc4j6b8vv2OhdJT1B7Pkf XoPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=wNqhXga2ZQC6beY0Hhr+jE7IPLPX8Ks9/O/2QKlW/as=; b=cgQsTOtmc92/VhNc1IIcmtqOmPkt8MwxkmQEnjHLcsEH9rij6EsEswNOQuKvo9gMlc 0lmLAjdOTdVpxKpTIAeHyw+690GXyv1KnJDVeSSN1Caui3K+l98UI5+4IJOWNAApJ9uC GViwItRwytTGMpGQjNsngngoITX/9mNeAK8oeIaMlGiaCiodP27E+oYVpRDSlugp204g P41TUV81ajfSbrRMw81FmPlmBqBskQWUIPEPaYrEnNK0RyxoOrUyV3I+fcGft9A5GXoC SEja+KEfLaEy4AfK0WewK/8bQ6AKAoU7NKHK6bXX+rjPMB6QrwmnE4qZaiU7irWBLm8y tFwg== X-Gm-Message-State: AIkVDXIti4rwReXdMU+WSEYa9iEJTh1+rdVKfoVcqcNw1/O2352zu0m+IQ2oA39QlKZeZw== X-Received: by 10.99.163.109 with SMTP id v45mr21215518pgn.39.1486488142001; Tue, 07 Feb 2017 09:22:22 -0800 (PST) Received: from calancha-pc (104.81.147.124.dy.bbexcite.jp. [124.147.81.104]) by smtp.gmail.com with ESMTPSA id c64sm13027877pfa.45.2017.02.07.09.22.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Feb 2017 09:22:21 -0800 (PST) From: Tino Calancha X-Google-Original-From: Tino Calancha Date: Wed, 8 Feb 2017 02:22:19 +0900 (JST) X-X-Sender: calancha@calancha-pc To: Eli Zaretskii Subject: Re: bug#25642: 26.0.50; Save unmodified buffers not visiting a file yet In-Reply-To: <83shnq569a.fsf@gnu.org> Message-ID: References: <87mvdyt7o5.fsf@calancha-pc> <83shnq569a.fsf@gnu.org> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 25642 Cc: 25642@debbugs.gnu.org, Tino Calancha X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Tue, 7 Feb 2017, Eli Zaretskii wrote: >> Subject: [PATCH] Save unmodified buffers not visiting a file yet >> >> * lisp/files.el (save-buffer): Set modified flag non-nil before >> 'basic-save-buffer' call (Bug#25642). > > Please don't, at least not unconditionally. I use this feature all > the time, e.g. when composing email messages. OK. > > I don't actually understand why this would be a problem: the user > explicitly wanted to reset the modified status of a buffer, why should > Emacs second-guess what the user meant? But if there are some use > cases where you find this annoying (please describe them), let's make > this an optional behavior, off by default. No i don't have in mind cases where i have being annoying but that. Setting modified flag nil followed to trying to save the buffer sounds like the user don't want to save the buffer. I think we can close this bug report. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 09 16:48:26 2017 Received: (at control) by debbugs.gnu.org; 9 Feb 2017 21:48:26 +0000 Received: from localhost ([127.0.0.1]:33534 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cbwZl-0008AC-P3 for submit@debbugs.gnu.org; Thu, 09 Feb 2017 16:48:25 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cbwZk-0008A1-GT for control@debbugs.gnu.org; Thu, 09 Feb 2017 16:48:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cbwZe-0001u4-OY for control@debbugs.gnu.org; Thu, 09 Feb 2017 16:48:19 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51571) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbwZe-0001ty-LD for control@debbugs.gnu.org; Thu, 09 Feb 2017 16:48:18 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1cbwZe-0000iL-8O for control@debbugs.gnu.org; Thu, 09 Feb 2017 16:48:18 -0500 Subject: control message for bug 25618 25653 25642 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Thu, 09 Feb 2017 16:48:18 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) tag 25618 wontfix close 25618 tag 25653 wontfix close 25653 tag 25642 wontfix close 25642 From unknown Wed Jun 18 23:05:32 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 10 Mar 2017 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator