emacs-devel
[Top][All Lists]
Advanced

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

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


From: Stefan Monnier
Subject: Re: `save-excursion' defeated by `set-buffer'
Date: Mon, 04 Jan 2010 13:33:08 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

> If we know that (eq foo (current-buffer)), we should drop the
> `set-buffer'.  If we know that not to be the case, we should use
> `with-current-buffer' (or perhaps `save-current-buffer').  But what if it
> could but needn't be?

Let's try it this way:

   If we know that (eq foo 0), we should drop the increment.  If we know
   that not to be the case, we should just use (incf bar foo).  But what
   if it could but needn't be?

I.e. just use with-current-buffer and stop worrying about the case where
it may end up doing nothing.


        Stefan




reply via email to

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