From 7c79e2f1aef7e59d80d7b46533a93f2f23ad6759 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 10 Jul 2016 21:52:23 -0400 Subject: [PATCH v1] Document buffer-swap-text+save-excursion interaction * doc/lispref/buffers.texi (Swapping Text): Add warning about interaction of `buffer-swap-text' and `save-excursion' (Bug #4655). --- doc/lispref/buffers.texi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi index 1f7f263..22c6726 100644 --- a/doc/lispref/buffers.texi +++ b/doc/lispref/buffers.texi @@ -1211,6 +1211,11 @@ Swapping Text overlays, the text properties, the undo list, the value of the @code{enable-multibyte-characters} flag (@pxref{Text Representations, enable-multibyte-characters}), etc. + +@strong{Warning:} The current buffer will be set to @var{buffer} if +this function is called from within @code{save-excursion}, since the +marker used by @code{save-excursion} to save the position and buffer +will be swapped as well. @end defun If you use @code{buffer-swap-text} on a file-visiting buffer, you -- 2.8.0