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: David Kastrup
Subject: Re: `save-excursion' defeated by `set-buffer'
Date: Tue, 15 Mar 2011 15:47:12 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> pointing to other ways of delivering a task doesn't prove
>
>> save-excursion+set-buffer
>
>> is wrong.
>
> There is no proof that save-excursion+set-buffer is wrong, because it
> just is not wrong: it's just a combination of function that performs
> something.  That's why the byte-compiler emits a warning and not an
> error message.

[...]

> So the warning was introduced to help Elisp coders improve their code.
> That's what byte-compiler warnings are for.

It fails to do so.  It does not _help_ Elisp coders improve their code
but rather _confuses_ them into improving their code.

The warning message would be more accurately written as

     "Warning: the maintainer general has detected that
               save-excursion+set-buffer may seriously hamper your code."

That's much more likely to be accurate than the current warning.

-- 
David Kastrup


reply via email to

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