From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: buffer-swap-text Date: Tue, 21 Oct 2008 17:30:48 +0200 Message-ID: References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1224603221 24747 80.91.229.12 (21 Oct 2008 15:33:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 Oct 2008 15:33:41 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 21 17:34:35 2008 connect(): Connection refused Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KsJFD-0002pb-Vl for ged-emacs-devel@m.gmane.org; Tue, 21 Oct 2008 17:34:04 +0200 Original-Received: from localhost ([127.0.0.1]:48747 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KsJE8-0006S1-J3 for ged-emacs-devel@m.gmane.org; Tue, 21 Oct 2008 11:32:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KsJC2-0005sp-7B for emacs-devel@gnu.org; Tue, 21 Oct 2008 11:30:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KsJC1-0005sU-Gf for emacs-devel@gnu.org; Tue, 21 Oct 2008 11:30:45 -0400 Original-Received: from [199.232.76.173] (port=60275 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KsJC1-0005sP-Az for emacs-devel@gnu.org; Tue, 21 Oct 2008 11:30:45 -0400 Original-Received: from mtaout3.012.net.il ([84.95.2.7]:35709) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KsJC0-0004vu-V8 for emacs-devel@gnu.org; Tue, 21 Oct 2008 11:30:45 -0400 Original-Received: from HOME-C4E4A596F7 ([77.126.98.197]) by i_mtaout3.012.net.il (HyperSendmail v2004.12) with ESMTPA id <0K93004F7HTOZO01@i_mtaout3.012.net.il> for emacs-devel@gnu.org; Tue, 21 Oct 2008 17:32:12 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 9.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:104751 Archived-At: > From: Stefan Monnier > Cc: emacs-devel@gnu.org > Date: Tue, 21 Oct 2008 09:56:15 -0400 > > > Should this function swap the value of buffer-file-coding-system as > > well? Otherwise, we could confuse the user if the swapped text cannot > > be saved with the current buffer's encoding, and we will then pop up > > questions when the user tries to save. > > I see buffer-swap-text as a (very) low-level function. So, I'd > rather let the code that uses it deal with things like > buffer-file-coding-system. I cannot imagine a situation where code that uses this function would not want to copy buffer-file-coding-system. > I don't think we have enough experience with it to decide whether > that variable (or any other for that matter) needs to be swap > alongside the buffer's text. I'm okay with trying and erring like that, but I think that the only reason this didn't come up yet is because the 2 sole users of this function (tar-mode and pmail) swap text between a unibyte buffer and a multibyte buffer, and saving is allowed only from the unibyte one (and pmail is not yet used widely anyway).