emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: buffer-swap-text


From: Richard M. Stallman
Subject: Re: buffer-swap-text
Date: Wed, 22 Oct 2008 23:06:01 -0400

    > 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]