help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: `save-excursion' defeated by `set-buffer'


From: Eli Zaretskii
Subject: Re: `save-excursion' defeated by `set-buffer'
Date: Sat, 12 Mar 2011 12:12:03 +0200

> From: David Kastrup <dak@gnu.org>
> Date: Sat, 12 Mar 2011 10:34:45 +0100
> 
> >   Warning: `save-excursion' will not preserve point in the other buffer
> >   set by `set-buffer'
> 
> Is there a particular reason that nobody is interested in letting the
> warning be about the case that is supposed to be problematic

Huh?  That's what I tried to express in the above text.  Isn't that
_precisely_ the problematic case, when the other buffer is not the
current and the body of save-excursion moves point and/or mark there?
If that's not the problematic case, please cough up why not, rather
than asking rhetorical questions.

> The problem seems more like
> 
> Warning: `save-excursion' will preserve point and mark in the current
>          buffer even if set-buffer does not actually change buffers.

Your "warning" describes what `save-excursion' is supposed to do, at
least according to the ELisp manual:

       The `save-excursion' special form saves the identity of the current
       buffer and the values of point and the mark in it, evaluates BODY,
       and finally restores the buffer and its saved values of point and
       the mark.

So how could warning about the normal operation be TRT?



reply via email to

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