~shugyousha

~shugyousha/public-inbox

Last active 4 years ago
View more

Recent activity

Re: [PATCH vis] complete-filename: speed-up the tilda handling 10 days ago

From Silvan Jegen to ~martanne/devel

Matěj Cepl <mcepl@cepl.eu> wrote:
> When profiling (on 100,000 calls) with this test:
> 
> ```lua
> start_t = os.clock()
> for i = 1, 100000 do
>     _ = home .. prefix
> end
> end_t = os.clock()
> print(end_t - start_t)
> ```
> 
> I get on my computer this (warm):
> 

Re: [PATCH vis] complete-filename: complete tilda as $HOME as well 30 days ago

From Silvan Jegen to ~martanne/devel

Matěj Cepl <mcepl@cepl.eu> wrote:
> On Sun Jan 19, 2025 at 12:18 PM CET, Silvan Jegen wrote:
> >> References: https://github.com/martanne/vis/pull/1148#issuecomment-1792649763
> >
> > With this patch applied, doing <C-x><C-o> expands the tilde character to $HOME.
> > Not sure why it doesn't do the same when typing <C-x><C-f> but either way this
> > LGTM!
> 
> See the discussion on the referred GitHub pull request, I believe
> this is the correct way how to do it, and certainly it is the way
> it more matters to me, because <C-x><C-o> is bound to <TAB> in
> `:open` prompt [1], so `~` is thus expanded there.

Works for me as well! :) Thanks for the explanation!

Re: [PATCH go-jmap] client: lock mutex after calling Authenticate when uploading/downloading a month ago

From Silvan Jegen to ~rockorager/go-jmap-devel

"Tim Culverhouse" <tim@timculverhouse.com> wrote:
> On Mon Jan 6, 2025 at 3:21 PM CST, Silvan Jegen wrote:
> > Thanks for your input! I am learning a lot about the JMAP protocol,
> > which was one of my motivations to look at the code :)
> 
> I went ahead and applied this patch as is. I think the larger picture
> about the API usage is still a question, but that isn't a reason to
> hold up this one :)

Yes, that seems reasonable! I may have more valuable input if I get
around actually using the library as well.

Re: [PATCH go-jmap] client: lock mutex after calling Authenticate when uploading/downloading a month ago

From Silvan Jegen to ~rockorager/go-jmap-devel

"Tim Culverhouse" <tim@timculverhouse.com> wrote:
> > Silvan Jegen <s.jegen@gmail.com> wrote:
> > AFAICT the locking dance we have to do in the client is only necessary
> > because we allow Authenticate to be called in so many places.
> >
> > I wonder if it wouldn't be better to just introduce a `NewClient()
> > (*Client, error)` function that returns an authenticated client with a
> > valid session (or an error).
> 
> In JMAP, each request returns the state string of the session object. I've found

I wasn't aware of this state string! I have read up a bit about it and
from what I understand, some of the API response objects also return
the session state, which then can be used to "... quickly determine if

Re: [PATCH go-jmap] client: lock mutex after calling Authenticate when uploading/downloading a month ago

From Silvan Jegen to ~rockorager/go-jmap-devel

Silvan Jegen <s.jegen@gmail.com> wrote:
> This makes sure we don't end up Unlocking an unlocked mutex while
> also covering the critical section where we access the Session's
> Upload/Download URLs.

AFAICT the locking dance we have to do in the client is only necessary
because we allow Authenticate to be called in so many places.

I wonder if it wouldn't be better to just introduce a `NewClient()
(*Client, error)` function that returns an authenticated client with a
valid session (or an error).

This would allow us to get rid of all the locking since the session will
always be there, valid and read-only.

Re: [PATCH vis] fix: correct URL of the Busted Lua unit testing framework. a month ago

From Silvan Jegen to ~martanne/devel

Matěj Cepl <mcepl@cepl.eu> wrote:
> ---
>  test/lua/README.md | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/test/lua/README.md b/test/lua/README.md
> index 5b9a1e6f..21a63fb5 100644
> --- a/test/lua/README.md
> +++ b/test/lua/README.md
> @@ -1,7 +1,7 @@
>  Unit Test for Vis' Lua API
>  --------------------------
>  
> -The tests use the [busted unit testing framework](https://olivinelabs.com/busted/).

Re: [PATCH v2] lua: allow changing the displayed file of a window 9 months ago

From Silvan Jegen to ~martanne/devel


Heyhey!

On May 8, 2024 2:51:47 PM GMT+02:00, Randy Palamar <randy@rnpnr.xyz> wrote:
>Florian Fischer <florian.fischer@muhq.space> wrote:
>> Hey Randy,
>> 
>> > I'm not against this but I'm a little confused as to how this is
>> > different from ":e". Is it because the window is not usable in the
>> > `FILE_OPEN` event (and/or why can't you use ":e" in your plugin)?
>> 
>> No problem. In your defense I did not explain the issue with the straight
>> forward attempt to implement the plugin in the first place.

Re: [PATCH v2] lua: allow changing the displayed file of a window 9 months ago

From Silvan Jegen to ~martanne/devel

Florian Fischer <florian.fischer@muhq.space> wrote:
> Change the file displayed in a window by writing the new file name
> to the window's file member.
> ---
> v2: remove strdup call
> 
>  vis-lua.c |  3 +++
>  vis.c     | 11 +++++++++++
>  vis.h     |  2 ++
>  3 files changed, 16 insertions(+)

LGTM!

Cheers,

Re: [PATCH] allow lua to change a windows file 9 months ago

From Silvan Jegen to ~martanne/devel

Florian Fischer <florian.fischer@muhq.space> wrote:
> > Florian Fischer <florian.fischer@muhq.space> wrote:
> > > ---
> > >  vis-lua.c |  3 +++
> > >  vis.c     | 11 +++++++++++
> > >  vis.h     |  2 ++
> > >  3 files changed, 16 insertions(+)
> > > 
> > > diff --git a/vis-lua.c b/vis-lua.c
> > > index 4d783c5d..cb328b66 100644
> > > --- a/vis-lua.c
> > > +++ b/vis-lua.c
> > > @@ -2058,6 +2058,9 @@ static int window_newindex(lua_State *L) {
> > >  			}

Re: [PATCH] allow lua to change a windows file 9 months ago

From Silvan Jegen to ~martanne/devel

Heyhey!

Florian Fischer <florian.fischer@muhq.space> wrote:
> ---
>  vis-lua.c |  3 +++
>  vis.c     | 11 +++++++++++
>  vis.h     |  2 ++
>  3 files changed, 16 insertions(+)
> 
> diff --git a/vis-lua.c b/vis-lua.c
> index 4d783c5d..cb328b66 100644
> --- a/vis-lua.c
> +++ b/vis-lua.c
> @@ -2058,6 +2058,9 @@ static int window_newindex(lua_State *L) {