Steve Lacy <sl...@slacy.com> writes:

> On Thu, Oct 15, 2015 at 8:03 AM, T. Michael Sommers <tmsomme...@gmail.com>
> wrote:
>
>> On 10/15/2015 7:24 AM, Andrew Bernard wrote:
>>
>>>
>>> I’m aware that the emacs lilypond-mode needs attention, but I wonder
>>> if anybody has seen this. When I enter a ‘>’ character to complete a
>>> chord, emacs goes into narrow mode, which then has to be undone with
>>> C-x n w. It’s consistently reproducible.
>>>
>>
>> The culprit would seem to be this, starting at line 502 in the function
>> LilyPond-blink-matching-paren in lilypond-indent.el:
>>
>>   (when blink-matching-paren-distance
>>         (narrow-to-region
>>          (max (point-min) (- (point) blink-matching-paren-distance))
>>          (min (point-max) (+ (point) blink-matching-paren-distance))))
>
>
>
>>
>> This narrowing is never undone.
>>
>
> Agreed, and the canonical way to solve this is by adding a
> "(save-restriction ..." block around this section.  Something like this
> (untested):
>
>   (when blink-matching-paren-distance
>>         (save-restriction (narrow-to-region
>>          (max (point-min) (- (point) blink-matching-paren-distance))
>>          (min (point-max) (+ (point) blink-matching-paren-distance)))))

That would be completely nonsensical.  The save-restriction call, if
anything, would need to be around the whole function body or likely
better the part doing the search, with the restriction getting lifted
again before making the display.

-- 
David Kastrup

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to