lilypond-user
[Top][All Lists]
Advanced

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

Re: Emacs lilypond-mode and also point-and-click


From: David Kastrup
Subject: Re: Emacs lilypond-mode and also point-and-click
Date: Thu, 15 Oct 2015 19:38:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Steve Lacy <address@hidden> writes:

> On Thu, Oct 15, 2015 at 8:03 AM, T. Michael Sommers <address@hidden>
> 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



reply via email to

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