|
From: | Uday S Reddy |
Subject: | save-excursion again |
Date: | Fri, 18 Jun 2010 08:42:31 +0100 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 |
(save-excursion (set-buffer B) ....X.... ) then:- if the code X has no possibility of getting back to the buffer A and moving point, then save-excursion can be replaced by save-current-buffer (and the byte compiler gives you a brownie point).
- if the code X has a possibility of getting back to the buffer A and moving around, then save-excursion should stay (despite getting smacked by the byte compiler).
So, every time we want to please the byte compiler, we need to prove a little theorem to the effect that the code X doesn't enter the buffer A? (No doubt some of these theorems will be obvious.)
Cheers, Uday
[Prev in Thread] | Current Thread | [Next in Thread] |