emacs-devel
[Top][All Lists]
Advanced

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

Re: Various simple.el patches


From: Luc Teirlinck
Subject: Re: Various simple.el patches
Date: Fri, 23 May 2003 13:47:38 -0500 (CDT)

Kai Grossjohan wrote:

   (Minor question: are the save-excursions necessary?  I don't know if
   it is desirable to try to minimize them.)

To be more precise than in my previous answer:

The documentation string of save-excursion says:

Save point, mark, and current buffer; execute BODY; restore those things.

In our situation, we only need to save and restore the value of
point.  I have often seen save-excursion used in such situations.

One could use the obvious:

(let ((opoint (point)))
     ...
     (goto-char opoint))

I doubt the gain in efficiency would be measurable to any degree, but
it certainly would be easy to change the code to use the above let
forms instead of save-excursion.

Sincerely,

Luc.




reply via email to

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