Re: [Geany-Users] adding json support

2013-02-24 Thread Lex Trotman
On 25 February 2013 09:43, Bob Furber  wrote:
> On 13-02-23 07:41 PM, Matthew Brush wrote:
>>>
>>> No change even after restarting my PC: Names are bold black, values are
>>> normal black, numbers are green ..and filetypes.JSON.conf looks like
>>> this:
>>>
>>
> I found it!!
>
> For some reason, I had 2 filetypes.JSON.conf files:
>
> /usr/share/geany/filetypes.JSON.conf
> and
>/root/.config/geany/filedefs/filetypes.JSON.conf
>
> This seems to have come about because I accessed Geany in supervisor mode to
> edit filetypes.JSON.conf.
>

Perhaps the lesson is "Don't try stuff as root", do it as an
unprivileged user, thats why we read the user config so users can
change it without touching the system stuff :)

And as a user mistakes make less of a mess :)

Cheers
Lex


> In the meantime, I have merrily been editing
> /root/.config/geany/filedefs/filetypes.JSON.conf, while Geany, accessed in
> user mode uses /usr/share/geany/filetypes.JSON.conf.
>
>> What are "names"?
>
>
> Perhaps I am using Name inappropriately. What I mean is the lowest element
> in a json file is a name:value pair (i.e., {"myVarName":"myVarValue"}).
> While not very important, I can see some merit in differentiating the name
> from the value.
>
> The only way I have found so far to differentiate names from values is by
> setting lexer_filetype=YAML.
>
> Thanks Matthew & Lex for all your help.
>
> RF
>
> ___
> Users mailing list
> Users@lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/users
___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


Re: [Geany-Users] adding json support

2013-02-24 Thread Bob Furber

On 13-02-23 07:41 PM, Matthew Brush wrote:

No change even after restarting my PC: Names are bold black, values are
normal black, numbers are green ..and filetypes.JSON.conf looks like 
this:





I found it!!

For some reason, I had 2 filetypes.JSON.conf files:

/usr/share/geany/filetypes.JSON.conf
and
   /root/.config/geany/filedefs/filetypes.JSON.conf

This seems to have come about because I accessed Geany in supervisor 
mode to edit filetypes.JSON.conf.


In the meantime, I have merrily been editing 
/root/.config/geany/filedefs/filetypes.JSON.conf, while Geany, accessed 
in user mode uses /usr/share/geany/filetypes.JSON.conf.


What are "names"? 


Perhaps I am using Name inappropriately. What I mean is the lowest 
element in a json file is a name:value pair (i.e., 
{"myVarName":"myVarValue"}). While not very important, I can see some 
merit in differentiating the name from the value.


The only way I have found so far to differentiate names from values is 
by setting lexer_filetype=YAML.


Thanks Matthew & Lex for all your help.

RF

___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


Re: [Geany-Users] adding json support

2013-02-23 Thread Matthew Brush

On 13-02-23 06:54 PM, Bob Furber wrote:

On 13-02-23 06:38 PM, Matthew Brush wrote:

I cannot see any YAML styles in filetypes.JSON.conf:

 [styling=C]


Start Deleting lines here...


default=default
 number=number
 string=string
 word=word
 identifier=identifier,bold



... And Stop deleting lines here

That is what I meant.


No change even after restarting my PC: Names are bold black, values are
normal black, numbers are green ..and filetypes.JSON.conf looks like this:



I tried to re-create the filetypes.JSON.conf file from scratch, it works 
fine (at least for syntax highlighting) using this:




[styling=C]

[keywords]
primary=true false null

[settings]
extension=js
lexer_filetype=Javascript
comment_single=#
comment_use_indent=true

[indentation]
width=2
type=1



Hope it helps.

Cheers,
Matthew Brush
___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


Re: [Geany-Users] adding json support

2013-02-23 Thread Matthew Brush

On 13-02-23 06:54 PM, Bob Furber wrote:

On 13-02-23 06:38 PM, Matthew Brush wrote:

I cannot see any YAML styles in filetypes.JSON.conf:

 [styling=C]


Start Deleting lines here...


default=default
 number=number
 string=string
 word=word
 identifier=identifier,bold



... And Stop deleting lines here

That is what I meant.


No change even after restarting my PC: Names are bold black, values are
normal black, numbers are green ..and filetypes.JSON.conf looks like this:



What are "names"? AFAIK the only "names" in JSON are the names of 
builtin identifiers like "true" and "false". Everything else is either 
an aggregate type (list, dict/hashtable, etc), a quoted "string", or a 
literal numeric value (like 1 or 1.2, etc). Maybe I misunderstood your 
terminology or JSON specs?



 [styling=C]

 [keywords]
 primary=true false null

 [settings]
 extension=json
 lexer_filetype=Javascript


It might be that "Javascript" is not a valid lexer filetype, I've never 
been clear on this. Perhaps you should use "C" or "CPP" or "C++" or 
something (whatever makes it use Scintilla's LexCPP.cxx lexer). Maybe 
someone more knowledgeable can confirm the correct one.


FWIW, I'm pretty sure it worked as in the original wiki entry, otherwise 
I can't imagine why I'd have posted it.


Cheers,
Matthew Brush
___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


Re: [Geany-Users] adding json support

2013-02-23 Thread Lex Trotman
On 24 February 2013 13:54, Bob Furber  wrote:
> On 13-02-23 06:38 PM, Matthew Brush wrote:
>>>
>>> I cannot see any YAML styles in filetypes.JSON.conf:
>>>
>>>  [styling=C]
>>
>>
>> Start Deleting lines here...
>>
>>> default=default
>>>  number=number
>>>  string=string
>>>  word=word
>>>  identifier=identifier,bold
>>>
>>
>> ... And Stop deleting lines here
>>
>> That is what I meant.
>
>
> No change even after restarting my PC: Names are bold black, values are
> normal black, numbers are green ..and filetypes.JSON.conf looks like this:

I'm not sure what you are expecting to happen?

As I said on another post, you change the colours by choosing the
colour scheme.  Try alternating between default and alt and you should
see at least some difference.

Cheers
Lex



>
> [styling=C]
>
>
> [keywords]
> primary=true false null
>
> [settings]
> extension=json
> lexer_filetype=Javascript
> comment_single=#
> comment_use_indent=true
>
> [indentation]
> width=2
> # 0 is spaces, 1 is tabs, 2 is tab & spaces
> type=0
>
> RF
>
> ___
> Users mailing list
> Users@lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/users
___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


Re: [Geany-Users] adding json support

2013-02-23 Thread Bob Furber

On 13-02-23 06:38 PM, Matthew Brush wrote:

I cannot see any YAML styles in filetypes.JSON.conf:

 [styling=C]


Start Deleting lines here...


default=default
 number=number
 string=string
 word=word
 identifier=identifier,bold



... And Stop deleting lines here

That is what I meant.


No change even after restarting my PC: Names are bold black, values are 
normal black, numbers are green ..and filetypes.JSON.conf looks like this:


[styling=C]

[keywords]
primary=true false null

[settings]
extension=json
lexer_filetype=Javascript
comment_single=#
comment_use_indent=true

[indentation]
width=2
# 0 is spaces, 1 is tabs, 2 is tab & spaces
type=0

RF
___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


Re: [Geany-Users] adding json support

2013-02-23 Thread Matthew Brush

On 13-02-23 05:48 PM, Bob Furber wrote:

On 13-02-23 04:02 PM, Matthew Brush wrote:



Syntax highlighting is still not so colourful: Names are bold black and
values are normal black unless they are numbers, in which case they are
green.



Because you left YAML styles above maybe (under [styling=C]).


I cannot see any YAML styles in filetypes.JSON.conf:

 [styling=C]


Start Deleting lines here...


 default=default
 number=number
 string=string
 word=word
 identifier=identifier,bold



... And Stop deleting lines here

That is what I meant.

Cheers,
Matthew Brush
___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


Re: [Geany-Users] adding json support

2013-02-23 Thread Bob Furber

On 13-02-23 04:02 PM, Matthew Brush wrote:



Syntax highlighting is still not so colourful: Names are bold black and
values are normal black unless they are numbers, in which case they are
green.



Because you left YAML styles above maybe (under [styling=C]).


I cannot see any YAML styles in filetypes.JSON.conf:

[styling=C]
default=default
number=number
string=string
word=word
identifier=identifier,bold

[keywords]
primary=true false null

[settings]
extension=json
lexer_filetype=Javascript
comment_single=#
comment_use_indent=true

[indentation]
width=2
# 0 is spaces, 1 is tabs, 2 is tab & spaces
type=0

I did, however, remove the lines below [styling=C]. But I kept

identifier=identifier,bold

..because it bolds the name in a *Name*:Value pair:
{
"*err*": "File not found",
"*gId*": 28,
}

In case the html is stripped out, "*err*" and "*gId*", above, are bold face.

I would prefer a color like blue, to bold, but bold is really quite 
adequate.


Thanks,

RF

___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


Re: [Geany-Users] adding json support

2013-02-23 Thread Lex Trotman
On 24 February 2013 10:30, Bob Furber  wrote:
> On 13-02-22 05:30 PM, Matthew Brush wrote:
>>
>> Someone changed my wiki entry so the filetype is YAML instead of
>> JavaScript[1]. Set it back to JavaScript and set the `[styling]` section
>> back to `[styling=C]`, removing the partial set of styles added in that
>> change and highlighting should work perfect (after all, isn't JSON valid
>> JavaScript syntax?). You can check "Old Revisions" on the wiki to see the
>> original entry and the additions later on.
>
>
> Is the [1] in "instead of JavaScript[1]" significant?
>
> I changed filetypes.JSON.conf to:
>
> [styling=C]
>
> default=default
> number=number
> string=string
> word=word
> identifier=identifier,bold
>
> [keywords]
> primary=true false null
>
> [settings]
> extension=json
> lexer_filetype=Javascript
> comment_single=#
> comment_use_indent=true
>
>
> [indentation]
> width=2
> # 0 is spaces, 1 is tabs, 2 is tab & spaces
> type=0
>
> Syntax highlighting is still not so colourful: Names are bold black and
> values are normal black unless they are numbers, in which case they are
> green.

How colourful a language is depends on two things, how language
constructs detected by the lexer map to styles, and what the colour
scheme defines the style to be (colour, bold, italic, etc).

The former is saying *what* can be coloured and the latter *how* it
will be coloured.  The *what* is hard coded, and javascript and YAML
have similar numbers of detected constructs, but they are different
constructs.

The *how* is intended to be configurable by users by:

1) just select a new colour scheme menu->view->editor->colour schemes,
Geany only comes with two (for now), but you can get heaps of
*colourful* schemes here https://github.com/codebrainz/geany-themes

2) by making your own theme, see the manual and the wiki for how, and
the themes above for examples (pick one, rename it and change the bits
you don't like)

3) as a last resort by changing the styling section in your filetype
file, but of course this will prevent it following the colour scheme.


>
> Highlighting of matching '[' and '{' braces works fine after rebooting my
> PC.
>
> Setting the filetype to Javascript (Document -> Set Filetype -> Scripting
> Languages -> Javascript) results in a more colourful display, but without
> any differentiation between names and values.
>
> Is there any way of customizing this without launching a new career?

Some people have made a "career" out of creating themes :)

Cheers
Lex

>
>
>>
>> Please update the wiki if you find it's incorrect.
>
>
> How do I do that?
>
> Thanks,
>
> RF
>
>
> ___
> Users mailing list
> Users@lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/users
___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


Re: [Geany-Users] adding json support

2013-02-23 Thread Matthew Brush

On 13-02-23 03:30 PM, Bob Furber wrote:

On 13-02-22 05:30 PM, Matthew Brush wrote:

Someone changed my wiki entry so the filetype is YAML instead of
JavaScript[1]. Set it back to JavaScript and set the `[styling]`
section back to `[styling=C]`, removing the partial set of styles
added in that change and highlighting should work perfect (after all,
isn't JSON valid JavaScript syntax?). You can check "Old Revisions" on
the wiki to see the original entry and the additions later on.


Is the [1] in "instead of JavaScript[1]" significant?



Scroll down to the bottom of my email.


I changed filetypes.JSON.conf to:

 [styling=C]
 default=default
 number=number
 string=string
 word=word
 identifier=identifier,bold



Delete everything after [styling=C] there (from "default" to 
"identifier" keys).



 [keywords]
 primary=true false null

 [settings]
 extension=json
 lexer_filetype=Javascript
 comment_single=#
 comment_use_indent=true

 [indentation]
 width=2
 # 0 is spaces, 1 is tabs, 2 is tab & spaces
 type=0

Syntax highlighting is still not so colourful: Names are bold black and
values are normal black unless they are numbers, in which case they are
green.



Because you left YAML styles above maybe (under [styling=C]).


Highlighting of matching '[' and '{' braces works fine after rebooting
my PC.



Should never need to reboot PC for anything with Geany, but often making 
changes to configuration files requires restarting all Geany instances.



Setting the filetype to Javascript (Document -> Set Filetype ->
Scripting Languages -> Javascript) results in a more colourful display,
but without any differentiation between names and values.



It highlights it the same as JavaScript. I don't know what names and 
values are in this context, but it highlights quoted "strings" the same 
no matter where they appear, as far as I know.



Is there any way of customizing this without launching a new career?



Depends how much of the manual you read :)



Please update the wiki if you find it's incorrect.


How do I do that?



Create a login, login, and click "Edit" or whatever it's labeled on the 
page you want to edit. Pretty much same as any wiki.


Cheers,
Matthew Brush
___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


Re: [Geany-Users] adding json support

2013-02-23 Thread Bob Furber

On 13-02-22 05:30 PM, Matthew Brush wrote:
Someone changed my wiki entry so the filetype is YAML instead of 
JavaScript[1]. Set it back to JavaScript and set the `[styling]` 
section back to `[styling=C]`, removing the partial set of styles 
added in that change and highlighting should work perfect (after all, 
isn't JSON valid JavaScript syntax?). You can check "Old Revisions" on 
the wiki to see the original entry and the additions later on.


Is the [1] in "instead of JavaScript[1]" significant?

I changed filetypes.JSON.conf to:

[styling=C]
default=default
number=number
string=string
word=word
identifier=identifier,bold

[keywords]
primary=true false null

[settings]
extension=json
lexer_filetype=Javascript
comment_single=#
comment_use_indent=true

[indentation]
width=2
# 0 is spaces, 1 is tabs, 2 is tab & spaces
type=0

Syntax highlighting is still not so colourful: Names are bold black and 
values are normal black unless they are numbers, in which case they are 
green.


Highlighting of matching '[' and '{' braces works fine after rebooting 
my PC.


Setting the filetype to Javascript (Document -> Set Filetype -> 
Scripting Languages -> Javascript) results in a more colourful display, 
but without any differentiation between names and values.


Is there any way of customizing this without launching a new career?



Please update the wiki if you find it's incorrect.


How do I do that?

Thanks,

RF

___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


Re: [Geany-Users] adding json support

2013-02-22 Thread Lex Trotman
[...]
> Someone changed my wiki entry so the filetype is YAML instead of
> JavaScript[1]. Set it back to JavaScript and set the `[styling]` section
> back to `[styling=C]`, removing the partial set of styles added in that
> change and highlighting should work perfect (after all, isn't JSON valid
> JavaScript syntax?). You can check "Old Revisions" on the wiki to see the
> original entry and the additions later on.
>
> Please update the wiki if you find it's incorrect.

Using Javascript as a base for JSON makes much more sense, it is after
all JavaScript Object Notation :)

Cheers
Lex

>
> Cheers,
> Matthew Brush
>
> [1] http://wiki.geany.org/config/json?rev=1348827879&do=diff
>
>
> ___
> Users mailing list
> Users@lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/users
___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


Re: [Geany-Users] adding json support

2013-02-22 Thread Matthew Brush

On 13-02-22 03:47 PM, Bob Furber wrote:

On 13-02-22 03:08 PM, Lex Trotman wrote:

>But, where can I find the content of this check_json script file?

Its on the wiki as:

#!/bin/bash
if which python >/dev/null ; then
   python -m json.tool <$1 2>&1 >/dev/null \
   | sed 's/^\([^:]*\): line \(.*\)/'$1':\2: \1/'
elif which perl >/dev/null ; then
   perl -MJSON -e 'local $/;decode_json();' <$1 2>&1 >/dev/null \
   |sed 's/^\(.*\) at .e line 1, .STDIN. [^ ]* \([0-9]*\)/'$1':\2: \1/;'
else
   echo "No known JSON parsers found" >&2
   exit 1
fi



Doh!

I took "For people using Unix, the following will be helpful for
checking your JSON files for correctness." too literally and did not
think it applied to Linux ..causing a lot of bother as a result.

Now any .json file is recognized as such and there is a hint of context
sensitive highlighting: bolded variable names and green numbers. My next
job will be to try to expand and embellish  the context sensitive
highlighting.

But, one problem I have run into is the opening/closing brace/bracket
check is disabled for filetype: JSON. I can enable it by Document -> Set
filetype -> NONE ..precisely where I started a couple of days ago  :o(



Someone changed my wiki entry so the filetype is YAML instead of 
JavaScript[1]. Set it back to JavaScript and set the `[styling]` section 
back to `[styling=C]`, removing the partial set of styles added in that 
change and highlighting should work perfect (after all, isn't JSON valid 
JavaScript syntax?). You can check "Old Revisions" on the wiki to see 
the original entry and the additions later on.


Please update the wiki if you find it's incorrect.

Cheers,
Matthew Brush

[1] http://wiki.geany.org/config/json?rev=1348827879&do=diff

___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


Re: [Geany-Users] adding json support

2013-02-22 Thread Bob Furber

On 13-02-22 03:08 PM, Lex Trotman wrote:

>But, where can I find the content of this check_json script file?

Its on the wiki as:

#!/bin/bash
if which python >/dev/null ; then
   python -m json.tool <$1 2>&1 >/dev/null \
   | sed 's/^\([^:]*\): line \(.*\)/'$1':\2: \1/'
elif which perl >/dev/null ; then
   perl -MJSON -e 'local $/;decode_json();' <$1 2>&1 >/dev/null \
   |sed 's/^\(.*\) at .e line 1, .STDIN. [^ ]* \([0-9]*\)/'$1':\2: \1/;'
else
   echo "No known JSON parsers found" >&2
   exit 1
fi



Doh!

I took "For people using Unix, the following will be helpful for 
checking your JSON files for correctness." too literally and did not 
think it applied to Linux ..causing a lot of bother as a result.


Now any .json file is recognized as such and there is a hint of context 
sensitive highlighting: bolded variable names and green numbers. My next 
job will be to try to expand and embellish  the context sensitive 
highlighting.


But, one problem I have run into is the opening/closing brace/bracket 
check is disabled for filetype: JSON. I can enable it by Document -> Set 
filetype -> NONE ..precisely where I started a couple of days ago  :o(


Thanks again for your patience,

RF


___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


Re: [Geany-Users] adding json support

2013-02-22 Thread Bob Furber

On 13-02-22 01:59 PM, Lex Trotman wrote:

Thanks for your patience and thank you for narrowing down the issue to 
the absence of the check_json script in /usr/local/bin or some other 
directory in the PATH variable.


But, where can I find the content of this check_json script file?

Thanks,

RF


On 23 February 2013 06:38, Bob Furber  wrote:

On 13-02-21 06:21 PM, Lex Trotman wrote:

Hi Bob,

Lets just summarise the steps for you to check:

1. You are using Geany 0.21 or 1.22 (older may work but no guarantee)


It turns out I had Geany 0.21, so I upgraded to 1.22:
   sudo add-apt-repository ppa:geany-dev/ppa
   sudo apt-get update
   sudo apt-get upgrade

2. You followed Colomban's advice to menu->tools->configuration
files->filetype_extensions.conf and added the two lines from the wiki,
note one is in the [extensions] section and one in the [groups]
section.


Yes. Under [Extensions], I added
   JSON=*.json;

..and, under [Groups] I added:
   Misc=JSON;

3. You followed Colomban's advice to copy the filetypes.JSON.conf from
the wiki to your ~/.config/geany/filedefs directory

Yes, I started up Geany in Supervisor mode from the command line:
   ~$ sudo geany

Then I copied the code from the wiki into a new file:
 [styling]
 default=default
 number=number
 string=string
 word=word
 identifier=identifier,bold

 [keywords]
 primary=true false null

 [settings]
 lexer_filetype=YAML
 extension=json
 comment_single=

 [indentation]
 width=2
 # 0 is spaces, 1 is tabs, 2 is tab & spaces
 type=0


..and saved the file as ~/.config/geany/filedef/filetypes.JSON.conf


These steps are all you need to have the filetype recognised for files
with the .json extension, check in the status bar for filetype:JSON
when you open such a file.  If it doesn't work, check your use of
case, thats the most common error, *everything* is case sensitive
including filenames and file contents and extensions.


Ahhh, did you restart Geany?


Loading MyFile.json loads it as filetype:None

Saving MyFile.json as MyFile.JSON saves it as filetype:None

Loading MyFile.json as MyFile.JSON loads it as filetype:None

Document -> Set Filetype -> Miscellaneous -> JSON file  changes the
filetype to JSON and variable names are bolded and numbers are green

In short, I am almost there.


4. You put the check_json script somewhere that is in your PATH list


Hmmm... I cannot find any trace of /usr/local/bin/check_json

Its the script listed on the wiki, you have to create it so the
command can run it, which is why I said *someewhere* on your PATH,
like ~/bin, not necessarily in a system directory.


So it appears I don't understand how to use the Build -> Set Build Commands
dialog, which shows "check" in the Name field of the topmost line, followed
by "/usr/local/bin/check_json %f" and I see that /usr/local/bin/
  is already on my PATH:

~$ echo $PATH
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

Hmmm, looks like you only have system dirs in your PATH, I'd add ~/bin
(spell it out in full, ~ won't work) so you don't have to put any
local programs into system directories.


But what does it take for this dialog to generate the check_json script?
Clicking Ok does not do it.

It doesn't it runs it, see above.


Cheers
Lex



5. You edited the build commands and the error exception

This should now give you a "check" item in the build menu when you
have a JSON file open and error messages in the compiler window should
point to the line in the source where it occurs.


This is where I run into problems.

Thanks for your patience,

RF



Cheers
Lex

On 22 February 2013 12:14, Bob Furber  wrote:

Ok, I named the top line of the Build Command dialog "check".

I entered /usr/local/bin/check_json %f in the Command field beside it.

I left the Working Directory field blank.

I entered ([^:]+):([0-9]+) in the Error Regular Expression field at
the bottom of the top block.

Then I clicked Ok and nothing happened. There is no syntax
highlighting of my Json files ..even after restarting Geany.

I am missing something obvious, but I do not see it.

What is it?


Thanks for all your help,

RF


On 13-02-20 02:55 PM, Lex Trotman wrote:

On 21 February 2013 09:41, Bob Furber  wrote:

Some progress, thanks to you, Colomban.

But, still some questions:

What is meant in the wiki by:

- "use /usr/local/bin/check_json %f as the compile command"? Under "Set
Build Commands"
   I have many choices where to place the command, but I do not see a
Compile
command.

You don't see one because you havn't added it yet :)  Just use the top
line of the dialog, thats traditionally the compile command.  Note,
since you have to give it the name as well, you might want to call it
"check" instead of "compile" since thats what it runs.


   I do see a "Make" and "Make Custom Target" commands.

- "..and ([^:]+):([0-9]+) as the Error Regular Expression" is pasted in
the
"Error
  

Re: [Geany-Users] adding json support

2013-02-22 Thread Lex Trotman
On 23 February 2013 06:38, Bob Furber  wrote:
> On 13-02-21 06:21 PM, Lex Trotman wrote:
>
> Hi Bob,
>
> Lets just summarise the steps for you to check:
>
> 1. You are using Geany 0.21 or 1.22 (older may work but no guarantee)
>
>
> It turns out I had Geany 0.21, so I upgraded to 1.22:
>   sudo add-apt-repository ppa:geany-dev/ppa
>   sudo apt-get update
>   sudo apt-get upgrade
>
> 2. You followed Colomban's advice to menu->tools->configuration
> files->filetype_extensions.conf and added the two lines from the wiki,
> note one is in the [extensions] section and one in the [groups]
> section.
>
>
> Yes. Under [Extensions], I added
>   JSON=*.json;
>
> ..and, under [Groups] I added:
>   Misc=JSON;
>
> 3. You followed Colomban's advice to copy the filetypes.JSON.conf from
> the wiki to your ~/.config/geany/filedefs directory
>
> Yes, I started up Geany in Supervisor mode from the command line:
>   ~$ sudo geany
>
> Then I copied the code from the wiki into a new file:
> [styling]
> default=default
> number=number
> string=string
> word=word
> identifier=identifier,bold
>
> [keywords]
> primary=true false null
>
> [settings]
> lexer_filetype=YAML
> extension=json
> comment_single=
>
> [indentation]
> width=2
> # 0 is spaces, 1 is tabs, 2 is tab & spaces
> type=0
>
>
> ..and saved the file as ~/.config/geany/filedef/filetypes.JSON.conf
>
>
> These steps are all you need to have the filetype recognised for files
> with the .json extension, check in the status bar for filetype:JSON
> when you open such a file.  If it doesn't work, check your use of
> case, thats the most common error, *everything* is case sensitive
> including filenames and file contents and extensions.
>

Ahhh, did you restart Geany?

>
> Loading MyFile.json loads it as filetype:None
>
> Saving MyFile.json as MyFile.JSON saves it as filetype:None
>
> Loading MyFile.json as MyFile.JSON loads it as filetype:None
>
> Document -> Set Filetype -> Miscellaneous -> JSON file  changes the
> filetype to JSON and variable names are bolded and numbers are green
>
> In short, I am almost there.
>
>
> 4. You put the check_json script somewhere that is in your PATH list
>
>
> Hmmm... I cannot find any trace of /usr/local/bin/check_json

Its the script listed on the wiki, you have to create it so the
command can run it, which is why I said *someewhere* on your PATH,
like ~/bin, not necessarily in a system directory.

>
> So it appears I don't understand how to use the Build -> Set Build Commands
> dialog, which shows "check" in the Name field of the topmost line, followed
> by "/usr/local/bin/check_json %f" and I see that /usr/local/bin/
>  is already on my PATH:
>
> ~$ echo $PATH
> /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

Hmmm, looks like you only have system dirs in your PATH, I'd add ~/bin
(spell it out in full, ~ won't work) so you don't have to put any
local programs into system directories.

>
> But what does it take for this dialog to generate the check_json script?
> Clicking Ok does not do it.

It doesn't it runs it, see above.


Cheers
Lex

>
>
> 5. You edited the build commands and the error exception
>
> This should now give you a "check" item in the build menu when you
> have a JSON file open and error messages in the compiler window should
> point to the line in the source where it occurs.
>
>
> This is where I run into problems.
>
> Thanks for your patience,
>
> RF
>
>
>
> Cheers
> Lex
>
> On 22 February 2013 12:14, Bob Furber  wrote:
>
> Ok, I named the top line of the Build Command dialog "check".
>
> I entered /usr/local/bin/check_json %f in the Command field beside it.
>
> I left the Working Directory field blank.
>
> I entered ([^:]+):([0-9]+) in the Error Regular Expression field at
> the bottom of the top block.
>
> Then I clicked Ok and nothing happened. There is no syntax
> highlighting of my Json files ..even after restarting Geany.
>
> I am missing something obvious, but I do not see it.
>
> What is it?
>
>
> Thanks for all your help,
>
> RF
>
>
> On 13-02-20 02:55 PM, Lex Trotman wrote:
>
> On 21 February 2013 09:41, Bob Furber  wrote:
>
> Some progress, thanks to you, Colomban.
>
> But, still some questions:
>
> What is meant in the wiki by:
>
> - "use /usr/local/bin/check_json %f as the compile command"? Under "Set
> Build Commands"
>   I have many choices where to place the command, but I do not see a
> Compile
> command.
>
> You don't see one because you havn't added it yet :)  Just use the top
> line of the dialog, thats traditionally the compile command.  Note,
> since you have to give it the name as well, you might want to call it
> "check" instead of "compile" since thats what it runs.
>
>
>   I do see a "Make" and "Make Custom Target" commands.
>
> - "..and ([^:]+):([0-9]+) as the Error Regular Expression" is pasted in
> the
> "Error
>   regular expression" field immediately below wherever I paste the

Re: [Geany-Users] adding json support

2013-02-22 Thread Bob Furber

On 13-02-21 06:21 PM, Lex Trotman wrote:

Hi Bob,

Lets just summarise the steps for you to check:

1. You are using Geany 0.21 or 1.22 (older may work but no guarantee)


It turns out I had Geany 0.21, so I upgraded to 1.22:
  sudo add-apt-repository ppa:geany-dev/ppa
  sudo apt-get update
  sudo apt-get upgrade


2. You followed Colomban's advice to menu->tools->configuration
files->filetype_extensions.conf and added the two lines from the wiki,
note one is in the [extensions] section and one in the [groups]
section.


Yes. Under [Extensions], I added
  JSON=*.json;

..and, under [Groups] I added:
  Misc=JSON;


3. You followed Colomban's advice to copy the filetypes.JSON.conf from
the wiki to your ~/.config/geany/filedefs directory


Yes, I started up Geany in Supervisor mode from the command line:
  ~$ sudo geany

Then I copied the code from the wiki into a new file:
[styling]
default=default
number=number
string=string
word=word
identifier=identifier,bold
 
[keywords]

primary=true false null
 
[settings]

lexer_filetype=YAML
extension=json
comment_single=
 
[indentation]

width=2
# 0 is spaces, 1 is tabs, 2 is tab & spaces
type=0


..and saved the file as ~/.config/geany/filedef/filetypes.JSON.conf



These steps are all you need to have the filetype recognised for files
with the .json extension, check in the status bar for filetype:JSON
when you open such a file.  If it doesn't work, check your use of
case, thats the most common error, *everything* is case sensitive
including filenames and file contents and extensions.


Loading MyFile.json loads it as filetype:None

Saving MyFile.json as MyFile.JSON saves it as filetype:None

Loading MyFile.json as MyFile.JSON loads it as filetype:None

Document -> Set Filetype -> Miscellaneous -> JSON file  changes the
filetype to JSON and variable names are bolded and numbers are green

In short, I am almost there.



4. You put the check_json script somewhere that is in your PATH list


Hmmm... I cannot find any trace of /usr/local/bin/check_json

So it appears I don't understand how to use the Build -> Set Build Commands
dialog, which shows "check" in the Name field of the topmost line, followed
by "/usr/local/bin/check_json %f" and I see that /usr/local/bin/
 is already on my PATH:

~$ echo $PATH
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

But what does it take for this dialog to generate the check_json script? 
Clicking Ok does not do it.



5. You edited the build commands and the error exception

This should now give you a "check" item in the build menu when you
have a JSON file open and error messages in the compiler window should
point to the line in the source where it occurs.


This is where I run into problems.

Thanks for your patience,

RF




Cheers
Lex

On 22 February 2013 12:14, Bob Furber  wrote:

Ok, I named the top line of the Build Command dialog "check".

I entered /usr/local/bin/check_json %f in the Command field beside it.

I left the Working Directory field blank.

I entered ([^:]+):([0-9]+) in the Error Regular Expression field at
the bottom of the top block.

Then I clicked Ok and nothing happened. There is no syntax
highlighting of my Json files ..even after restarting Geany.

I am missing something obvious, but I do not see it.

What is it?


Thanks for all your help,

RF


On 13-02-20 02:55 PM, Lex Trotman wrote:


On 21 February 2013 09:41, Bob Furber  wrote:

Some progress, thanks to you, Colomban.

But, still some questions:

What is meant in the wiki by:

- "use /usr/local/bin/check_json %f as the compile command"? Under "Set
Build Commands"
   I have many choices where to place the command, but I do not see a
Compile
command.

You don't see one because you havn't added it yet :)  Just use the top
line of the dialog, thats traditionally the compile command.  Note,
since you have to give it the name as well, you might want to call it
"check" instead of "compile" since thats what it runs.



   I do see a "Make" and "Make Custom Target" commands.

- "..and ([^:]+):([0-9]+) as the Error Regular Expression" is pasted in
the
"Error
   regular expression" field immediately below wherever I paste the
compile
command?

Yes.


Finally, if I am successful, I would be pleased to rewrite this wiki page
to
make it
clearer for dummies like me.


All contributions welcome.

Cheers
Lex


Thanks,

RF

On 13-02-20 12:49 PM, Colomban Wendling wrote:

Hi,

Le 20/02/2013 20:46, Bob Furber a écrit :

The Geany wiki provides instructions on how to add json support.

But I have run into problems:

- I cannot find |filetypes_extensions.conf|, the file I need to
modify on my Linux Ubuntu system.

It may not already exist in your user config, but it's supposed to be in
~/.config/geany/.  You can also open it for editing using
Tools->Configuration files->filetype_extensions.conf from inside Geany.

- I assume I deed to add th

Re: [Geany-Users] adding json support

2013-02-21 Thread Lex Trotman
Hi Bob,

Lets just summarise the steps for you to check:

1. You are using Geany 0.21 or 1.22 (older may work but no guarantee)
2. You followed Colomban's advice to menu->tools->configuration
files->filetype_extensions.conf and added the two lines from the wiki,
note one is in the [extensions] section and one in the [groups]
section.
3. You followed Colomban's advice to copy the filetypes.JSON.conf from
the wiki to your ~/.config/geany/filedefs directory

These steps are all you need to have the filetype recognised for files
with the .json extension, check in the status bar for filetype:JSON
when you open such a file.  If it doesn't work, check your use of
case, thats the most common error, *everything* is case sensitive
including filenames and file contents and extensions.

4. You put the check_json script somewhere that is in your PATH list
5. You edited the build commands and the error exception

This should now give you a "check" item in the build menu when you
have a JSON file open and error messages in the compiler window should
point to the line in the source where it occurs.

Cheers
Lex

On 22 February 2013 12:14, Bob Furber  wrote:
> Ok, I named the top line of the Build Command dialog "check".
>
> I entered /usr/local/bin/check_json %f in the Command field beside it.
>
> I left the Working Directory field blank.
>
> I entered ([^:]+):([0-9]+) in the Error Regular Expression field at
> the bottom of the top block.
>
> Then I clicked Ok and nothing happened. There is no syntax
> highlighting of my Json files ..even after restarting Geany.
>
> I am missing something obvious, but I do not see it.
>
> What is it?
>
>
> Thanks for all your help,
>
> RF
>
>
> On 13-02-20 02:55 PM, Lex Trotman wrote:
>
>> On 21 February 2013 09:41, Bob Furber  wrote:
>>>
>>> Some progress, thanks to you, Colomban.
>>>
>>> But, still some questions:
>>>
>>> What is meant in the wiki by:
>>>
>>> - "use /usr/local/bin/check_json %f as the compile command"? Under "Set
>>> Build Commands"
>>>   I have many choices where to place the command, but I do not see a
>>> Compile
>>> command.
>>
>> You don't see one because you havn't added it yet :)  Just use the top
>> line of the dialog, thats traditionally the compile command.  Note,
>> since you have to give it the name as well, you might want to call it
>> "check" instead of "compile" since thats what it runs.
>>
>>
>>>   I do see a "Make" and "Make Custom Target" commands.
>>>
>>> - "..and ([^:]+):([0-9]+) as the Error Regular Expression" is pasted in
>>> the
>>> "Error
>>>   regular expression" field immediately below wherever I paste the
>>> compile
>>> command?
>>
>> Yes.
>>
>>> Finally, if I am successful, I would be pleased to rewrite this wiki page
>>> to
>>> make it
>>> clearer for dummies like me.
>>>
>> All contributions welcome.
>>
>> Cheers
>> Lex
>>
>>> Thanks,
>>>
>>> RF
>>>
>>> On 13-02-20 12:49 PM, Colomban Wendling wrote:
>>>
>>> Hi,
>>>
>>> Le 20/02/2013 20:46, Bob Furber a écrit :
>>>
>>> The Geany wiki provides instructions on how to add json support.
>>>
>>> But I have run into problems:
>>>
>>> - I cannot find |filetypes_extensions.conf|, the file I need to
>>> modify on my Linux Ubuntu system.
>>>
>>> It may not already exist in your user config, but it's supposed to be in
>>> ~/.config/geany/.  You can also open it for editing using
>>> Tools->Configuration files->filetype_extensions.conf from inside Geany.
>>>
>>> - I assume I deed to add the new filetypes.JSON.conf to the
>>> /usr/share/geany folder
>>>
>>> No, this is the system path, to add a filetype for your user, add it in
>>> ~/.config/geany/filedefs/
>>>
>>> Regards,
>>> Colomban
>>>
>>> Can anyone help me add json support to an otherwise outstanding code
>>> editor?
>>>
>>> ___
>>> Users mailing list
>>> Users@lists.geany.org
>>> https://lists.geany.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>>
>>> ___
>>> Users mailing list
>>> Users@lists.geany.org
>>> https://lists.geany.org/cgi-bin/mailman/listinfo/users
>>>
>> ___
>> Users mailing list
>> Users@lists.geany.org
>> https://lists.geany.org/cgi-bin/mailman/listinfo/users
>>
>>
> ___
> Users mailing list
> Users@lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/users
___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


Re: [Geany-Users] adding json support

2013-02-21 Thread Bob Furber

Ok, I named the top line of the Build Command dialog "check".

I entered /usr/local/bin/check_json %f in the Command field beside it.

I left the Working Directory field blank.

I entered ([^:]+):([0-9]+) in the Error Regular Expression field at
the bottom of the top block.

Then I clicked Ok and nothing happened. There is no syntax
highlighting of my Json files ..even after restarting Geany.

I am missing something obvious, but I do not see it.

What is it?


Thanks for all your help,

RF

On 13-02-20 02:55 PM, Lex Trotman wrote:


On 21 February 2013 09:41, Bob Furber  wrote:

Some progress, thanks to you, Colomban.

But, still some questions:

What is meant in the wiki by:

- "use /usr/local/bin/check_json %f as the compile command"? Under "Set
Build Commands"
  I have many choices where to place the command, but I do not see a Compile
command.

You don't see one because you havn't added it yet :)  Just use the top
line of the dialog, thats traditionally the compile command.  Note,
since you have to give it the name as well, you might want to call it
"check" instead of "compile" since thats what it runs.



  I do see a "Make" and "Make Custom Target" commands.

- "..and ([^:]+):([0-9]+) as the Error Regular Expression" is pasted in the
"Error
  regular expression" field immediately below wherever I paste the compile
command?

Yes.


Finally, if I am successful, I would be pleased to rewrite this wiki page to
make it
clearer for dummies like me.


All contributions welcome.

Cheers
Lex


Thanks,

RF

On 13-02-20 12:49 PM, Colomban Wendling wrote:

Hi,

Le 20/02/2013 20:46, Bob Furber a écrit :

The Geany wiki provides instructions on how to add json support.

But I have run into problems:

- I cannot find |filetypes_extensions.conf|, the file I need to
modify on my Linux Ubuntu system.

It may not already exist in your user config, but it's supposed to be in
~/.config/geany/.  You can also open it for editing using
Tools->Configuration files->filetype_extensions.conf from inside Geany.

- I assume I deed to add the new filetypes.JSON.conf to the
/usr/share/geany folder

No, this is the system path, to add a filetype for your user, add it in
~/.config/geany/filedefs/

Regards,
Colomban

Can anyone help me add json support to an otherwise outstanding code
editor?

___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


Re: [Geany-Users] adding json support

2013-02-20 Thread Lex Trotman
On 21 February 2013 09:41, Bob Furber  wrote:
> Some progress, thanks to you, Colomban.
>
> But, still some questions:
>
> What is meant in the wiki by:
>
> - "use /usr/local/bin/check_json %f as the compile command"? Under "Set
> Build Commands"
>  I have many choices where to place the command, but I do not see a Compile
> command.

You don't see one because you havn't added it yet :)  Just use the top
line of the dialog, thats traditionally the compile command.  Note,
since you have to give it the name as well, you might want to call it
"check" instead of "compile" since thats what it runs.


>  I do see a "Make" and "Make Custom Target" commands.
>
> - "..and ([^:]+):([0-9]+) as the Error Regular Expression" is pasted in the
> "Error
>  regular expression" field immediately below wherever I paste the compile
> command?

Yes.

>
> Finally, if I am successful, I would be pleased to rewrite this wiki page to
> make it
> clearer for dummies like me.
>

All contributions welcome.

Cheers
Lex

>
> Thanks,
>
> RF
>
> On 13-02-20 12:49 PM, Colomban Wendling wrote:
>
> Hi,
>
> Le 20/02/2013 20:46, Bob Furber a écrit :
>
> The Geany wiki provides instructions on how to add json support.
>
> But I have run into problems:
>
> - I cannot find |filetypes_extensions.conf|, the file I need to
> modify on my Linux Ubuntu system.
>
> It may not already exist in your user config, but it's supposed to be in
> ~/.config/geany/.  You can also open it for editing using
> Tools->Configuration files->filetype_extensions.conf from inside Geany.
>
> - I assume I deed to add the new filetypes.JSON.conf to the
> /usr/share/geany folder
>
> No, this is the system path, to add a filetype for your user, add it in
> ~/.config/geany/filedefs/
>
> Regards,
> Colomban
>
> Can anyone help me add json support to an otherwise outstanding code
> editor?
>
> ___
> Users mailing list
> Users@lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/users
>
>
>
> ___
> Users mailing list
> Users@lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/users
>
___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


Re: [Geany-Users] adding json support

2013-02-20 Thread Bob Furber

Some progress, thanks to you, Colomban.

But, still some questions:

What is meant in the wiki by:

- "use|/usr/local/bin/check_json %f|  as the compile command"? Under "Set Build 
Commands"
 I have many choices where to place the command, but I do not see a Compile 
command.
 I do see a "Make" and "Make Custom Target" commands.

- "..and|([^:]+):([0-9]+)|  as the Error Regular Expression" is pasted in the 
"Error
 regular expression" field immediately below wherever I paste the compile 
command?

Finally, if I am successful, I would be pleased to rewrite this wiki page to 
make it
clearer for dummies like me.


Thanks,

RF

On 13-02-20 12:49 PM, Colomban Wendling wrote:


Hi,

Le 20/02/2013 20:46, Bob Furber a écrit :

The Geany wiki provides instructions on how to add json support.

But I have run into problems:

- I cannot find |filetypes_extensions.conf|, the file I need to
modify on my Linux Ubuntu system.

It may not already exist in your user config, but it's supposed to be in
~/.config/geany/.  You can also open it for editing using
Tools->Configuration files->filetype_extensions.conf from inside Geany.


- I assume I deed to add the new filetypes.JSON.conf to the
/usr/share/geany folder

No, this is the system path, to add a filetype for your user, add it in
~/.config/geany/filedefs/

Regards,
Colomban


Can anyone help me add json support to an otherwise outstanding code
editor?

___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


Re: [Geany-Users] adding json support

2013-02-20 Thread Colomban Wendling
Hi,

Le 20/02/2013 20:46, Bob Furber a écrit :
> The Geany wiki provides instructions on how to add json support.
> 
> But I have run into problems:
> 
> - I cannot find |filetypes_extensions.conf|, the file I need to
> modify on my Linux Ubuntu system.

It may not already exist in your user config, but it's supposed to be in
~/.config/geany/.  You can also open it for editing using
Tools->Configuration files->filetype_extensions.conf from inside Geany.

> - I assume I deed to add the new filetypes.JSON.conf to the
> /usr/share/geany folder

No, this is the system path, to add a filetype for your user, add it in
~/.config/geany/filedefs/

Regards,
Colomban

> Can anyone help me add json support to an otherwise outstanding code
> editor?
___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users


[Geany-Users] adding json support

2013-02-20 Thread Bob Furber

The Geany wiki provides instructions on how to add json support.

But I have run into problems:

- I cannot find|filetypes_extensions.conf|, the file I need to modify on my 
Linux Ubuntu system.

- I assume I deed to add the new filetypes.JSON.conf to the /usr/share/geany 
folder

Can anyone help me add json support to an otherwise outstanding code editor?


___
Users mailing list
Users@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/users