all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Richard M. Stallman" <rms@gnu.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: eliz@gnu.org, emacs-devel@gnu.org
Subject: Re: buffer-swap-text
Date: Wed, 22 Oct 2008 23:06:01 -0400	[thread overview]
Message-ID: <E1KsqWP-00013X-CT@fencepost.gnu.org> (raw)
In-Reply-To: <jwvr6691u6a.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Tue, 21 Oct 2008 18:06:46 -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	other threads:[~2008-10-23  3:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-21 10:42 buffer-swap-text Eli Zaretskii
2008-10-21 13:56 ` buffer-swap-text Stefan Monnier
2008-10-21 15:30   ` buffer-swap-text Eli Zaretskii
2008-10-21 22:04     ` buffer-swap-text Stefan Monnier
2008-10-21 19:40 ` buffer-swap-text Richard M. Stallman
2008-10-21 22:06   ` buffer-swap-text Stefan Monnier
2008-10-23  3:06     ` Richard M. Stallman [this message]
2008-10-23  3:24       ` buffer-swap-text Stefan Monnier
2008-10-23 21:09         ` buffer-swap-text Richard M. Stallman
2008-10-24  4:05           ` buffer-swap-text Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1KsqWP-00013X-CT@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.