lilypond-user
[Top][All Lists]
Advanced

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

Re: lilypond-mode and electric-indent-mode (Emacs)


From: David Kastrup
Subject: Re: lilypond-mode and electric-indent-mode (Emacs)
Date: Thu, 22 Oct 2015 17:31:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

pls <address@hidden> writes:

> Hi all,
>
> lilypond-mode (Git-repository) and electric-indent-mode don't seem to
> get along too well
> in Emacs. (I'm currently using GNU Emacs 25.0.50.2 (x86_64-pc-linux-gnu,
> GTK+ Version 3.10.8) but I have experienced the same issues with all
> other Emacs-versions I have tried before.)
>
> When I press RET at the end of a line the indentation of that line gets
> messed up (only in lilypond-mode). I tried the following three
> solutions to turn off
> electric-indent-mode in lilypond-mode in my .emacs file but none of them
> seems to work:
>
> ;; 1.:
> (add-hook 'lilypond-mode-hook (lambda () (electric-indent-local-mode
> -1)))
>
> ;; 2.:
> (add-hook 'lilypond-mode-hook (lambda () (add-hook
> 'electric-indent-functions (lambda (pos) 'no-indent) nil 'local)))
>
> ;; 3.:
> (add-hook 'lilypond-mode-hook
>           (lambda () (set (make-local-variable 'electric-indent-mode)
>           nil)))
>
>
> I finally turned it off globally (setq-default electric-indent-mode nil)
> but that's not really my favorite solution.  Has anyone else experienced
> similar problems (and solved them) or is the problem sitting right in
> front of my computer?
>
> Any help would be greatly appreciated!

The indentation engine of lilypond-mode needs to be redone.  One of its
most annoying properties is that it's not benign: if it gets out of
whack, having one correctly indented < or { or << or >> or } or > will
not let it resynchronize.

LilyPond-mode has not changed significantly since version 2.0 or so.
It's just no longer in touch, and it does not deal gracefully with
embedding blocks of Scheme inside of regular LilyPond code.

-- 
David Kastrup



reply via email to

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