summaryrefslogblamecommitdiffstats
path: root/2021/captions/emacsconf-2021-nyxt--emacs-with-nyxt-extend-your-editor-with-the-power-of-a-lisp-browser--andrea--main.vtt
blob: d595fc1b0ddb560f256e222583f4d45e51130c1d (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532



















































































































































































































































































































































































































































































































































                                             
WEBVTT

00:00.000 --> 00:01.783
Welcome to my talk "Emacs with Nyxt:

00:01.783 --> 00:02.823
extend your editor with

00:02.823 --> 00:04.623
the power of a Lisp browser".

00:04.623 --> 00:06.583
Who am I? I'm Andrea. I work as

00:06.583 --> 00:08.303
a Clojure software engineer somewhere

00:08.303 --> 00:09.743
in the middle of the UK.

00:09.743 --> 00:11.743
And I inherited my passion for Emacs

00:11.743 --> 00:13.703
from my Ph.D. supervisor, and from that

00:13.703 --> 00:15.943
moment on Emacs became a core tool

00:15.943 --> 00:17.863
of my daily routine.

00:17.863 --> 00:20.863
You can find more about me and my interests

00:20.863 --> 00:23.983
at ag91.github.io, that is my blog.

00:23.983 --> 00:25.183
Let's get into the talk.

00:25.183 --> 00:28.183
So, why Nyxt? Nyxt is an extensible

00:28.183 --> 00:29.543
Common Lisp browser.

00:29.543 --> 00:31.903
Fundamentally, it's Emacs for web browsing.

00:31.903 --> 00:34.063
And why do I say that? I say that

00:34.063 --> 00:36.063
because is a…, this is Nyxt.

00:36.063 --> 00:40.223
You can see that is organized with buffers,

00:40.223 --> 00:44.063
and you can see that I can invoke command,

00:44.063 --> 00:47.183
like, I was in Emacs with this.

00:47.183 --> 00:48.983
So, I'm using even the same keybindings,

00:48.983 --> 00:52.783
so, for that I used M-x.

00:52.783 --> 00:55.983
And some of the features of Nyxt

00:55.983 --> 01:00.103
are just amazing. For example, say that

01:00.103 --> 01:03.823
you want to mark some text, this is the way,

01:03.823 --> 01:08.703
so, I just pressed Control space (C-SPC),

01:08.703 --> 01:10.423
and now I will start the marker,

01:10.423 --> 01:13.223
and now I can copy the text, and when

01:13.223 --> 01:15.663
I'm done, I can finish to use visual mode.

01:15.663 --> 01:18.023
Or, for example, what about…,

01:18.023 --> 01:21.183
I want to navigate without using my mouse.

01:21.183 --> 01:25.183
I can do something like follow-hint,

01:25.183 --> 01:28.023
and this opens the possibility to press

01:28.023 --> 01:29.903
AC to jump on the Articles,

01:29.903 --> 01:33.063
and all of a sudden I'm on the page

01:33.063 --> 01:36.023
with the blog posts of the Atlas team.

01:36.023 --> 01:39.383
Or, for example, I can extend my browser

01:39.383 --> 01:40.783
from within the browser.

01:40.783 --> 01:43.223
So, you can see I can evaluate a command,

01:43.223 --> 01:48.663
a Common Lisp code,

01:48.663 --> 01:50.903
and it produces the result.

01:50.903 --> 01:56.183
And then, for example, I can also auto….

01:56.183 --> 01:58.663
This browser comes by default with an

01:58.663 --> 02:01.143
integration with your password manager,

02:01.143 --> 02:04.223
in my case it's pass, and I can copy

02:04.223 --> 02:08.783
a password. This is just as easy as is,

02:08.783 --> 02:10.543
it comes by default.

02:10.543 --> 02:13.583
Another incredibly useful feature

02:13.583 --> 02:18.023
that I didn't find in other browsers is

02:18.023 --> 02:20.503
searching between multiple buffers.

02:20.503 --> 02:23.503
So, this function search-buffers,

02:23.503 --> 02:25.823
this command lets me select

02:25.823 --> 02:29.503
some of my open buffers,

02:29.503 --> 02:32.503
and I can look for a string in there.

02:32.503 --> 02:34.623
And you would see that the hits are

02:34.623 --> 02:37.423
from the buffers that I have open,

02:37.423 --> 02:42.583
for example, Clojure or

02:42.583 --> 02:46.103
the YouTube video about Clojure.

02:46.103 --> 02:49.623
Let me get into something very interesting.

02:49.623 --> 02:52.783
How can I make Emacs speak to Nyxt.

02:52.783 --> 02:55.103
And for that, let me show you something

02:55.103 --> 02:57.143
in the literate programming approach.

02:57.143 --> 03:00.183
So, this Org mode source block is

03:00.183 --> 03:04.423
linked to this Nyxt REPL.

03:04.423 --> 03:06.983
I can define a new command,

03:06.983 --> 03:09.343
and when I go in Nyxt,

03:09.343 --> 03:10.863
I can find this new command,

03:10.863 --> 03:12.503
and I can invoke it, and you can see

03:12.503 --> 03:16.943
there is something in the minibuffer.

03:16.943 --> 03:21.543
I can use it from Nyxt, but I can do it here.

03:21.543 --> 03:24.703
I can also use it directly from the REPL.

03:24.703 --> 03:27.743
You can see that the same thing is logged

03:27.743 --> 03:30.423
in the REPL.

03:30.423 --> 03:32.663
And then with something that I would speak

03:32.663 --> 03:36.423
about in another talk in the conference

03:36.423 --> 03:39.143
— Moldable Emacs. I can also just

03:39.143 --> 03:42.823
evaluate JavaScript outside. Let's create

03:42.823 --> 03:46.703
a playground that allows me to write some

03:46.703 --> 03:49.903
JavaScript code. And if I evaluate this code,

03:49.903 --> 03:52.023
I get the title of the webpage

03:52.023 --> 03:54.583
that is currently open in Nyxt.

03:54.583 --> 03:58.343
The cool thing is that I can do it also

03:58.343 --> 04:02.263
directly in Lisp, this is Parenscript

04:02.263 --> 04:05.223
that evaluates to the same thing,

04:05.223 --> 04:07.823
(it) is just the same, just document.title,

04:07.823 --> 04:10.743
only that is in Common Lisp.

04:10.743 --> 04:14.343
You see that Emacs can speak to Nyxt,

04:14.343 --> 04:16.103
but also the reverse is true.

04:16.103 --> 04:19.023
Nyxt can speak to Emacs. So, for example,

04:19.023 --> 04:21.943
if I'm in Nyxt, and for example,

04:21.943 --> 04:26.623
let me go to my blog, if I press here,

04:26.623 --> 04:30.863
this is an email link, automatically in Emacs

04:30.863 --> 04:33.943
it will let me compone a message

04:33.943 --> 04:35.943
using my email manager.

04:35.943 --> 04:39.823
Or, say that always in my blog I want

04:39.823 --> 04:43.543
to write something here in the searchbar,

04:43.543 --> 04:46.303
I think that I don't want to write it in

04:46.303 --> 04:50.623
the browser but in my Emacs because

04:50.623 --> 04:52.903
I have some template for search.

04:52.903 --> 04:55.503
If I do this, all of a sudden

04:55.503 --> 04:59.103
the text is added.

04:59.103 --> 05:03.423
Or say I'm watching that Clojure video,

05:03.423 --> 05:06.343
and I get to this point, and then I say

05:06.343 --> 05:09.703
"Yuu! This is a very interesting thing,

05:09.703 --> 05:12.783
let me take a note". So, I take some note

05:12.783 --> 05:16.903
with some text, and if I go back in Emacs,

05:16.903 --> 05:19.023
tadam! I found the note,

05:19.023 --> 05:21.903
and I found it with the duration,

05:21.903 --> 05:25.063
so I can just jump to the same point.

05:25.063 --> 05:28.743
And what else?

05:28.743 --> 05:31.903
There is something even bigger

05:31.903 --> 05:32.663
that we can do,

05:32.663 --> 05:34.063
this is a bit more advanced,

05:34.063 --> 05:35.823
and this is something that I do

05:35.823 --> 05:39.023
again with my Moldable Emacs.

05:39.023 --> 05:41.183
Say that you want to do some

05:41.183 --> 05:43.223
data visualization.

05:43.223 --> 05:44.863
If we use Vega-Lite…, for example,

05:44.863 --> 05:47.823
we want to visualize a scatter plot.

05:47.823 --> 05:49.623
Let me take some example data

05:49.623 --> 05:52.423
that could be interesting also to you.

05:52.423 --> 05:55.063
So, say that I have this playground

05:55.063 --> 05:57.263
that lets me evaluate

05:57.263 --> 06:01.703
some query on my Org-roam database.

06:01.703 --> 06:03.663
What I'm doing here is I'm gonna

06:03.663 --> 06:05.703
go through my first 100 notes

06:05.703 --> 06:09.823
and collect their backlinks,

06:09.823 --> 06:13.183
so some information that I find interesting.

06:13.183 --> 06:16.343
If I convert this to JSON,

06:16.343 --> 06:18.903
now, all of a sudden this is something

06:18.903 --> 06:22.623
that I can put in that Vega-Lite template

06:22.623 --> 06:26.183
that I showed you a moment ago.

06:26.183 --> 06:28.343
So, I'm gonna find out that file,

06:28.343 --> 06:30.463
you see that I left a question mark,

06:30.463 --> 06:31.703
(this is) something that I still

06:31.703 --> 06:33.783
didn't automate completely.

06:33.783 --> 06:37.983
By saving this file and opening it with Nyxt,

06:37.983 --> 06:41.183
you can see that now I have a scatter plot.

06:41.183 --> 06:43.943
And these are my actual notes,

06:43.943 --> 06:48.343
so you can see that if I stay on it,

06:48.343 --> 06:53.063
these are actually my notes.

06:53.063 --> 06:55.343
When I'm in Emacs, what I can do is

06:55.343 --> 06:58.303
I click here, and now in the background

06:58.303 --> 07:00.903
it opened my note,

07:00.903 --> 07:04.303
and it opened with all my backlinks.

07:04.303 --> 07:07.703
You can see that I have embedded in my

07:07.703 --> 07:11.303
browser some functionality of Emacs.

07:11.303 --> 07:13.463
You understand that this is the power of

07:13.463 --> 07:16.983
unifying, integrating these two experiences,

07:16.983 --> 07:18.943
and it opens the doors for

07:18.943 --> 07:22.223
a lot of interesting interactivity.

07:22.223 --> 07:24.743
Anyway, what is next?

07:24.743 --> 07:29.023
This was my talk, what is next is

07:29.023 --> 07:32.143
continue merging it with Moldable Emacs.

07:32.143 --> 07:34.023
(This) is something I will present in

07:34.023 --> 07:37.463
another talk in this conference with web,

07:37.463 --> 07:39.263
so that we can extract meaning from

07:39.263 --> 07:41.103
the web, and we can bring it in Emacs.

07:41.103 --> 07:43.583
And from Emacs bringing back stuff

07:43.583 --> 07:46.543
like a picture into a web page,

07:46.543 --> 07:48.903
so that we can do fancy visualization.

07:48.903 --> 07:51.063
Another thing I want to do is to

07:51.063 --> 07:54.263
automate the boring browser flows

07:54.263 --> 07:55.543
that I do, like, for example,

07:55.543 --> 07:58.263
if I periodically buy something,

07:58.263 --> 08:00.863
I could do it from within Emacs

08:00.863 --> 08:05.263
instead of always clicking around.

08:05.263 --> 08:08.383
And then I'm just gonna cross fingers,

08:08.383 --> 08:10.023
I hope that this browser will

08:10.023 --> 08:11.783
become mainstream.

08:11.783 --> 08:13.263
So, this was my talk,

08:13.263 --> 08:14.663
thank you for listening,

08:14.663 --> 08:17.343
and you can find more about it at

08:17.343 --> 08:19.823
ag91.github.io, my blog,

08:19.823 --> 08:22.680
and enjoy the rest of the conference, bye!

08:22.680 --> 08:25.520
[captions: bhavin192 (Bhavin Gandhi)]