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: Steve Lacy
Subject: Re: Emacs lilypond-mode and also point-and-click
Date: Thu, 15 Oct 2015 10:33:30 -0700


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)))))
 
 

One solution might be to simply comment out this code, but I don't know if that might have some undesirable side effects.

Another solution might be to put a (widen) just before the function returns.  I think a widen on an un-narrowed buffer has no effect.

I haven't tried either of these, so proceed at your own risk.

--
T.M. Sommers -- address@hidden -- ab2sb


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


reply via email to

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