lilypond-user
[Top][All Lists]
Advanced

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

Re: type of "location" argument


From: Jan-Peter Voigt
Subject: Re: type of "location" argument
Date: Wed, 04 Dec 2013 16:33:19 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.1.1

Am 04.12.2013 15:04, schrieb Urs Liska:
>> Hi, its:
>> ly:input-location?
>>
>> HTH
> Unfortunately not (TH).
> This is what redirects me to
> 
> Input *
> unsmob_input (SCM s)
> {
>   if (SCM_IMP (s))
>     return 0;
>   if (SCM_CAR (s) == (SCM)input_tag) // ugh.
>     return (Input *) SCM_CDR (s);
>   else
>     return 0;
> }
> 
> And that's where I get stuck. This function looks like it somehow munges
> a Scheme pair or list, so I tried to access it through
> (car location)
> but that didn't work. Which isn't surprising because the original
> (write) would have printed something like (location "...") if it were a
> list, isn't it?
What are you trying to do? If you want to pass a location to a
music(scheme/void)-function, it looks like:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\version "2.17.96"

% save the current location
saveLocation =
#(define-void-function (parser location name)(symbol?)
   (ly:parser-define! parser name location))

% show the file path of the given location
showFile =
#(define-void-function (parser location loc)(ly:input-location?)
   (ly:message "file '~A'" (car (ly:input-file-line-char-column location))))

% save location
\saveLocation hier
% show file name
\showFile \hier
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The showFile function takes a ly:input-location as argument.

Or is it something else, you are going to do?





reply via email to

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