From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jeremy Bryant via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#67313: [PATCH] New command write-file-no-switch Date: Thu, 30 Nov 2023 23:18:59 +0000 Message-ID: <87a5quakvm.fsf@jeremybryant.net> References: <87zfz8dmk5.fsf@jeremybryant.net> <83h6lfibye.fsf@gnu.org> <87v89uemrx.fsf@jeremybryant.net> <83bkbjfuft.fsf@gnu.org> Reply-To: Jeremy Bryant Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9894"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67313@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 01 00:21:16 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r8qLL-0002Km-04 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 01 Dec 2023 00:21:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r8qL8-0003YK-Ir; Thu, 30 Nov 2023 18:21:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r8qL3-0003Xd-Ht for bug-gnu-emacs@gnu.org; Thu, 30 Nov 2023 18:20:58 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r8qKz-0004eI-UH for bug-gnu-emacs@gnu.org; Thu, 30 Nov 2023 18:20:55 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r8qL7-0006GZ-Uq for bug-gnu-emacs@gnu.org; Thu, 30 Nov 2023 18:21:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jeremy Bryant Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 Nov 2023 23:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67313 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 67313-submit@debbugs.gnu.org id=B67313.170138646024072 (code B ref 67313); Thu, 30 Nov 2023 23:21:01 +0000 Original-Received: (at 67313) by debbugs.gnu.org; 30 Nov 2023 23:21:00 +0000 Original-Received: from localhost ([127.0.0.1]:54664 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r8qL5-0006GC-V0 for submit@debbugs.gnu.org; Thu, 30 Nov 2023 18:21:00 -0500 Original-Received: from out-178.mta1.migadu.com ([95.215.58.178]:17443) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r8qL3-0006G3-14 for 67313@debbugs.gnu.org; Thu, 30 Nov 2023 18:20:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jeremybryant.net; s=key1; t=1701386447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FdsutS62C6p88r1UGIC5Th76UPWhaXhXSWPM6FKAeGQ=; b=dvBQq6khYWRhSvLU5DNNn19Nsnu8+xgd/mmDhMxGzF0MAHJOSu7YEkB78i2+O56ThbR66Y MHdwaNTaVP0UwsFfFT8jZLuIpt0B5zvYiiUAm2oV8iKYGa792eTsqUOdDMbkqx6rO2iKkJ ae+bAkzKl8B/BP7LFfCNmfSLTGglEqVlqLuzkJGvumXCtzuv7n+yteyS8JzINmDXJgu/hU 43vyhTzA7RFM80TUxKTxdlmWAAtXfBGqKMzoMCoOIALLhwPFo5J+DgDv91ZH4Vq4v/LMlB NDKdPB+uxOn++XU+i9FbGvdnDQaE/SB8dOVDAsLCBMp3hGfHKl8GXL9kwSqMHA== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-reply-to: <83bkbjfuft.fsf@gnu.org> X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275297 Archived-At: --=-=-= Content-Type: text/plain >> > Why is it not enough to be able to use "M-x write-region"? >> > >> > In any case, a new command is definitely overkill, IMO. >> >> Thank you for pointing out write-region, it is indeed more appropriate, >> replacing the line above by >> >> (write-region nil nil filename) >> >> >> The attached patch is the prototype of how this may be used. > > Thanks. As stated above, I'm not sure I agree we need a new command. > write-region already exists, as a command, and I personally use it > quite a lot in these cases. > > Does anyone else think we need an additional command for saving a > buffer to a different file? Eli, another way is also to clarify the manual to explain write-region. Second patch attached for consideration. This may help users. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Elisp-manual-Mention-write-region-for-whole-buffer.patch >From 1c9569bb702b20490dc5f9333f14e14b3d4c2f38 Mon Sep 17 00:00:00 2001 From: Jeremy Bryant Date: Thu, 30 Nov 2023 23:14:46 +0000 Subject: [PATCH] Elisp manual: Mention write-region for whole buffer * doc/emacs/files.texi (Save Commands): Mention write-region --- doc/emacs/files.texi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 29cc22e7557..f0160c692da 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -547,6 +547,10 @@ Save Commands to that major mode, in most cases. The command @code{set-visited-file-name} also does this. @xref{Choosing Modes}. + If you wish to save the current buffer to a different file without +visiting it, use @code{mark-whole-buffer} (@kbd C-x h), then @kbd{M-x +write-region} (@pxref{Misc File Ops} + If Emacs is about to save a file and sees that the date of the latest version on disk does not match what Emacs last read or wrote, Emacs notifies you of this fact, because it probably indicates a problem caused -- 2.42.0 --=-=-=--