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

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

narrowing considered harmful (was: putting double quotes efficiently)


From: Stefan Monnier
Subject: narrowing considered harmful (was: putting double quotes efficiently)
Date: Thu, 13 Jun 2013 10:40:01 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

BTW,

I tend to consider narrow-to-region in Elisp as a problem,so I encourage
you to write your code without it.

In your example, you don't need to narrow: the only thing you need is
to keep the "end" updated when the buffer is modified, which is easy to
do by changing the "end" form an integer to a marker.

Or alternatively, you can simply work your way backward, in which case
you don't need to worry about using a marker since the "start" position
to which you're going won't be affected by the buffer modifications.


        Stefan


reply via email to

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