[Top][All Lists]

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

Re: forward-comment and syntax-ppss

From: Dmitry Gutov
Subject: Re: forward-comment and syntax-ppss
Date: Sat, 17 Dec 2016 02:08:52 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0

On 17.12.2016 01:16, Drew Adams wrote:

The fault here is not from the "other code" narrowing or
widening.  It is from the "current code" calling such
"other code".  Code needs to choose wisely any "other code"
that it tries to use.

We don't have a lot of choice if we want to avoid code duplication. Simply copying it over and removing the widen call is not an option.

But if the called code is indeed defective - if it should
in fact restore the initial buffer restriction after it
widens or narrows to do its work, then that should be

The point is that "its work" does not honor the narrowing. And we want it to.

And in particular, you need to know how it handles a buffer
restriction - at least if you are _counting on_ some particular
behavior wrt that.  You need to know whether you need to wrap
its call (or some other bits of your code) in `save-restriction',
for example.

Knowing doesn't help either.

Or to otherwise set and save some restriction limits, and then
restore them at the proper time.  Restriction limits are just
buffer positions.  Setting and saving them is not rocket science.

Doesn't help.

It sounds like you are complaining that when you use function
`abcde' it doesn't behave as you would like.  Maybe consider
not trying to expect it to do something that it does not do?

You're so eager to type out heaps of condescending text. Maybe try reading carefully next time?

possibly enhance the
code you were thinking about calling unwisely,...

What do you think these discussions are all about? Shrugging and complaining about our collective bad luck?

Of course it's about improving code, as well as the guidelines to do so regarding the usage of narrowing.

reply via email to

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