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
|
WEBVTT
00:00.950 --> 00:03.225
Hello, my name is Dhavan,
00:03.225 --> 00:05.500
also known as codingquark!
00:05.500 --> 00:08.041
I started out learning Emacs
00:08.041 --> 00:12.540
without knowing I had to plug things in
00:12.540 --> 00:13.629
to make it work.
00:13.629 --> 00:14.849
Eventually I had to learn to set up ELPA.
00:14.849 --> 00:16.850
Since then I’ve used MELPA
00:16.850 --> 00:21.030
and Debian apt sources.
00:21.030 --> 00:21.054
Recent discussions about ELPA,
00:21.054 --> 00:21.054
NonGNU ELPA, MELPA, etc.
00:21.054 --> 00:21.054
made me reconsider
00:21.054 --> 00:21.054
what I was doing
00:21.054 --> 00:28.590
with my Emacs.
00:28.590 --> 00:30.887
I am not the kind of person
00:30.887 --> 00:34.290
to mindlessly ram things into my emacs.
00:34.290 --> 00:36.041
I like to ponder,
00:36.041 --> 00:37.500
to understand,
00:37.500 --> 00:40.128
to have a level of control
00:40.128 --> 00:42.069
and mindfulness
00:42.069 --> 00:43.890
about my Emacs.
00:43.890 --> 00:45.730
It is not just a matter
00:45.730 --> 00:47.340
of trying things out,
00:47.340 --> 00:50.909
it is about living an examined life
00:50.909 --> 00:53.387
as the Greeks would say;
00:53.387 --> 00:57.040
or sutta as Buddhists would say.
00:57.040 --> 00:59.860
Such an Emacs is an Emacs worth having.
00:59.860 --> 01:01.414
This pursuit of mine
01:01.414 --> 01:03.710
brought me to learn about borg.
01:03.710 --> 01:05.595
And I am going to share with you
01:05.595 --> 01:06.479
how to use it.
01:06.479 --> 01:09.018
I believe the approach of using borg
01:09.018 --> 01:10.597
for package management
01:10.597 --> 01:12.710
is not for everyone.
01:12.710 --> 01:14.307
It involves knowing git,
01:14.307 --> 01:16.648
it involves looking into source code
01:16.648 --> 01:18.229
and reading makefiles.
01:18.229 --> 01:20.170
Sure, anyone can learn
01:20.170 --> 01:22.617
should they be motivated so,
01:22.617 --> 01:25.740
but people have different priorities.
01:25.740 --> 01:29.056
This is what is working for me right now.
01:29.056 --> 01:32.826
Here is what we are going to do.
01:32.826 --> 01:35.696
We'll set up Debian, install dependencies,
01:35.696 --> 01:39.032
set up borg, install a package,
01:39.032 --> 01:42.090
and make sure it installs all the docs.
01:42.090 --> 01:47.240
Let’s get started!
01:47.240 --> 01:48.342
Would it not be amazing
01:48.342 --> 01:49.560
if we could start out with
01:49.560 --> 01:52.399
just Debian and basic tools?
01:52.399 --> 01:54.848
For borg, we need git,
01:54.848 --> 01:55.916
build-essential,
01:55.916 --> 01:57.384
and something to build docs.
01:57.384 --> 02:00.499
Nothing more!
02:00.499 --> 02:04.658
Now that we have the OS setup,
02:04.658 --> 02:06.226
it is time to clone
02:06.226 --> 02:09.429
what is called a “seed”.
02:09.429 --> 02:11.431
A seed will speed our process up
02:11.431 --> 02:13.379
by providing things like
02:13.379 --> 02:15.500
magit, epkg, auto-compile, etc.
02:15.500 --> 02:20.430
We will soon be using epkg and magit.
02:20.430 --> 02:22.642
The docs cover how to start
02:22.642 --> 02:23.477
without a seed,
02:23.477 --> 02:25.779
but for the purposes of a short demo,
02:25.779 --> 02:27.770
seeds are better.
02:27.770 --> 02:28.682
I started with a seed
02:28.682 --> 02:30.083
for my own dot emacs.
02:30.083 --> 02:32.890
It is fairly slim.
02:32.890 --> 02:33.854
As you can see,
02:33.854 --> 02:35.088
borg uses git URLs
02:35.088 --> 02:37.290
and /not/ HTTPS URLs.
02:37.290 --> 02:38.992
Make sure you have your ssh keys
02:38.992 --> 02:43.989
set up on GitHub, GitLab, etc.
02:43.989 --> 02:45.899
Bootstrapping is like cloning a dot emacs,
02:45.899 --> 02:47.310
but it only comes with a
02:47.310 --> 02:51.400
useful dot git submodules file.
02:51.400 --> 02:54.841
We get a Makefile that has targets
02:54.841 --> 02:57.739
like help and bootstrap-borg.
02:57.739 --> 02:59.880
There will be more targets
02:59.880 --> 03:02.115
after we finish the bootstrapping process.
03:30.110 --> 03:35.582
Then, we need to clone all the git modules,
03:35.582 --> 03:38.310
which is also done by a make target.
03:38.310 --> 03:40.754
This time, it will not just pull
03:40.754 --> 03:42.656
the git submodules,
03:42.656 --> 03:44.658
but will also run various things
03:44.658 --> 03:45.826
like auto-compilation,
03:45.826 --> 03:48.030
Info doc installation, etc.
03:48.030 --> 04:08.680
Good thing we installed texinfo earlier!
04:08.282 --> 04:10.884
Now that we have borg bootstrapped,
04:10.884 --> 04:14.520
let’s see how to “assimilate” a drone.
04:14.520 --> 04:17.090
Well, that’s just a borg way of saying
04:17.090 --> 04:19.900
how to install a new package.
04:19.900 --> 04:22.910
We get to work from inside Emacs now.
04:22.910 --> 04:26.366
Borg has excellent info docs,
04:26.366 --> 04:28.450
should you ever be having questions.
04:28.450 --> 04:32.240
I earlier talked about using a seed.
04:32.240 --> 04:34.830
Borg docs go into details of what that means.
04:34.830 --> 04:40.190
I encourage you to read the docs.
04:40.190 --> 04:51.500
Let’s try to install lsp-mode.
04:51.500 --> 04:52.459
Examining lsp-mode
04:52.459 --> 04:54.694
with epkg’s helper function,
04:54.694 --> 04:57.280
we can see details of the package,
04:57.280 --> 05:00.200
dependencies required, and so on.
05:00.200 --> 05:02.470
epkg uses sqlite database.
05:02.470 --> 05:04.871
Now you know why I installed sqlite
05:04.871 --> 05:12.350
in the OS preparation step!
05:20.820 --> 05:22.622
Well, lsp-mode has
05:22.622 --> 05:24.057
way too many dependencies
05:24.057 --> 05:25.830
for this demo.
05:25.830 --> 05:28.795
Note how one is naturally led
05:28.795 --> 05:32.332
to take a peek at the innards of the packages
05:32.332 --> 05:34.780
in this simple workflow.
05:34.780 --> 05:37.270
As I said, it is about being mindful!
05:37.270 --> 05:39.573
Okay, instead of lsp-mode,
05:39.573 --> 05:41.308
let’s take a look at
05:41.308 --> 05:45.400
Prot’s excellent modus-themes.
05:45.400 --> 05:47.247
No extra dependencies needed.
05:47.247 --> 05:49.870
That is perfect!
05:49.870 --> 05:52.018
The themes have great docs
05:52.018 --> 05:53.620
and our philosopher friend
05:53.620 --> 05:56.000
is good at writing.
05:56.000 --> 06:02.930
Alright, first, we clone the package.
06:02.930 --> 06:04.664
This allows us to inspect the code,
06:04.664 --> 06:06.330
should we want to.
06:06.330 --> 06:23.000
Well, you /should/.
06:23.000 --> 06:25.552
Upon inspecting the code,
06:25.552 --> 06:30.620
we ask borg to assimilate the package.
06:30.620 --> 06:33.927
This will load the code in our Emacs
06:33.927 --> 06:37.270
and make the package available for use.
06:39.799 --> 06:42.135
Wait, I was praising all the docs,
06:42.135 --> 06:43.690
but where are they?
06:43.690 --> 06:44.571
To install the docs,
06:44.571 --> 06:46.273
we need to instruct borg
06:46.273 --> 06:48.020
about where to find them.
06:48.020 --> 06:51.978
To do this, we edit the gitmodules file
06:51.978 --> 06:53.910
and add the details.
06:53.910 --> 06:58.310
There they are!
06:58.310 --> 07:04.170
We have our docs!
07:04.170 --> 07:09.940
Alright, we have assimilated a package.
07:09.940 --> 07:11.398
After sufficient testing,
07:11.398 --> 07:14.234
we can commit it as a part of our own dot emacs,
07:14.234 --> 07:19.272
which is a drone of our borg collective.
07:19.272 --> 07:21.741
Since all the packages are git submodules,
07:21.741 --> 07:23.810
we get to use magit
07:23.810 --> 07:25.245
(all hail magit!)
07:25.245 --> 07:27.514
and borg’s helper functions
07:27.514 --> 07:29.530
to commit the code.
07:29.530 --> 07:31.818
Now create your own dot el file
07:31.818 --> 07:38.758
and hack away!
07:38.758 --> 07:39.793
So that is it.
00:07:39.793 --> 00:07:41.661
I hope you enjoyed the talk
07:41.661 --> 07:45.131
and I will be hanging out in IRC
07:45.131 --> 07:46.666
if you have any questions.
07:46.666 --> 07:48.330
Thank you, and bye.
|