lilypond-user
[Top][All Lists]
Advanced

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

Re: textedit - how to set tab size for correct column calculation?


From: David Baptista
Subject: Re: textedit - how to set tab size for correct column calculation?
Date: Sat, 3 Nov 2018 18:10:33 +0000

I'm not sure I was able to follow your reasoning. Maybe a practical case would help me: I use tab for spacing a .ly file. My editor happens to default to showing the tabs as 4 spaces. One line of the file is:

<tab>c'<other stuff>

The c' is on column 5. 
Now when lilypond computes the textedit link for that note, it computes as column 9 so the textedit link is wrong for my editor. What is your proposed resolution?

Na(o) sábado, 3/11/2018, 15:02, David Wright <address@hidden> escreveu:
On Sat 03 Nov 2018 at 09:35:54 (+0000), David Baptista wrote:
> I think the main way around this would be to expose a setting (ex tab-size)
> to be configured by the user.

Ouch. That's just a step backwards. Why fixed every N? Even
typewriters could set custom stops as desired. But then you
just get chaos when files are moved around.

There are two parts to handling tabs:

1) Pressing the TAB key. Here you can set your editor to do whatever
you like, custom or otherwise. But it should add spaces (± tabs),
as required, to move to the correct location.

2) What gets put in the file. Here, you should at least stick to the
standard TAB spacing of eight characters. It's also safer to avoid
the storing of any <SPACE><TAB> sequences in case someone somewhere
has forgotten to handle this case.

Anything else and you'll get tripped up somewhere. Fix LP and it'll
happen somewhere else instead.

> Federico Bruni <address@hidden> escreveu no dia sábado, 3/11/2018 à(s)
> 07:55:
>
> > Hi David
> >
> > I confirm the problem.
> > But I wonder how lilypond can predict how many spaces an editor will
> > consider for a tab. It's impossible, isn't it? The best workaround is
> > not using tabs at all (or replace them with spaces upon save).
> >
> > For those who want to reproduce the problem, do not use Frescobaldi,
> > which converts tabs to spaces. Create a ly file with another editor,
> > use tabs, compile the PDF and you'll see that the COLUMN in
> > textedit://FILE:LINE:CHAR:COLUMN has a shift forward.
> >
> >
> > Il giorno sab 3 nov 2018 alle 7:03, David Baptista
> > <address@hidden> ha scritto:
> > > I actually like then setup I currently have (Lilypond + Notepad++
> > > with custom Lilypond language definition for auto complete and syntax
> > > highlighting [the definitions file is out there on the Internet] plus
> > > Sumatra PDF as a viewer that allows PDF updating even when open - one
> > > custom Notepad shortcut for compiling with NppExec and that's it).
> > > The only part that is hacky is the referred "textedit" links because
> > > somehow internally, when lilypond generates them, it assumes that one
> > > tab equals 8 spaces and this is actually editor and configuration
> > > dependant (so it seems there should be a way to set tab size for
> > > textedit link calculations within Lilypond, which I do not know if it
> > > is the case).
> > >
> > > In consequence, I have some nasty calculations in a custom script for
> > > textedit:// links to actually land in the right column in Notepad++.
> > >
> > > Andrew Bernard <address@hidden> escreveu no dia sexta,
> > > 2/11/2018 à(s) 22:35:
> > >> Hi David,
> > >>
> > >> Lilypond only cares about whitespace. Tbas are not integral to the
> > >> syntax, as they are in some programming languages. Why don't you
> > >> consider using Frescobaldi? Its a very capable and good lilypond
> > >> environment. I cant see why, given that it exists, anybody would use
> > >> a crude text editor. I can understand using emacs, however. Give it
> > >> a go!
> > >>
> > >> Andrew
> > >>
> > >>
> > >> On Sat, 3 Nov 2018 at 07:15, David Baptista
> > >> <address@hidden> wrote:
> > >>>
> > >>> I have been fiddling with textedit on Windows, and I have
> > >>> determined that when source files contain tabs, lilypond always
> > >>> calculates the "column" parameter assuming that tabs occupy 8
> > >>> spaces. In my case I have my editor configured for 4 spaces, so the
> > >>> link always overshoots.

Cheers,
David.

reply via email to

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