Hi, Scintilla uses LexLisp.cxx for Lisp and Scheme, but Geany uses Lisp only. I use GIMP and Script-Fu and I would like to see the syntax :) If it possible, [geany-master-scheme.zip](http://www118.zippyshare.com/v/VoUXDqTp/file.html) (new/modif. files): ``` data/filedefs/filetypes.scheme data/filetype_extensions.conf data/Makefile.am src/filetypes.c src/filetypes.h src/highlighting.c src/highlightingmappings.h ```
Regards,
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/982
As it uses an existing lexer you should be able to make a custom filetype for scheme.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/982#issuecomment-203126003
@elextr I don't quite understand you, I added a file _filetypes.scheme_. Do you say about it?
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/982#issuecomment-203279336
If a language can use an existing lexer it can be simply a [custom filetype](http://www.geany.org/manual/current/index.html#custom-filetypes) which does not need any code changes in Geany, just its `filetype.Scheme.conf` file and adjustments to `filetype_extensions.conf`. See for example Clojure.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/982#issuecomment-203282197
@elextr thanks, I was not attentive :) Works fine.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/982#issuecomment-203287953
1.31, problem with quotes, ```filetypes.Scheme.conf```: ``` [styling=Lisp]
[settings] extension=scm lexer_filetype=Lisp
comment_single=; comment_open=#| comment_close=|# comment_use_indent=true
[build_settings] run_cmd=gsi -f "%f" ``` and code example: ```scheme (script-fu-register "script-fu-alien-glow-horizontal-ruler" _"_Hrule..." _"Create an Hrule graphic with an eerie glow for web pages" "Adrian Likins" "Adrian Likins" "1997" "" SF-ADJUSTMENT _"Bar length" '(480 5 1500 1 10 0 1) SF-ADJUSTMENT _"Bar height" '(16 1 100 1 10 0 1) SF-COLOR _"Glow color" '(63 252 0) SF-COLOR _"Background color" "black" SF-TOGGLE _"Flatten image" TRUE )
(script-fu-menu-register "script-fu-alien-glow-horizontal-ruler" "<Image>/File/Create/Web Page Themes/Alien Glow") ``` Some quoting strings was not highlight. I changed filetype to Lisp, but same errors. Bug?
The ones that don't highlight are the ones beginning with `_"` which isn't Lisp AFAIK. So no its not a bug.
I think it's Scintilla problem and bug:
![47](https://user-images.githubusercontent.com/6333198/32157160-35a41c9e-bd5b-11e...)
Maybe only [TinyScheme feature](https://github.com/armornick/TinyScheme/blob/a57db38c6fac5152336133dbd31c998...).
Yes its Scintilla, thats where the highlighting is, but I don't think its a bug, because `_"` is not a standard lisp syntax, see [here](http://www.gigamonkeys.com/book/numbers-characters-and-strings.html) so I doubt a report is worth it.
See [this](https://github.com/JeffBezanson/femtolisp/blob/master/README.md) on the subject of non-standard features in Lisps :grin:
@elextr, no I don't agree, because I think it's not ```_"``` syntax: it's ```_string``` syntax :) Strings are enclosed by double quotation marks, for example Github is highlight correct, other editors too, but except Scintilla based. Why? Ok, ```_``` is part of words (```[A-Za-z_]+```), but ```"``` - no and editor should highlight the next string. For example C: ```c static kindDefinition AwkKinds [] = { { true, 'f', ______________"function", __________"functions" } }; ```
The problem is that the whitespace between the underscore (which is a symbol) and the string is missing, some modern lisps (I tried sbcl) will accept this (and github of course, which colourises the underscore different to the string) but its not standard lisp for the reader to recognise atoms run together, a list is a parenthesised list of WHITESPACE SEPARATED items.
You could try asking for a feature request on Scintilla but I'm not sure how well the Lisp lexer is supported, there have been no changes (other than ones enforced by changes in Scintilla, like namespaces) for many many years.
The lisp lexer is hard coded, no word character definitions affect it and for lisp, word characters are way beyond the ASCII alpha and underscore, +-* and more are accepted :)
I'm not sure what your piece of C is trying to say and what its got to do with Lisp?
Sorry, I cannot clearly formulated thought about this in English :( But I will think about report/request.
About "problem with quotes": maybe [it's part of gettext feature](https://www.gnu.org/software/gettext/manual/html_node/Scheme.html), GIMP Script-Fu extension can use "_" without a space before the string (see ```gettext shorthand```).
So maybe it's not a bug in the canonical sense, but it's a problem for all Scintilla-based editors (I don't like SF.net, I don't have an account and I cannot say anything about the future :confused: ).
Well, you can ask Scintilla for the enhancement (or better yet supply a patch) to support the non-standard `_"` syntax of Scheme, or use the standard syntax from Lisp as [shown](https://www.gnu.org/software/gettext/manual/html_node/Common-Lisp.html#Commo...) which Scheme gettext also supports according to your link above.
Agree about SF.net, not because I don't like it, but because it screwed up a password change and refuses to reset or recover, so I can't use it. And another Geany contributor has the same problem. But you could submit your patch to Scintilla by email to its mailing list.
It seems I found solution (optional, don't works by default): ```diff --- scintilla/lexers/LexLisp.cxx Wed Mar 07 00:46:38 2018 +++ scintilla/lexers/LexLisp.cxx Wed Mar 07 00:42:04 2018 @@ -86,6 +86,8 @@ char chNext = styler[startPos]; Sci_PositionU lengthDoc = startPos + length; styler.StartSegment(startPos); + /*gettext shorthand for Scheme, GIMP Script-Fu extension*/ + bool scriptfu = styler.GetPropertyInt("lexer.scheme.scriptfu") == 1; for (Sci_PositionU i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); @@ -103,6 +105,11 @@ styler.ColourTo(i - 1, state); radix = -1; state = SCE_LISP_MACRO_DISPATCH; + } + /*gettext shorthand for Scheme, GIMP Script-Fu extension*/ + else if (scriptfu && ch == '_' && chNext == '"') { + styler.ColourTo(i - 1, state); + state = SCE_LISP_DEFAULT; } else if (ch == ':' && isLispwordstart(chNext)) { styler.ColourTo(i - 1, state); state = SCE_LISP_SYMBOL;
``` And it requires two new strings in ```filetypes.Scheme.conf```: ```ini [lexer_properties=Lisp] lexer.scheme.scriptfu=1 ``` ![02](https://user-images.githubusercontent.com/6333198/37142792-fc80fc3c-22b0-11e...)
Hm... It works on Win, but with problem on Linux: it sometimes works with Lisp lexer too. Maybe it's ```scriptfu``` value: ```scriptfu == true``` the same as ```scriptfu == false``` because some value is exists in any case.
Maybe add ```filetypes.Scheme.conf``` to page [https://wiki.geany.org/config/start%5D(https://wiki.geany.org/config/start)? [filetypes.Scheme.conf](https://pastebin.com/1jDKBjZ5) and ```filetype_extensions.conf```: ```ini [Extensions] ... Scheme=*.scm;*.ss; ...
[Groups] ... Script=Scheme; ```
P.S. I know about PR [#1922 Add parsers and built-in filetypes for Lisp dialects](https://github.com/geany/geany/pull/1922), but I don't know what will be done (and when).
Maybe add filetypes.Scheme.conf to page https://wiki.geany.org/config/start?
Sure, its a wiki, you can add it, just register (to reduce the spam) and you can add it.
All parser stuff is pretty much blocked by humongous #1263 so who knows when they will happen.
Hmm... I don't like register for only one task :) Maybe it's bad tradition... I will think about it later.
github-comments@lists.geany.org