Thank you for the great talk, Niklas.
And yes, the Q&A is now open.
Folks, feel free to post your questions on the pattern IRC.
And after a minute or two, we'll also
open up this big blue button for people
who might prefer to come join Niklas here directly
and ask the questions here.
Niklas, take it away.
All right.
Thank you.
And thanks for having me.
Yeah, maybe I'll go ahead and read some questions
that have popped up in the formula here then.
So the first question is, can it replace SSH plus TMAX
for persistent sessions on remote hosts?
So currently, I would say it does not
support that because it is designed
to only run a single command inside a session.
And when that finishes, it reports back.
But I have played with the idea.
I think it should be possible to do.
But I wanted to start off and polish the experience
with a single command first.
And secondly, there is a question.
I see integration with projectile in the README.
Does it also integrate with project.io?
Yeah, good question.
It doesn't.
I haven't added any explicit support for it
because I typically run detached compiling in the project
root with my own command using project behind the scenes.
But I guess project has a command for it now.
So yeah, it should be very easy to add support for that.
And I could also mention that could be one thing related
to the first questionnaire of using kind of persistent
sessions, that it would be interesting to see if,
for example, I occasionally run Python REPL in Emacs.
And if I could get that one to launch using detach,
so I could restart Emacs and reattach to the REPL
or also use it for situations where I have used the REPL
to, let's say, experiment with, I don't know,
some NumPy function, how that works.
And if I use detach for that, it would automatically
log then the whole session.
And I would have it accessible.
So I could search for it in retrospect
and retrieve the log and see, OK, I ran this command.
This happened, or basically.
So then there is a question.
Can you?
Oh, OK.
I'll read the other one.
No, there is two in there.
It's ongoing.
I'll wait for them.
So the first question is, can you
detach a session from shell mode and reattach
from eshell vterm mode or start a compile in a shell mode
and attach it from compilation mode?
Yeah, so you can attach at the moment
or reattach in shell mode, eshell vterm.
That is no problem.
Currently, I don't have support for attaching in compilation
mode.
So the way the package is built is
that when the session is started,
there is a variable that gets inserted into the session.
And it describes how the session would handle,
for example, attaching to it or viewing the output, et cetera.
But these are the things that I want to primarily focus
in the near future, so making it easier to, for example,
have a buffer up where you're attached to a session.
You could run a key binding to switch
to the view mode of that session.
You get the full output, and then you could view it.
You can switch back to the attached version, which
just shows a brief context and then continues on
with the current output from the session.
Question number four here is, how do you talk to detach?
Could it be feasible to run a child emacs instead
of detach?
Would it make sense?
Better communication, maybe.
So the way the talk with detach is done
is, I would say, very simple.
Detach the program supports basic instructions
like detach dash a to attach, or yeah, that's basically it.
And that is all that's being used under the hood.
And of course, it uses its C flag
to create and attach when a session is started, or the dash
n to start the session in kind of detached mode.
So it runs without emacs being attached to it.
Currently, I don't think I've seen any need for a child emacs
need for better communication.
But if people have ideas about what could be done,
if it was added, yeah, that would be great.
So maybe that could be a follow up
if you got ideas on how to improve it.
Yeah, so I'm not sure if the emacs child, yeah,
I think if I got a better idea about what
the person would like to achieve with it,
then maybe I could understand the question better there.
So another question is, how does it handle processes
that require you to do that?
So processes that require user input,
usually type yes, no, et cetera.
MetaX compiles great, but can't handle user input.
Yeah, so it's very simple behind the scenes.
It depends on what interface you use for attaching emacs
to that process.
So as the person says, if it's MetaX compiled,
then probably it doesn't handle it.
So in that case, I guess I would have started it
from the shell.
If there is a question, you need to type yes or no,
then you can just type it and maybe detach from it.
Or if you end up in a situation where
you started with MetaX compile, but then it has the question,
I guess you could always pop up a shell attached
to the session, and you will get the question there.
You press whatever answer you'd like,
and then detach from that user interface.
So another question is, can you rerun a command session,
but in another directory?
Yeah, you can't do that at the moment.
I haven't really found a need for it.
So typically, as I have been using detach,
now when it has a persistent storage of the sessions,
it becomes rather natural that once I've run it once,
I can just rerun it later in the same directory.
But maybe this is a feature that should be added.
It's maybe a common use case.
One thing that I added on top of the rerun
is like an edit and rerun for those situations
where I maybe run some compilation,
but with the compilation flag set to opt,
and then I want to rerun the exact same command
in the same directory, but with it set to dbg instead
for debugging.
And then instead of pressing R to rerun, I press E.
Then I get a prompt with the current command,
and then I can add it, and it will rerun that.
So maybe something similar for another directory
could be added.
Cool.
I think we still have about 13 or 14 more minutes of live Q&A
time on stream, so if folks do have more questions
about this talk from Nicolas, please
feel free to put them on the pad,
or come join here on the big blue button and ask here.
Yeah.
And I also want to mention that if you realize later
you have a question or a suggestion,
feel free to contact me or create a new post
on the mailing list for the project.
That's much appreciated.
Sounds good.
Yeah.
So then there is a question incoming.
So what are some other places where this might be useful?
And you, for me, fetching that question
is, what are some other places where this might be useful?
And you, for me, fetching mail, get processes started by magic.
What things would you like to see working
in a one to two-year time frame?
Yeah, that's a good question.
I think there are these situations.
One of the things that I ran into yesterday
was that I was trying to use EMMS to connect
to the stream for Emacs Conv.
And that was working fine.
It was using MPV in the background.
But then I did some modifications to my Emacs
and wanted to restart it, and then the stream died.
Kind of those situations where I found it valuable,
I added support for the D-RED R-Sync package,
for example, that I use occasionally
to copy things to a remote server
or from a remote server.
And yeah, that was always something
that I thought could benefit from it.
So I would ideally like to see if it
can be used for more of these processes.
I guess maybe I should get in contact
with some of the devs to see if they have ideas on how this
could be incorporated better with Emacs.
Because so far, it was kind of straightforward
to get it to work with Shell or Compile.
But it hacks around the current implementation
to make it use Detach.
And if I wanted it to be used in many more places,
it feels like it would be maybe not the best way
to have a lot of advices being added to the various functions.
But yeah, definitely, it would be really cool
if that could be worked on properly
so that once I've managed to get the workflow
for its current implementation a little bit more polished,
I will try to look into this and also see what is possible.
I don't know if there are any limitations
with my current approach that I need some more expertise on.
Yeah, so if there is no other questions, I'll
OK, there is another question.
OK, a general topic here.
What are you currently excited about in Emacs?
Well, I'm really excited about the TreeSitter
that was just added to Emacs 29.
I haven't gotten around to use that yet.
But I think it looks very promising.
And I'm a big fan of structural editing
that you can use in Lisp.
So if this opens up the possibility
to be able to use that more in other languages,
that would be really cool.
Otherwise, I'm generally excited about how
the program is developing.
I think there has been a lot of great additions
in these last couple of versions of the program.
So it's cool to see.
And also how the Emacs Conf has been continuing
and being an annual thing and also growing,
adding this new layout with the general track
and development track.
I think it's great.
Thanks.
Yeah, it's been interesting.
Emacs itself, I feel like the Emacs-Devel mailing list
has been growing in traffic over the years.
I've been subscribed for a couple of years.
And more recently, I'm just seeing more and more
incoming emails from Emacs-Devel,
which is always cool.
Yeah, and like you said with Emacs Conf,
yeah, we've been growing, thankfully.
And this year, we've experimented
with having two tracks, which I think
has turned out pretty well, pretty great.
Because we don't have to try to squeeze in all the talks
so tightly and be able to give proper Q&A time,
like this one, I think, which is pretty great.
So yeah, very glad to hear and see it.
Yeah, and maybe I should mention now
that I know that the E-Shell talk is coming up by Howard,
that I discovered there is a kind of a bug
in the detached implementation.
So it doesn't handle properly the way E-Shell
seems to communicate when you quote some text in a shell
command.
If you have been using quotes, it
seems to be added as text properties that
gets into detached.
And I didn't know about that, but detached
is not picking that up.
So if you try to run something similar to Echo
and quotation marks, Niklas, then yeah, it will not
run it with quotation marks.
So I guess for Echo, it might work,
but other commands, it can fail.
So just be aware about that.
I guess that's on the priority list to fix.
Interesting.
Yeah, for sure.
I guess folks can look forward to that getting hopefully fixed
in the near future or at some point.
Yeah, and I could add that maybe something
that is in between this request for persistent sessions
is that currently, you can use detached in a way
so it creates like it runs the session.
And once that finish, you use its callback
to generate a new session, which runs some other command.
So you can chain detached sessions that way.
I wanted to improve on how that has been implemented
so that you can more easily start these changed sessions
and that they would show up in the user interface.
And maybe if you rerun the top of the chain,
it will actually start all these sessions that way.
I have some use cases personally where
for the time being, before running an executable,
I actually need to run a different build command
than I normally do.
And I keep forgetting that, and then that fails.
And it would be great to just be able to.
I mean, you could always have that first command
and then and and the other one, but it doesn't look as nice.
And it would be nice to be able to see that, OK, this has been
this is currently running, but in the next once that's
finished, it will keep on running this one.
So that's something I plan to add support for.
It sounds good.
That would be nice.
Yeah, I would like that as well.
So I have an incentive.
Yeah, also not to completely derail this,
but I mean, I don't think there are any questions as of now.
So I can maybe mention this.
Someone pinged me on IRC.
Well, someone, Shoushin, good friend.
And the creator, actually, of the musics
that we've been using at Emacs Conf between for our lunch
breaks and here and there, he mentioned
that he likes this FSF shirt.
Yeah, it's nice.
Thanks.
Yeah, it's I think from a year or so ago.
It was put up for FSF's 35th birthday.
And yeah, it's also what it says, FSF 35.
Yeah, I'm not sure if it's still available on their shop,
but yeah, you might be able to find it there.
Nice.
So they have their own shop?
Yeah, so there is.
You can buy merch or?
Yeah, exactly.
There is shop.fsf.org, and they have
a bunch of different goodies and things, merchandise.
They have shirts like this one, but they also
have a lot of other stuff.
They have this one, but they also
sell things like printed versions of the Emacs user
manual, which is particularly relevant for us.
Yeah, and Emacs stickers.
I think also sell pins and such.
So yeah, I mean, if you are interested in Emacs
or new on FSF, it might be worth checking out.
Yeah, thanks for the tip.
Yeah.
Cool, and I think we have about one more minute of live Q&A
time if folks have any questions,
any last-minute ones, you're welcome to send it in.
I guess there is, uh-huh.
OK, yeah, this one got added from Karfik.
Yeah.
Yeah, otherwise, if there's no further questions,
maybe we wrap it up.
Sure, sounds good.
Yeah, I don't see any new questions.
So yeah, thanks again, Nicholas, for the great talk
and for sticking around and doing the live Q&A.
It's much appreciated, and look forward
to seeing the upcoming developments in Detached.
Thank you, and thanks for having me.
Cheers, very glad to see you around.
See ya.