[Speaker 0]: And I think we are live.
Hello again, everyone.
And hi, Lovro. How are you doing?
[Speaker 1]: Just a second. Should I join the other room?
[Speaker 0]: Oh, no, no, you can stay here.
[Speaker 1]: I can stay in the backstage.
[Speaker 0]: Everything is fine. I don't think you are
technically in the backstage right now you're
just in Big Blue Button with us.
[Speaker 1]: Oh thanks. Oh because I have 2 of them open I
thought there were 2 different rooms.
1 is the backstage and the other,
[Speaker 0]: whichever, I can hear you and so can the
stream, so don't worry too much about which
is the backstage and which is the front page.
[Speaker 1]: I have no idea. Well, great,
great. Okay, yeah. Yeah,
I'm doing great, just to answer your
question.
[Speaker 0]: Okay, great, great, Okay,
well splendid. So, I've pasted a link again
on IRC if you want to ask your questions,
and I'd invite you to do so,
because we have about 9 minutes of laborious
time to answer as many of them as possible.
And I'm going to start with the first 1.
This looks great and was very well-presented.
Do you have plans to upstream this
functionality into Emacs?
[Speaker 1]: That's a good idea. That's something we
thought about as well.
Currently, we haven't really contacted anyone
to do this. Also, the current implementation,
so as I mentioned in the presentation towards
the end, so we use a little bit of advice to
sort of patch some functionality of query
replace because not everything was easy to
implement. The core functionality luckily
was, But there's a couple of fixes we need to
apply to the message function in order to
display a nice message in the echo buffer
because this doesn't happen on its own when
we're using this trick with this big regex
and whatnot. So I don't think that the code
as it is would be upstreamable.
I think probably if we wanted to upstream it,
we would have to do some proper work on
refactoring query place itself in order to
integrate all of this functionality just
directly without any patching left and right.
But yeah, definitely something I've given
some thought, but so far no progress on it.
I haven't actually started doing anything
about it.
[Speaker 0]: Right, So I'm curious now,
you developed the feature and then you moved
on to the presentation or did you want to do
a presentation for EmacsConf and then you
worked on something like this?
Which was it first, the chicken or the egg?
[Speaker 1]: Yeah, it was the former.
So this is a problem I've been aware of for,
I mean, probably a couple of years.
And, you know, I talked to my friend
Valentino about it and we had like a little
discussion, you know, how would we do this?
And then I remember back when I was
researching about this problem and the
various Emacs Lisp solutions,
all I could find were these solutions that
would, you know, just shy away from
implementing the RegEx case,
which is a really complicated 1.
And, after some discussion,
my friend and I decided,
okay, what the hell? Let's,
let's try and implement this.
How hard can it be? And yeah,
basically in 1 afternoon,
the idea, our little trick and the whole
implementation was born.
And then I think that was maybe around a year
ago, maybe a bit less.
And then through the months,
we just thought, oh yeah,
maybe we could present this,
maybe it would be interesting for people to
see and that's how we came up with the idea
to present at EmacsConf.
[Speaker 0]: Okay, great. I don't see other people asking
questions. So people, it's nice if I ask
questions but you know,
the point is kind of for you to ask the
questions. I see someone who's joined us on
BBB. Peter, would you like to ask a question
maybe? Otherwise I see another person writing
a question on the pad,
so we can either move for this 1.
So I'll leave Peter to figure out if they
want to ask a question.
So I'm moving on to the next question.
[Speaker 2]: I can jump in. That's a really well done talk
and you really clearly laid out the problem
and the solution there.
While I was watching it,
I was thinking maybe the nice way to name it
is just to name it query replace and query
replace regext, you know,
overloading the original functions and then
using a prefix number,
like control number to indicate how many
replacements you're going to do.
But maybe that doesn't work with the
recursive editing stuff,
which I don't use much.
So I don't have a good method.
[Speaker 1]: I think it would definitely work.
Well, the question is,
if we just overwrite the definitions,
then, oh, well, I guess we could do that.
Nothing stops us. I mean,
we're in Emacs. We could definitely do that.
And then if you give, like,
a prefix argument, maybe it just drops you
back to the original query replace.
Yeah, that's an idea. For now,
we decided, OK, let's just keep everything
explicitly separate just to avoid any
confusion.
[Speaker 2]: Yeah, I think that's the right thing to do
for now. What I'm actually thinking is that
when you do query replace,
it just does the regular query replace.
And if you're going to do,
say, 3 parallel replacements,
then you do Control-U,
query replace. Sorry. Control-3,
query replace. And then that way you don't
have The final prompt that you give nothing
to.
[Speaker 1]: Exactly, that's actually not a bad idea.
I think I like that. Yeah,
that's not a bad idea.
[Speaker 0]: It's always a quagmire whether to ask for an
argument or to use the universal argument.
When you're working with Emacs and especially
the UX side of things in the package,
it's so complicated to figure out which 1 you
want to do. In this particular case,
I think it's the better option to use the
universal argument or any kind of argument
with a control number before.
All right, we have about 3 more minutes of
questions. Peter, if you don't mind,
I'll keep reading the questions in the chat.
Did you use pair programming while developing
it, it being a package,
or did you work independently,
alternating and reviewing with Valentino?
[Speaker 1]: It was definitely a pair programming kind of
thing. So if I remember correctly,
I was sitting at the computer and Valentino
was in front of a whiteboard and we were just
dissecting this regex and a bunch of examples
and trying to get these capture groups and
stuff that we have to remap internally to get
these offsets right and avoid off by 1 error
and stuff like that. So yeah,
definitely a team effort.
[Speaker 0]: Okay, great. Moving on to the next question.
What is your background in programming?
Was it difficult to implement following the
same API and architecture as what is already
in Emacs?
[Speaker 1]: So maybe just a quick back story.
Both Valentino and I are actually PhD
students in computer science,
and we literally share an office.
So that's how we even started talking about
this whole thing. And we both use Emacs,
of course. But I don't think this was too
hard to implement because luckily all of the
interactive functionality like this
complicated undo, skipping,
execute until the end and so on,
all of this is really just already provided
by the Emacs queer replace implementation.
So sort of what we do is we just invoke it as
a function and delegate to it.
And we came up with this clever trick to
basically delegate this multi-replacement to
this 1 single function that's already there.
So it wasn't too complicated.
[Speaker 0]: Alright. And we have about 2 minutes of time
for the last question.
What did you learn about Emacs programming or
programming in general while working on this
project? A very wide question for me.
[Speaker 1]: Maybe 1 thing I would like to add to the
previous just answer is I don't want to say
like you know we're PhDs,
a PhD is required for this or anything,
not at all. It's mostly just for a little bit
of context, but I think obviously,
even if you're not a PhD,
I mean, you don't even require like
university, you know, education or anything.
It wasn't overly difficult to implement,
sort of just read some code that's already
there and you know follow what you see and
poke Emacs a little bit and do a little bit
of debugging on the internals and you can
definitely get it. So definitely not a
prerequisite to have a degree or anything to
do any of this stuff. Okay so Coming back to
[Speaker 0]: Yeah, I'm going to amend a little bit the
question because we only have 1 minute.
So just 1 thing in 10 seconds,
[Speaker 2]: what did you
[Speaker 0]: learn about this?
[Speaker 1]: your last question. What did I learn about
Emacs programming? That Emacs is so flexible
that I can go and I can patch literally its
message function. And that is how we achieve
the nice message function in the echo buffer.
So I can literally go and patch something as
crucial as message.
[Speaker 0]: It's great. That's a lovely 1.
And I think, again, we're going back to the
philosophy of Emacs. Everything is
programmable and even changing the message
function is great. All right,
well, thank you so much,
Lovro, and thanks to Valentino as well,
who's not here, but who's contributed to this
talk. Any last word?
[Speaker 1]: Well, just if you're gonna build any
solutions, try to make them as foolproof and
as 100% as possible so we get more of these
goodies that are nice and robust for
everybody to use.
[Speaker 0]: All right, lovely. Well,
thank you so much, Lover,
for your presentation and your answer.
We'll be moving on to the next talk in just
about 5 seconds, and I'll see you after.
Bye, Lovro!
[Speaker 1]: Yep, bye bye!
[Speaker 0]: So I'm just waiting to make sure my VNC is a
little slow. Okay, we switch to the next
talk. All right, Lover,
I'm gonna need to go get ready now.
Yep. Bye-bye, and thanks for your talk.
[Speaker 1]: Bye, thank you, see you.
[Speaker 2]: You