From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Richard M. Stallman" Newsgroups: gmane.emacs.devel Subject: Re: buffer-swap-text Date: Wed, 22 Oct 2008 23:06:01 -0400 Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: ger.gmane.org 1224731340 13356 80.91.229.12 (23 Oct 2008 03:09:00 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Oct 2008 03:09:00 +0000 (UTC) Cc: eliz@gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 23 05:09:59 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 1KsqaC-0007EQ-7E for ged-emacs-devel@m.gmane.org; Thu, 23 Oct 2008 05:09:56 +0200 Original-Received: from localhost ([127.0.0.1]:52661 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KsqZ6-0001BZ-MK for ged-emacs-devel@m.gmane.org; Wed, 22 Oct 2008 23:08:48 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KsqZ2-0001B6-VM for emacs-devel@gnu.org; Wed, 22 Oct 2008 23:08:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KsqZ2-0001Ao-Fy for emacs-devel@gnu.org; Wed, 22 Oct 2008 23:08:44 -0400 Original-Received: from [199.232.76.173] (port=43044 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KsqZ2-0001Al-Ag for emacs-devel@gnu.org; Wed, 22 Oct 2008 23:08:44 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:50221) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KsqZ2-0004Xj-0D for emacs-devel@gnu.org; Wed, 22 Oct 2008 23:08:44 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1KsqWP-00013X-CT; Wed, 22 Oct 2008 23:06:01 -0400 In-reply-to: (message from Stefan Monnier on Tue, 21 Oct 2008 18:06:46 -0400) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:104886 Archived-At: > We need to address the general question of what C-x C-s should do in a > buffer where you have done the swap. I think your question is part of > that question. This depends on the use case. We have seen two use cases, which are somewhat similar. What do they do? Is there one approach that would work for both? I think we need a feature that lets one buffer point to the other and say "save that one instead". And swapping should turn this on and off. So when Rmail or Arc mode swaps the buffers, it should make the visible buffer point to the other one saying "save that instead". And when it unswaps them, it should reverse that, making the hidden buffer point to the visible one saying "save that instead". So here's the proposed feature. 1. A buffer-local variable buffer-save-other-buffer. 2. If that is non-nil, it should be a buffer, and `basic-save-buffer' saves that buffer instead. 3. When `buffer-swap-text' sees that buffer A's buffer-save-other-buffer points to buffer B, it "swaps" that, making buffer B's buffer-save-other-buffer point to buffer A instead. If the mode doesn't use the buffer-save-other-buffer feature, that variable will be nil in both buffers, so `buffer-swap-text' won't change it.