Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-29 Thread Skif-off
@elextr >>> Its any name known to your system iconv, so its system specific, Geany has >>> some common names in its menus, but in fact even those are not guaranteed >>> to be available. >> Thanks, here it is necessary to think. > As far as we know there is no programmatic way of getting a

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-29 Thread elextr
> > Its any name known to your system iconv, so its system specific, Geany has > > some common names in its menus, but in fact even those are not guaranteed > > to be available. > Thanks, here it is necessary to think. As far as we know there is no programmatic way of getting a list of the

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-29 Thread Skif-off
@elextr > Its any name known to your system iconv, so its system specific, Geany has > some common names in its menus, but in fact even those are not guaranteed to > be available. Thanks, here it is necessary to think. > The project does not package Geany for any distros, its done by external

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-28 Thread Matthew Brush
> P.S. geany.reloadconf (like geany.reload_configuration() from GeanyPy) may be > of interest... You should make separate pull requests for the above patches if you want to get them merged. That plugin doesn't have a dedicated maintainer, so making it easy on committers will give you a better

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-28 Thread elextr
> If I want to add forced_enc, then where I can to find list of them and how to > use? GEANY_ENCODING_* from encodings.h or strings from encodings.c? (I didn't > find examples.) Its any name known to your system iconv, so its system specific, Geany has some common names in its menus, but in

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-28 Thread Skif-off
1. If I want to add [forced_enc](https://www.geany.org/manual/reference/document_8h.html#aaae9e8e045dbed0ee86751071c4eaa50), then where I can to find list of them and how to use? ```GEANY_ENCODING_*``` from [encodings.h](https://github.com/geany/geany/blob/master/src/encodings.h) or strings

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-23 Thread Skif-off
@codebrainz maybe you'll make a PR? As part of the development team :) -- 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-plugins/issues/646#issuecomment-346721257

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-23 Thread Matthew Brush
Something like this: ```diff diff --git a/configure.ac b/configure.ac index 7fb7d402..fa3bf5a2 100644 --- a/configure.ac +++ b/configure.ac @@ -9,6 +9,7 @@ AC_CONFIG_SRCDIR([po/POTFILES.in]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([build/cache]) +AC_USE_SYSTEM_EXTENSIONS AC_PROG_CC

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-23 Thread Matthew Brush
@Skif-off yeah, I saw that warning, but it's just a deprecation warning. Proper fix would be for GeanyLua to use build system to check for `stat()`/`lstat()` and let autotools handle defining such macros as needed for the proper versions, IMO. -- You are receiving this because you are

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-23 Thread Skif-off
@codebrainz Yes, both variant works fine. Only one warning: ``` CC libgeanylua_la-glspi_app.lo In file included from /usr/include/x86_64-linux-gnu/sys/stat.h:25:0, from glspi_app.c:8: /usr/include/features.h:183:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-23 Thread Matthew Brush
This also works: ```diff diff --git a/geanylua/glspi_app.c b/geanylua/glspi_app.c index ed82d5eb..23818170 100644 --- a/geanylua/glspi_app.c +++ b/geanylua/glspi_app.c @@ -418,11 +418,11 @@ static gint glspi_launch(lua_State* L) gchar **argv=NULL; gboolean rv; GError

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-23 Thread Matthew Brush
@Skif-off try this: ```c argv=g_malloc0_n(argc + 1u, sizeof(gchar *)); ``` -- 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-plugins/issues/646#issuecomment-346596722

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-23 Thread elextr
or set option `-Wno-alloc-size-larger-than` -- 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-plugins/issues/646#issuecomment-346592130

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-23 Thread Skif-off
Maybe I'd better use gcc-6 (6.4.0) or gcc-5 (5.5.0)? -- 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-plugins/issues/646#issuecomment-346591446

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-23 Thread Skif-off
I tried ```argv = g_malloc0_n(argc+1, sizeof(gchar*));``` and I have: ``` glspi_app.c: In function ‘glspi_launch’: glspi_app.c:425:7: warning: argument 1 range [18446744071562067969, 18446744073709551615] exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=] argv =

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-21 Thread elextr
> I believe it will allocate room for the needed pointers plus one byte. @codebrainz good catch. Luckily for any geanylua users the allocated memory is likely to round up to a multiple of a pointer anyway for alignment reasons. -- You are receiving this because you are subscribed to this

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-21 Thread Matthew Brush
> Thats why its a stupid warning (or at least stupid to enable by default) > because many system interfaces use int as a counter (like argc) and everybody > knows they are never negative To be fair, it's not the _actual_ `argc`, it's a random value popped off the Lua stack, it could be

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-20 Thread elextr
For your own stuff sure. -- 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-plugins/issues/646#issuecomment-345944098

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-20 Thread Skif-off
Can I just ignore this warning? :) -- 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-plugins/issues/646#issuecomment-345943938

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-20 Thread Skif-off
@elextr ```gchar **argv=NULL;``` >>> ```guchar **argv=NULL;```? Is everything will be fine if I just ignore this warning? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-20 Thread elextr
You have items of mixed signedness in the expression. This is IIRC a fairly new stupid warning. To shut it up just cast argc to an unsigned type. The nightly probably uses a compiler thats older than the stupid warning. -- You are receiving this because you are subscribed to this thread.

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-19 Thread Skif-off
@frlan >But ... I prefer PR with an updated MAINTAINERS file too ;) Sorry, it's too cool for me :) And I found a workaround: ```lua local t = geany.fileinfo(); geany.newfile("UNTITLED" .. t.ext); ``` (but untitled document would be more convenient because it's obvious). Well, I do not want

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-19 Thread Frank Lanitz
@elextr @Skif-off Why not? But not before 1.32 and I prefer PR with an updated MAINTAINERS file too ;) -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-19 Thread Skif-off
Hmm, seems to work work fine and I think I fixed two warnings... Make PR? -- 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-plugins/issues/646#issuecomment-345503683

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-18 Thread elextr
Ok, you can do it if you extend your own Geanylua. And since its unowned, why not :) You C cod is passing a string as the filetype, it should be a pointer to the filetype structure, use

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-18 Thread Skif-off
I tried to use ```glspi_newfile``` [mod](https://github.com/geany/geany-plugins/issues/646#issuecomment-345476945), but Geany crash with error >(geany:3157): Geany-CRITICAL **: filetypes_load_config: assertion 'ft_id < >filetypes_array->len' failed Need to think. -- You are receiving this

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-18 Thread elextr
> > a normal plugin would use document_set_filetype() but I don't know if its > > available in the restricted Geanylua API. > "normal" plugin? :) By a "normal" plugin I mean one that uses the standard Geany plugin API, C, C++, Cython, anything else that accesses C and compiles to a `.so` for eg

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-18 Thread Skif-off
@elextr >a normal plugin would use document_set_filetype() but I don't know if its >available in the restricted Geanylua API. "normal" plugin? :) I use local [geanylua-ref.html](https://github.com/geany/geany-plugins/blob/master/geanylua/docs/geanylua-ref.html). Also I tried to find

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-18 Thread Frank Lanitz
Unlikely if no more adopt 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-plugins/issues/646#issuecomment-345449239

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-18 Thread elextr
Since the Geanylua documentation seems to be absent on the web I can't really help you, a normal plugin would use [`document_set_filetype()`](https://www.geany.org/manual/reference/document_8h.html#a7a2f2bfa1c9fe7d9472466e895c251f6) but I don't know if its available in the restricted Geanylua

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-18 Thread Skif-off
How can I do this? I found ```geany.fileinfo()``` with fields ```type``` & ```desc``` and nothing more. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-17 Thread elextr
You should not set the lexer directly, set the Geany filetype instead. -- 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-plugins/issues/646#issuecomment-345417127

[Github-comments] [geany/geany-plugins] [geanylua] geany.scintilla() does not work with SCI_SETLEXER (#646)

2017-11-17 Thread Skif-off
I added small script: ```lua --[[ Copy selected text to new tab 2017.11.18 --]] local s = geany.selection(); if (s == "") then geany.message("No text is selected!"); elseif (s == nil) then geany.message("There is no open document!"); else --SCI_GETLEXER local l =