-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
3640 lines (3131 loc) · 279 KB
/
index.html
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
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2023-09-05 Tue 02:09 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>‎</title>
<meta name="author" content="Jeet Ray" />
<meta name="generator" content="Org Mode" />
<link rel="stylesheet" type="text/css" href="https://combinatronics.io/sylvorg/bundle/main/src/styles/primary/syvl.css" />
<link rel="icon" href="https://combinatronics.io/sylvorg/bundle/main/src/icons/favicons/shiny-zigzagoon-galar.ico" sizes="any" />
<link rel="icon" href="https://combinatronics.io/sylvorg/bundle/main/src/icons/favicons/shiny-zigzagoon-galar.svg" />
<link rel="manifest" href="https://combinatronics.io/sylvorg/bundle/main/manifest.json" />
<link rel="stylesheet" type="text/css" href="https://combinatronics.io/sylvorg/bundle/main/src/styles/highlight/paraiso-dark.min.css" />
<script src="https://combinatronics.io/sylvorg/bundle/main/src/scripts/highlight/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
<div class="header">
<h1>We Are Syvlorg.</h1>
<a href="">About Me</a>
<a href="">About This Website</a>
<a href="">About Syvlorg</a>
<a href="https://resume.syvl.org">Résumé</a>
<a href="https://index.syvl.org">Index</a>
</div>
</head>
<body>
<div id="content" class="content">
<div id="table-of-contents" role="doc-toc">
<h2>Table of Contents</h2>
<div id="text-table-of-contents" role="doc-toc">
<ul>
<li><a href="#org4561296">early-init.el</a></li>
<li><a href="#orgcd7b3f3">Startup</a>
<ul>
<li><a href="#org6e2105d">Optimizations</a></li>
<li><a href="#org93111fc">Libraries</a></li>
<li><a href="#orgfab0262">Native Comp</a></li>
<li><a href="#org8d7d1d9">We are Borg.</a></li>
<li><a href="#orgf09d0ad">Custom</a></li>
<li><a href="#org3697c81">Themes</a></li>
<li><a href="#org6c8620e">Packages</a>
<ul>
<li><a href="#org1eaf8aa">use-package</a></li>
<li><a href="#org020a75d">hydra</a></li>
<li><a href="#org295a81c">alloy</a></li>
<li><a href="#org5c83298">prime</a></li>
<li><a href="#orgec1ffdc">uru</a></li>
<li><a href="#org076fcc5">which-key</a></li>
<li><a href="#org0865ca7">cosmoem</a></li>
<li><a href="#orgb21925e">sorrow</a></li>
<li><a href="#org4d7de2b">exec-path-from-shell</a></li>
<li><a href="#orgad47e75">undo-fu</a></li>
<li><a href="#org2f645cb">lode</a></li>
<li><a href="#org50a8444">meta</a></li>
<li><a href="#org2f59b58">aiern</a></li>
<li><a href="#orgb098d4f">all-the-icons</a></li>
<li><a href="#org954bdb0">buffer</a></li>
<li><a href="#org20388a9">ivy</a></li>
<li><a href="#org22cccc8">counsel</a></li>
<li><a href="#org76524fc">damascus</a></li>
<li><a href="#orgaa490ba">dired-sidebar</a></li>
<li><a href="#orgddb17d3">god-mode</a></li>
<li><a href="#org4818706">doom-aiern-modeline</a></li>
<li><a href="#org75f189d">evil</a></li>
<li><a href="#org646301a">olivetti</a></li>
<li><a href="#org0860741">rainbow-identifiers</a></li>
<li><a href="#orgeec0f44">vlf</a></li>
<li><a href="#org6f90fb5">doom-themes</a></li>
<li><a href="#org5a06a95">windmove</a></li>
<li><a href="#orga0c5d60">ace-window</a></li>
<li><a href="#orge03ca9a">cosmog</a></li>
<li><a href="#orgc258633">helm</a></li>
<li><a href="#org85833f0">magit</a></li>
<li><a href="#org159ee07">modalka</a></li>
<li><a href="#org0bd68cf">objed</a></li>
<li><a href="#orgce973ca">projectile</a></li>
<li><a href="#org028a1a7">pyvenv</a></li>
<li><a href="#orgb99d488">restart-emacs</a></li>
<li><a href="#orgff58a24">ryo modal</a></li>
<li><a href="#org8cb1ec3">vterm</a></li>
<li><a href="#org9d2425b">xah-fly-keys</a></li>
<li><a href="#org580783d">show-paren-mode</a></li>
<li><a href="#org04c4c2d">lispy</a></li>
<li><a href="#org8a70b49">sly</a></li>
<li><a href="#org83f3504">Major Modes</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-org4561296" class="outline-2">
<h2 id="org4561296">early-init.el</h2>
<div class="outline-text-2" id="text-org4561296">
<p>
The <code>noweb-ref</code> headers, such as the one below, are adapted from <a href="https://emacs.stackexchange.com/users/388/melioratus">Melioratus's</a> answer <a href="https://emacs.stackexchange.com/a/38935/31428">here</a>.
This way, I can maintain some semblance of a literate config.
</p>
<div class="org-src-container">
<pre><code class="language-org match-braces rainbow-braces">#+begin_src emacs-lisp :noweb-ref no :tangle (meq/tangle-path)
</code></pre>
</div>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces"><span style="font-weight: bold; font-style: italic;">;;; </span><span style="font-weight: bold; font-style: italic;">$EMACSDIR/early-init.el -*- lexical-binding: t; -*- no-byte-compile: t -*-</span>
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">user-emacs-directory</span> (file-name-directory (<span style="font-weight: bold;">or</span> load-file-name buffer-file-name)))
(<span style="font-weight: bold;">setq</span> meq/var/initial-directory default-directory)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">meq/message</span> (func <span style="font-weight: bold; text-decoration: underline;">&rest</span> args) (<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">let*</span> ((*message (apply #'format args)))
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">NOTE: THE SPACE BEFORE `</span><span style="font-weight: bold; font-style: italic; text-decoration: underline;">CREATING</span><span style="font-weight: bold; font-style: italic;">' IS MEANT TO BE THERE!</span>
(<span style="font-weight: bold;">unless</span> (<span style="font-weight: bold;">or</span> (string-prefix-p <span style="font-style: italic;">" Creating"</span> *message)
(string-prefix-p <span style="font-style: italic;">"Configuring"</span> *message)
(string-prefix-p <span style="font-style: italic;">"Loading"</span> *message)
(string-prefix-p <span style="font-style: italic;">"Library is file"</span> *message))
(apply func args))))
(advice-add #'message <span style="font-weight: bold;">:around</span> #'meq/message)
(add-hook 'after-init-hook #'(<span style="font-weight: bold;">lambda</span> nil (<span style="font-weight: bold;">interactive</span>) (advice-remove #'message #'meq/message)))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">meq/*item-in-cla</span> (item) (<span style="font-weight: bold;">unwind-protect</span> (member item command-line-args) (delete item command-line-args)))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">meq/*get-next-in-cla</span> (item)
(<span style="font-weight: bold;">let*</span> ((index (seq-position command-line-args item))
(value (<span style="font-weight: bold;">when</span> index (nth (1+ index) command-line-args))))
(<span style="font-weight: bold;">when</span> value (<span style="font-weight: bold;">unwind-protect</span> value (delete value command-line-args)))))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">meq/*two-items-in-list</span> (item) (<span style="font-weight: bold;">unwind-protect</span> (<span style="font-weight: bold;">when</span> (member item command-line-args) (meq/*get-next-in-cla item)) (delete item command-line-args)))
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">meq/var/bootstrap</span> (meq/*item-in-cla <span style="font-style: italic;">"--bootstrap"</span>))
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">meq/var/force-bootstrap</span> (meq/*item-in-cla <span style="font-style: italic;">"--force-bootstrap"</span>))
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">meq/var/windows</span> (member system-type '(windows-nt ms-dos)))
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">meq/var/slash</span> (<span style="font-weight: bold;">if</span> meq/var/windows <span style="font-style: italic;">"\\"</span> <span style="font-style: italic;">"/"</span>))
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">meq/var/phone</span> (<span style="font-weight: bold;">ignore-errors</span> (string-match-p (regexp-quote <span style="font-style: italic;">"Android"</span>) (shell-command-to-string <span style="font-style: italic;">"uname -a"</span>))))
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">meq/var/wsl</span> (<span style="font-weight: bold;">ignore-errors</span> (string-match-p (regexp-quote <span style="font-style: italic;">"microsoft-standard-WSL"</span>) (shell-command-to-string <span style="font-style: italic;">"uname -a"</span>))))
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">meq/var/nixos</span> (<span style="font-weight: bold;">ignore-errors</span> (string-match-p (regexp-quote <span style="font-style: italic;">"nixos"</span>) (shell-command-to-string <span style="font-style: italic;">"uname -a"</span>))))
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">meq/var/we-are-borg</span> (<span style="font-weight: bold;">or</span> (getenv <span style="font-style: italic;">"WEAREBORG"</span>) (meq/*item-in-cla <span style="font-style: italic;">"--we-are-borg"</span>)))
(<span style="font-weight: bold;">setq</span> package-enable-at-startup nil)
(<span style="font-weight: bold;">setq</span> meq/var/package-manager (<span style="font-weight: bold;">if</span> meq/var/we-are-borg <span style="font-style: italic;">"borg"</span> <span style="font-style: italic;">"nix"</span>))
(load (concat user-emacs-directory <span style="font-style: italic;">"siluam/"</span>
(<span style="font-weight: bold;">pcase</span> meq/var/package-manager
(<span style="font-style: italic;">"package"</span> <span style="font-style: italic;">"package-config.el"</span>)
(<span style="font-style: italic;">"straight"</span> <span style="font-style: italic;">"straight-config.el"</span>)
(<span style="font-style: italic;">"quelpa"</span> <span style="font-style: italic;">"quelpa.el"</span>)
(<span style="font-style: italic;">"borg"</span> <span style="font-style: italic;">"borg-cube.el"</span>)
(_ <span style="font-style: italic;">"nix-config.el"</span>))))
(<span style="font-weight: bold;">setq</span> load-prefer-newer t)
(mapc #'(<span style="font-weight: bold;">lambda</span> (pkg) (<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">let*</span> ((pkg-name (symbol-name pkg)))
(<span style="font-weight: bold;">when</span> meq/var/we-are-borg (<span style="font-weight: bold;">ignore-errors</span> (borg-activate pkg-name)))
(<span style="font-weight: bold;">unless</span> (<span style="font-weight: bold;">require</span> <span style="font-weight: bold; text-decoration: underline;">pkg</span> nil t)
(<span style="font-weight: bold;">pcase</span> meq/var/package-manager
(<span style="font-style: italic;">"package"</span> (<span style="font-weight: bold;">progn</span> (add-to-list 'package-selected-packages pkg) (package-install pkg)))
(<span style="font-style: italic;">"straight"</span> (straight-use-package pkg))
(<span style="font-style: italic;">"quelpa"</span> (quelpa pkg))
(<span style="font-style: italic;">"borg"</span> (borg-assimilate pkg-name (borg-get pkg-name <span style="font-style: italic;">"url"</span>)))))
(<span style="font-weight: bold;">require</span> <span style="font-weight: bold; text-decoration: underline;">pkg</span>))) <span style="font-weight: bold;">'(auto-compile no-littering gcmh))</span>
(auto-compile-on-load-mode)
(auto-compile-on-save-mode)
(gcmh-mode 1)
(global-auto-revert-mode t) (auto-revert-mode t)
(<span style="font-weight: bold;">setq</span> global-auto-revert-non-file-buffers t
auto-revert-verbose nil
auto-revert-use-notify nil)
(<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">org-loaddefs</span>)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">meq/call</span> (program buffer-name <span style="font-weight: bold; text-decoration: underline;">&rest</span> args)
(<span style="font-weight: bold;">let</span> ((process-connection-type nil)
(buffer (generate-new-buffer buffer-name)))
(<span style="font-weight: bold;">with-current-buffer</span> buffer
(pop-to-buffer buffer)
(<span style="font-weight: bold;">if</span> (eq (apply #'call-process program nil buffer nil args) 0)
(<span style="font-weight: bold;">unwind-protect</span> (format <span style="font-style: italic;">"\n\n%s\n\n"</span> (buffer-string)) (kill-buffer buffer))
(<span style="font-weight: bold;">error</span> <span style="font-style: italic;">"%s: %s:\n\n%s"</span> program args (buffer-string))))))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">meq/call-tangle</span> (file) (meq/call <span style="font-style: italic;">"org-tangle"</span> <span style="font-style: italic;">"*literally-configuring*"</span> file))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">meq/org-babel-load-file-advice</span> (file <span style="font-weight: bold; text-decoration: underline;">&optional</span> compile)
<span style="font-style: italic;">"Load Emacs Lisp source code blocks in the Org FILE.</span>
<span style="font-style: italic;">This function exports the source code using `</span><span style="font-weight: bold; font-style: italic; text-decoration: underline;">org-babel-tangle</span><span style="font-style: italic;">'</span>
<span style="font-style: italic;">and then loads the resulting file using `</span><span style="font-weight: bold; font-style: italic; text-decoration: underline;">load-file</span><span style="font-style: italic;">'. With</span>
<span style="font-style: italic;">optional prefix argument COMPILE, the tangled Emacs Lisp file is</span>
<span style="font-style: italic;">byte-compiled before it is loaded."</span>
(<span style="font-weight: bold;">interactive</span> <span style="font-style: italic;">"fFile to load: \nP"</span>)
(<span style="font-weight: bold;">let</span> ((tangled-file (concat (file-name-sans-extension file) <span style="font-style: italic;">".el"</span>)))
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Tangle only if the Org file is newer than the Elisp file.</span>
(<span style="font-weight: bold;">unless</span> (org-file-newer-than-p
tangled-file
(file-attribute-modification-time
(file-attributes (file-truename file))))
(meq/call-tangle file))
(<span style="font-weight: bold;">if</span> compile
(<span style="font-weight: bold;">progn</span>
(byte-compile-file tangled-file)
(load tangled-file)
(message <span style="font-style: italic;">"Compiled and loaded %s"</span> tangled-file))
(load-file tangled-file)
(message <span style="font-style: italic;">"Loaded %s"</span> tangled-file))))
(advice-add #'org-babel-load-file <span style="font-weight: bold;">:override</span> #'meq/org-babel-load-file-advice)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">meq/reload-early-init</span> nil (<span style="font-weight: bold;">interactive</span>) (org-babel-load-file (concat user-emacs-directory <span style="font-style: italic;">"README.org"</span>) t))
(meq/reload-early-init)
</code></pre>
</div>
<div class="org-src-container">
<pre><code class="language-org match-braces rainbow-braces"><span style="font-weight: bold; font-style: italic;">#+end_src</span>
</code></pre>
</div>
<p>
Start off by specifying the <code>user-emacs-directory</code>:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces"><span style="font-weight: bold; font-style: italic;">;;; </span><span style="font-weight: bold; font-style: italic;">$EMACSDIR/early-init.el -*- lexical-binding: t; -*- no-byte-compile: t -*-</span>
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">user-emacs-directory</span> (file-name-directory (<span style="font-weight: bold;">or</span> load-file-name buffer-file-name)))
</code></pre>
</div>
<p>
If I ever need it, this will give me the initial directory I was in; the code is adapted from <a href="https://emacs.stackexchange.com/users/1979/stefan">Stefan's</a> answer <a href="https://emacs.stackexchange.com/a/31662/31428">here</a>:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">setq</span> meq/var/initial-directory default-directory)
</code></pre>
</div>
<p>
Advise <code>message</code> to not show messages about creating autoloads and <code>Library is file</code>, then remove it after initialization:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">meq/message</span> (func <span style="font-weight: bold; text-decoration: underline;">&rest</span> args) (<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">let*</span> ((*message (apply #'format args)))
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">NOTE: THE SPACE BEFORE `</span><span style="font-weight: bold; font-style: italic; text-decoration: underline;">CREATING</span><span style="font-weight: bold; font-style: italic;">' IS MEANT TO BE THERE!</span>
(<span style="font-weight: bold;">unless</span> (<span style="font-weight: bold;">or</span> (string-prefix-p <span style="font-style: italic;">" Creating"</span> *message)
(string-prefix-p <span style="font-style: italic;">"Configuring"</span> *message)
(string-prefix-p <span style="font-style: italic;">"Loading"</span> *message)
(string-prefix-p <span style="font-style: italic;">"Library is file"</span> *message))
(apply func args))))
(advice-add #'message <span style="font-weight: bold;">:around</span> #'meq/message)
(add-hook 'after-init-hook #'(<span style="font-weight: bold;">lambda</span> nil (<span style="font-weight: bold;">interactive</span>) (advice-remove #'message #'meq/message)))
</code></pre>
</div>
<p>
Define preliminary versions of <a href="https://github.com/shadowrylander/meq/blob/fa12afdcdd4b4e148c04936337239e165e7dcdb2/meq.el#L945">meq/item-in-cla</a>, <a href="https://github.com/shadowrylander/meq/blob/fa12afdcdd4b4e148c04936337239e165e7dcdb2/meq.el#L936">meq/get-next-in-cla</a>, and <a href="https://github.com/shadowrylander/meq/blob/fa12afdcdd4b4e148c04936337239e165e7dcdb2/meq.el#L951">meq/*two-items-in-cla</a>:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">meq/*item-in-cla</span> (item) (<span style="font-weight: bold;">unwind-protect</span> (member item command-line-args) (delete item command-line-args)))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">meq/*get-next-in-cla</span> (item)
(<span style="font-weight: bold;">let*</span> ((index (seq-position command-line-args item))
(value (<span style="font-weight: bold;">when</span> index (nth (1+ index) command-line-args))))
(<span style="font-weight: bold;">when</span> value (<span style="font-weight: bold;">unwind-protect</span> value (delete value command-line-args)))))
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">meq/*two-items-in-list</span> (item) (<span style="font-weight: bold;">unwind-protect</span> (<span style="font-weight: bold;">when</span> (member item command-line-args) (meq/*get-next-in-cla item)) (delete item command-line-args)))
</code></pre>
</div>
<p>
Check if we're bootstrapping the system, and whether we want reinstall the packages:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">meq/var/bootstrap</span> (meq/*item-in-cla <span style="font-style: italic;">"--bootstrap"</span>))
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">meq/var/force-bootstrap</span> (meq/*item-in-cla <span style="font-style: italic;">"--force-bootstrap"</span>))
</code></pre>
</div>
<p>
This sets up various system-related variables, all fairly descriptive on their own:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">meq/var/windows</span> (member system-type '(windows-nt ms-dos)))
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">meq/var/slash</span> (<span style="font-weight: bold;">if</span> meq/var/windows <span style="font-style: italic;">"\\"</span> <span style="font-style: italic;">"/"</span>))
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">meq/var/phone</span> (<span style="font-weight: bold;">ignore-errors</span> (string-match-p (regexp-quote <span style="font-style: italic;">"Android"</span>) (shell-command-to-string <span style="font-style: italic;">"uname -a"</span>))))
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">meq/var/wsl</span> (<span style="font-weight: bold;">ignore-errors</span> (string-match-p (regexp-quote <span style="font-style: italic;">"microsoft-standard-WSL"</span>) (shell-command-to-string <span style="font-style: italic;">"uname -a"</span>))))
(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">meq/var/nixos</span> (<span style="font-weight: bold;">ignore-errors</span> (string-match-p (regexp-quote <span style="font-style: italic;">"nixos"</span>) (shell-command-to-string <span style="font-style: italic;">"uname -a"</span>))))
</code></pre>
</div>
<p>
Are we borg?
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">meq/var/we-are-borg</span> (<span style="font-weight: bold;">or</span> (getenv <span style="font-style: italic;">"WEAREBORG"</span>) (meq/*item-in-cla <span style="font-style: italic;">"--we-are-borg"</span>)))
</code></pre>
</div>
<p>
Disable <a href="https://www.emacswiki.org/emacs/InstallingPackages"><code>package.el</code></a> on startup:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">setq</span> package-enable-at-startup nil)
</code></pre>
</div>
<p>
Methods of package management, including:
</p>
<ul class="org-ul">
<li><a href="https://www.emacswiki.org/emacs/InstallingPackages"><code>package.el</code></a></li>
<li><a href="https://github.com/radian-software/straight.el"><code>straight.el</code></a> by <a href="https://github.com/raxod502">Radon Rosborough</a> / <a href="https://github.com/radian-software">Radian LLC</a></li>
<li><a href="https://github.com/quelpa/quelpa"><code>quelpa</code></a></li>
<li><a href="https://nixos.org/"><code>nix</code></a></li>
<li><a href="https://github.com/emacscollective/borg">We Are Borg.</a></li>
</ul>
<div id="org45d6c87" class="figure">
<p><img src="./borg.gif" alt="borg.gif" />
</p>
</div>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">setq</span> meq/var/package-manager (<span style="font-weight: bold;">if</span> meq/var/we-are-borg <span style="font-style: italic;">"borg"</span> <span style="font-style: italic;">"nix"</span>))
(load (concat user-emacs-directory <span style="font-style: italic;">"siluam/"</span>
(<span style="font-weight: bold;">pcase</span> meq/var/package-manager
(<span style="font-style: italic;">"package"</span> <span style="font-style: italic;">"package-config.el"</span>)
(<span style="font-style: italic;">"straight"</span> <span style="font-style: italic;">"straight-config.el"</span>)
(<span style="font-style: italic;">"quelpa"</span> <span style="font-style: italic;">"quelpa.el"</span>)
(<span style="font-style: italic;">"borg"</span> <span style="font-style: italic;">"borg-cube.el"</span>)
(_ <span style="font-style: italic;">"nix-config.el"</span>))))
</code></pre>
</div>
<p>
Avoid stale <code>*.elc</code> files using <a href="https://emacs.stackexchange.com/a/186/31428">this answer</a>, by <a href="https://emacs.stackexchange.com/users/50/malabarba">Malabarba</a>:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">setq</span> load-prefer-newer t)
</code></pre>
</div>
<p>
Set up startup optimization packages, including <a href="https://github.com/emacscollective/packed"><code>packed</code></a>, <a href="https://github.com/emacscollective/auto-compile"><code>auto-compile</code></a>, <a href="https://github.com/emacscollective/no-littering"><code>no-littering</code></a>, and <a href="https://github.com/emacsmirror/gcmh"><code>gcmh</code></a>:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(mapc #'(<span style="font-weight: bold;">lambda</span> (pkg) (<span style="font-weight: bold;">interactive</span>)
(<span style="font-weight: bold;">let*</span> ((pkg-name (symbol-name pkg)))
(<span style="font-weight: bold;">when</span> meq/var/we-are-borg (<span style="font-weight: bold;">ignore-errors</span> (borg-activate pkg-name)))
(<span style="font-weight: bold;">unless</span> (<span style="font-weight: bold;">require</span> <span style="font-weight: bold; text-decoration: underline;">pkg</span> nil t)
(<span style="font-weight: bold;">pcase</span> meq/var/package-manager
(<span style="font-style: italic;">"package"</span> (<span style="font-weight: bold;">progn</span> (add-to-list 'package-selected-packages pkg) (package-install pkg)))
(<span style="font-style: italic;">"straight"</span> (straight-use-package pkg))
(<span style="font-style: italic;">"quelpa"</span> (quelpa pkg))
(<span style="font-style: italic;">"borg"</span> (borg-assimilate pkg-name (borg-get pkg-name <span style="font-style: italic;">"url"</span>)))))
(<span style="font-weight: bold;">require</span> <span style="font-weight: bold; text-decoration: underline;">pkg</span>))) <span style="font-weight: bold;">'(auto-compile no-littering gcmh))</span>
(auto-compile-on-load-mode)
(auto-compile-on-save-mode)
(gcmh-mode 1)
</code></pre>
</div>
<p>
Enable <code>auto-revert</code> modes to automagically update modified files on disk, from <a href="https://kundeveloper.com/blog/autorevert/">here</a>:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(global-auto-revert-mode t) (auto-revert-mode t)
(<span style="font-weight: bold;">setq</span> global-auto-revert-non-file-buffers t
auto-revert-verbose nil
</code></pre>
</div>
<p>
Don't notify us about auto-reversion, from <a href="https://stackoverflow.com/a/54369503/10827766">this answer</a> by <a href="https://stackoverflow.com/users/9848932/jdc">jdc</a>:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces"> auto-revert-use-notify nil)
</code></pre>
</div>
<p>
We Are <code>Org</code>:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">org-loaddefs</span>)
</code></pre>
</div>
<p>
Create a version of <a href="https://github.com/emacscollective/borg/blob/master/borg.el#L912">borg's git call</a> function to call any shell command:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">meq/call</span> (program buffer-name <span style="font-weight: bold; text-decoration: underline;">&rest</span> args)
(<span style="font-weight: bold;">let</span> ((process-connection-type nil)
(buffer (generate-new-buffer buffer-name)))
(<span style="font-weight: bold;">with-current-buffer</span> buffer
(pop-to-buffer buffer)
(<span style="font-weight: bold;">if</span> (eq (apply #'call-process program nil buffer nil args) 0)
(<span style="font-weight: bold;">unwind-protect</span> (format <span style="font-style: italic;">"\n\n%s\n\n"</span> (buffer-string)) (kill-buffer buffer))
(<span style="font-weight: bold;">error</span> <span style="font-style: italic;">"%s: %s:\n\n%s"</span> program args (buffer-string))))))
</code></pre>
</div>
<p>
Then create a shell tangle function based on the above:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">meq/call-tangle</span> (file) (meq/call <span style="font-style: italic;">"org-tangle"</span> <span style="font-style: italic;">"*literally-configuring*"</span> file))
</code></pre>
</div>
<p>
Modify <a href="https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/org.el#n248"><code>org-babel-load-file</code></a> to use the above function instead:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">meq/org-babel-load-file-advice</span> (file <span style="font-weight: bold; text-decoration: underline;">&optional</span> compile)
<span style="font-style: italic;">"Load Emacs Lisp source code blocks in the Org FILE.</span>
<span style="font-style: italic;">This function exports the source code using `</span><span style="font-weight: bold; font-style: italic; text-decoration: underline;">org-babel-tangle</span><span style="font-style: italic;">'</span>
<span style="font-style: italic;">and then loads the resulting file using `</span><span style="font-weight: bold; font-style: italic; text-decoration: underline;">load-file</span><span style="font-style: italic;">'. With</span>
<span style="font-style: italic;">optional prefix argument COMPILE, the tangled Emacs Lisp file is</span>
<span style="font-style: italic;">byte-compiled before it is loaded."</span>
(<span style="font-weight: bold;">interactive</span> <span style="font-style: italic;">"fFile to load: \nP"</span>)
(<span style="font-weight: bold;">let</span> ((tangled-file (concat (file-name-sans-extension file) <span style="font-style: italic;">".el"</span>)))
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Tangle only if the Org file is newer than the Elisp file.</span>
(<span style="font-weight: bold;">unless</span> (org-file-newer-than-p
tangled-file
(file-attribute-modification-time
(file-attributes (file-truename file))))
(meq/call-tangle file))
(<span style="font-weight: bold;">if</span> compile
(<span style="font-weight: bold;">progn</span>
(byte-compile-file tangled-file)
(load tangled-file)
(message <span style="font-style: italic;">"Compiled and loaded %s"</span> tangled-file))
(load-file tangled-file)
(message <span style="font-style: italic;">"Loaded %s"</span> tangled-file))))
(advice-add #'org-babel-load-file <span style="font-weight: bold;">:override</span> #'meq/org-babel-load-file-advice)
</code></pre>
</div>
<p>
Then finally create the function to [re]load the primary early-init in this README and load it for the first time:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">meq/reload-early-init</span> nil (<span style="font-weight: bold;">interactive</span>) (org-babel-load-file (concat user-emacs-directory <span style="font-style: italic;">"README.org"</span>) t))
(meq/reload-early-init)
</code></pre>
</div>
</div>
</div>
<div id="outline-container-orgcd7b3f3" class="outline-2">
<h2 id="orgcd7b3f3">Startup</h2>
<div class="outline-text-2" id="text-orgcd7b3f3">
<p>
Remove <code>--</code> from scripts:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">when</span> (string= (car (last command-line-args)) <span style="font-style: italic;">"--"</span>) (delete <span style="font-style: italic;">"--"</span> command-line-args))
</code></pre>
</div>
</div>
<div id="outline-container-org6e2105d" class="outline-3">
<h3 id="org6e2105d">Optimizations</h3>
<div class="outline-text-3" id="text-org6e2105d">
<p>
Startup optimizations from <a href="https://github.com/hlissner">Henrik Lissner's</a> <a href="https://github.com/hlissner/doom-emacs/blob/develop/early-init.el">Doom Emacs' <code>early-init.el</code></a>:
</p>
<blockquote>
<p>
Emacs 27.1 introduced early-init.el, which is run before init.el, before
package and UI initialization happens, and before site files are loaded.
</p>
</blockquote>
<blockquote>
<p>
A big contributor to startup times is garbage collection. We up the gc
threshold to temporarily prevent it from running, then reset it later by
enabling `gcmh-mode'. Not resetting it will cause stuttering/freezes.
</p>
</blockquote>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">setq</span> gc-cons-threshold most-positive-fixnum)
</code></pre>
</div>
<p>
And for the <code>file-name-handler-alist</code>:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">setq</span> meq/var/file-name-handler-alist file-name-handler-alist)
(<span style="font-weight: bold;">unless</span> (<span style="font-weight: bold;">or</span> (daemonp) noninteractive)
</code></pre>
</div>
<blockquote>
<p>
`file-name-handler-alist' is consulted on each `require', `load' and
various path/io functions. You get a minor speed up by unsetting this.
Some warning, however: this could cause problems on builds of Emacs where
its site lisp files aren't byte-compiled and we're forced to load the
*.el.gz files (e.g. on Alpine).
</p>
</blockquote>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces"> (<span style="font-weight: bold;">setq-default</span> file-name-handler-alist nil)
</code></pre>
</div>
<blockquote>
<p>
…but restore `file-name-handler-alist' later, because it is needed for
handling encrypted or compressed files, among other things.
</p>
</blockquote>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces"> (<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">meq/reset-file-handler-alist-h</span> ()
(<span style="font-weight: bold;">setq</span> file-name-handler-alist
</code></pre>
</div>
<blockquote>
<p>
Merge instead of overwrite because there may have bene changes to
`file-name-handler-alist' since startup we want to preserve.
</p>
</blockquote>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces"> (delete-dups (append file-name-handler-alist
meq/var/file-name-handler-alist))))
(add-hook 'emacs-startup-hook #'meq/reset-file-handler-alist-h 101))
</code></pre>
</div>
<p>
The next few bits are adapted from <a href="https://www.reddit.com/r/emacs/comments/dppmqj/do_i_even_need_to_leverage_earlyinitel_if_i_have/?utm_source=amp&utm_medium=&utm_content=post_body">here</a>, with a few quotes from myself and others scattered here and there,
such as this bit <a href="https://www.reddit.com/r/emacs/comments/41m7x3/why_are_you_changing_gcconsthreshold/cz3t775?utm_source=share&utm_medium=web2x&context=3">about <code>gc-cons-percentage</code></a>:
</p>
<blockquote>
<p>
… There's also gc-cons-percentage which performs a gc if the amount of new memory used as a percentage
of the total has increased by a certain amount.
If you set gc-cons-threshold to a large number that effectively puts gc-cons-percentage into the driving seat.
The default gc-cons-threshold is 400000 bytes, not 800000. …
</p>
</blockquote>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">meq/var/gc-cons-percentage</span> gc-cons-percentage)
(add-hook 'after-init-hook
(<span style="font-weight: bold;">lambda</span> ()
(<span style="font-weight: bold;">setq</span> gc-cons-percentage meq/var/gc-cons-percentage)
(<span style="font-weight: bold;">defun</span> <span style="font-weight: bold;">meq/gc-on-lose-focus</span> ()
(<span style="font-weight: bold;">unless</span> (frame-focus-state)
(garbage-collect)))
(<span style="font-weight: bold;">if</span> (boundp 'after-focus-change-function)
(<span style="font-weight: bold;">add-function</span> <span style="font-weight: bold;">:after</span> after-focus-change-function #'meq/gc-on-lose-focus))))
(<span style="font-weight: bold;">setq-default</span> gc-cons-percentage 0.6)
</code></pre>
</div>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">setq-default</span> auto-window-vscroll nil
frame-inhibit-implied-resize t
inhibit-compacting-font-caches t)
(fset 'yes-or-no-p 'y-or-n-p)
(fset 'view-hello-file 'ignore)
(fset 'display-startup-echo-area-message 'ignore)
(put 'narrow-to-region 'disabled nil)
(put 'up-case-rgion 'disabled nil)
(put 'downcase-region 'disabled nil)
(put 'erase-buffer 'disabled nil)
(<span style="font-weight: bold;">push</span> '(ns-transparent-titlebar . t) default-frame-alist)
(<span style="font-weight: bold;">push</span> '(ns-appearance . nil) default-frame-alist)
(<span style="font-weight: bold;">push</span> '(internal-border . 0) default-frame-alist)
(<span style="font-weight: bold;">push</span> '(menu-bar-lines . 0) default-frame-alist)
(<span style="font-weight: bold;">push</span> '(tool-bar-lines . 0) default-frame-alist)
(<span style="font-weight: bold;">push</span> '(vertical-scroll-bars . 0) default-frame-alist)
(<span style="font-weight: bold;">push</span> '(left-fringe . 0) default-frame-alist)
(<span style="font-weight: bold;">push</span> '(right-fringe . 0) default-frame-alist)
</code></pre>
</div>
</div>
</div>
<div id="outline-container-org93111fc" class="outline-3">
<h3 id="org93111fc">Libraries</h3>
<div class="outline-text-3" id="text-org93111fc">
<p>
Byte-compile the library directories and add them to the load-path now; the following bits are adapted from <a href="https://emacs.stackexchange.com/users/14825/nickd">NickD's</a> answer <a href="https://emacs.stackexchange.com/a/55415/31428">here</a>,
and <a href="https://www.emacswiki.org/emacs/LoadPath#h5o-2">from this section of the Emacs Wiki</a>.
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">let*</span> ((default-directory (concat user-emacs-directory <span style="font-style: italic;">"siluam"</span>)))
(normal-top-level-add-to-load-path '(<span style="font-style: italic;">"."</span>))
(normal-top-level-add-subdirs-to-load-path))
</code></pre>
</div>
</div>
</div>
<div id="outline-container-orgfab0262" class="outline-3">
<h3 id="orgfab0262">Native Comp</h3>
<div class="outline-text-3" id="text-orgfab0262">
<p>
These are two settings I like for <code>native compilation</code>, adapted from <a href="https://github.com/daviwil/dotfiles/blob/master/Emacs.org#native-compilation">here</a>:
</p>
<blockquote>
<p>
Silence compiler warnings as they can be pretty disruptive
</p>
</blockquote>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">ignore-errors</span>
(<span style="font-weight: bold;">setq</span> native-comp-async-report-warnings-errors nil)
</code></pre>
</div>
<blockquote>
<p>
Set the right directory to store the native comp cache
</p>
</blockquote>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces"> (add-to-list 'native-comp-eln-load-path (meq/ued-local <span style="font-style: italic;">"eln-cache/"</span>)))
</code></pre>
</div>
</div>
</div>
<div id="outline-container-org8d7d1d9" class="outline-3">
<h3 id="org8d7d1d9">We are Borg.</h3>
<div class="outline-text-3" id="text-org8d7d1d9">
<p>
<i>Finally</i> activate my function library:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">meq</span>)
</code></pre>
</div>
</div>
</div>
<div id="outline-container-orgf09d0ad" class="outline-3">
<h3 id="orgf09d0ad">Custom</h3>
<div class="outline-text-3" id="text-orgf09d0ad">
<p>
As adapted from <a href="https://emacs.stackexchange.com/users/2731/ebpa">ebpa's</a> answer <a href="https://emacs.stackexchange.com/a/18682/31428">here</a>:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">setq</span> custom-file (meq/ued <span style="font-style: italic;">"custom.el"</span>))
(meq/cl custom-file)
(<span style="font-weight: bold;">setq</span> auto-save-list-file-prefix user-emacs-directory)
</code></pre>
</div>
</div>
</div>
<div id="outline-container-org3697c81" class="outline-3">
<h3 id="org3697c81">Themes</h3>
<div class="outline-text-3" id="text-org3697c81">
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(byte-recompile-directory (meq/ued <span style="font-style: italic;">"themes"</span>) nil)
(add-to-list 'custom-theme-load-path (meq/ued <span style="font-style: italic;">"themes"</span>))
(<span style="font-weight: bold;">setq</span> custom-safe-themes t)
</code></pre>
</div>
<p>
By the way, I get most of my themes from <a href="https://themer.dev/">themer.dev</a>.
</p>
</div>
</div>
<div id="outline-container-org6c8620e" class="outline-3">
<h3 id="org6c8620e">Packages</h3>
<div class="outline-text-3" id="text-org6c8620e">
</div>
<div id="outline-container-org1eaf8aa" class="outline-4">
<h4 id="org1eaf8aa">use-package</h4>
<div class="outline-text-4" id="text-org1eaf8aa">
<p>
<a href="https://github.com/jwiegley/use-package">use-package</a> with <a href="https://github.com/jwiegley">John Wiegley</a>:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(with-no-warnings
(<span style="font-weight: bold;">setq</span> use-package-verbose t)
(<span style="font-weight: bold;">setq</span> use-package-enable-imenu-support t))
(<span style="font-weight: bold;">require</span> '<span style="font-weight: bold; text-decoration: underline;">use-package</span>)
</code></pre>
</div>
<p>
Search the <code>command-line-args</code> list for the <code>--always-demand</code> argument and set <code>use-package-always-demand</code> accordingly,
then delete the argument from the list; also set the variable if Emacs is running as a daemon.
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">setq</span> use-package-always-demand (<span style="font-weight: bold;">or</span> (meq/item-in-cla <span style="font-style: italic;">"--always-demand"</span>) (daemonp)))
</code></pre>
</div>
</div>
<ul class="org-ul">
<li><a id="org0bfcaff"></a>Sometimes defer package loading<br />
<div class="outline-text-5" id="text-org0bfcaff">
<p>
Quoted from <a href="https://github.com/jwiegley/use-package#loading-packages-in-sequence">Use-Package's Loading packages in sequence</a>:
</p>
<blockquote>
<p>
NOTE: pay attention if you set use-package-always-defer to t, and also use the :after keyword, as you will need to specify how the
declared package is to be loaded: e.g., by some :bind. If you're not using one of the mechanisms that registers autoloads, such as
:bind or :hook, and your package manager does not provide autoloads, it's possible that without adding :defer 2 to those declarations,
your package will never be loaded.
</p>
</blockquote>
<p>
Quoted from <a href="https://github.com/jwiegley/use-package#notes-about-lazy-loading">Use-Package's Notes about lazy loading</a>:
</p>
<blockquote>
<p>
In almost all cases you don't need to manually specify :defer t. This is implied whenever :bind or :mode or :interpreter is used.
Typically, you only need to specify :defer if you know for a fact that some other package will do something to cause your package to
load at the appropriate time, and thus you would like to defer loading even though use-package isn't creating any autoloads for you.
You can override package deferral with the :demand keyword. Thus, even if you use :bind, using :demand will force loading to occur
immediately and not establish an autoload for the bound key.
</p>
</blockquote>
<p>
Quoted from <a href="https://github.com/jwiegley/use-package#modes-and-interpreters">Use-Package's Modes and interpreters</a>:
</p>
<blockquote>
<p>
Similar to :bind, you can use :mode and :interpreter to establish a deferred binding within the auto-mode-alist and interpreter-mode-alist variables.
…
If you aren't using :commands, :bind, :bind*, :bind-keymap, :bind-keymap*, :mode, :interpreter, or :hook
(all of which imply :defer; see the docstring for use-package for a brief description of each), you can still defer loading with the :defer keyword…
</p>
</blockquote>
<p>
Quoted from <a href="https://github.com/jwiegley/use-package#magic-handlers">Use-Package's Magic handlers</a>:
</p>
<blockquote>
<p>
Similar to :mode and :interpreter, you can also use :magic and :magic-fallback to cause certain function to be run if the beginning of a file matches
a given regular expression.
…
This registers an autoloaded command for pdf-view-mode, defers loading of pdf-tools, and runs pdf-view-mode if the beginning of a buffer matches the string "%PDF".
</p>
</blockquote>
<p>
Quoted from <a href="https://github.com/Kungsgeten/ryo-modal#use-package-keyword">RYO-Modal's Use-package keyword</a>:
</p>
<blockquote>
<p>
Ryo-modal also provides a use-package keyword: :ryo, which is similar to :bind in that it implies :defer t and create autoloads for the bound commands.
The keyword is followed by one or more key-binding commands, using the same syntax as used by ryo-modal-keys…
</p>
</blockquote>
<p>
Quoted from <a href="https://github.com/noctuid/general.el#use-package-keywords">General's Use-package Keywords</a>:
</p>
<blockquote>
<p>
:general is similar to :bind in that it implies :defer t whenever there are bound commands that can be autoloaded
(e.g. it will not imply :defer t if the only bound command is to a lambda, for example). Whenever autoloadable commands are bound,
use-package will create autoloads for them (though this is usually not necessary).
</p>
</blockquote>
<p>
Quoted from <a href="https://github.com/noctuid/general.el#ghook-keyword">General's :ghook Keyword</a>:
</p>
<blockquote>
<p>
:ghook is intended to be used to add a package’s minor mode enabling function to a user-specified hook, so that when hook is run,
the package will be loaded and the mode enabled. This means that :ghook will usually imply :defer t. While it does not always imply :defer t,
it will add any non-lambda functions to :commands (this is the same behavior as :hook).
Though this is usually unnecessary (the commands probably already have autoloads), it will in turn imply :defer t.
</p>
</blockquote>
<p>
Quoted from <a href="https://github.com/noctuid/general.el#gfhook-keyword">General's :gfhook Keyword</a>:
</p>
<blockquote>
<p>
Unlike :ghook, :gfhook never adds functions to :commands and therefore never implies :defer t.
This is because the functions specified are ones that should be run when turning on (or toggling) the mode(s) the package provides.
The specified functions are external to the package, could be called elsewhere, and therefore should not trigger the package to load.
</p>
</blockquote>
<p>
Also see <a href="https://github.com/jwiegley/use-package/issues/738#issuecomment-447631609">this comment</a>.
</p>
<p>
Note that I assume that <a href="https://github.com/jwiegley/use-package#use-package-chords">chords</a> also defer and create autoloads.
</p>
<p>
And in my experience… Not a good idea; much too confusing. Use <a href="https://www.reddit.com/r/emacs/comments/j2xezg/usepackage_best_practices/">the arguments here</a> to decide whether to use this or <code>:defer <n></code> instead.
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">setq</span> use-package-always-defer (meq/item-in-cla <span style="font-style: italic;">"--always-defer"</span>))
</code></pre>
</div>
</div>
</li>
<li><a id="org78081d1"></a>extras<br />
<div class="outline-text-5" id="text-org78081d1">
<p>
This sets up <a href="https://github.com/shadowrylander/use-package-extras">use-package-extras</a> by yours truely:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(use-package use-package-extras <span style="font-weight: bold;">:demand</span> t
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">:config (meq/up use-package-ensure-system-package)</span>
)
</code></pre>
</div>
<p>
And then <a href="https://github.com/conao3/leaf.el">leaf.el</a> by <a href="https://github.com/conao3">Naoya Yamashita</a>:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(meq/up leaf
<span style="font-weight: bold;">:init</span> (<span style="font-weight: bold;">defmacro</span> <span style="font-weight: bold;">meq/leaf</span> (<span style="font-weight: bold; text-decoration: underline;">&rest</span> args) `(leaf ,@args <span style="font-weight: bold;">:require</span> ,(cl-getf args <span style="font-weight: bold;">:require</span> t)))
<span style="font-weight: bold;">:upnsd-postconfig</span> (leaf-keywords <span style="font-weight: bold;">:demand</span> t))
</code></pre>
</div>
</div>
</li>
</ul>
</div>
<div id="outline-container-org020a75d" class="outline-4">
<h4 id="org020a75d">hydra</h4>
<div class="outline-text-4" id="text-org020a75d">
<p>
This sets up <a href="https://github.com/abo-abo/hydra">hydra</a> by <a href="https://github.com/abo-abo">Oleh Krehel</a>, as well as its <code>use-package</code> keywords:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(meq/up hydra
<span style="font-weight: bold;">:custom</span> (hydra-hint-display-type 'lv)
<span style="font-weight: bold;">:bind</span> (<span style="font-weight: bold;">:map</span> hydra-base-map (<span style="font-style: italic;">"~"</span> . hydra--universal-argument))
</code></pre>
</div>
<p>
This bit sets up the following:
</p>
<ul class="org-ul">
<li><a href="https://github.com/shadowrylander/janus">janus</a> by yours truely</li>
<li><a href="https://gitlab.com/to1ne/use-package-hydra">use-package-hydra</a> by <a href="https://gitlab.com/to1ne">to1ne</a></li>
<li><a href="https://github.com/shadowrylander/use-package-deino">use-package-deino</a> by yours truely</li>
<li><a href="https://github.com/shadowrylander/deino">deino</a>, forked from</li>
</ul>
<p>
<a href="https://github.com/abo-abo/hydra">hydra</a> by <a href="https://github.com/abo-abo">Oleh Krehel</a>
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces"> <span style="font-weight: bold;">:use-package-preconfig</span> (use-package-hydra)
<span style="font-weight: bold;">:upnsd-preconfig</span> (janus)
<span style="font-weight: bold;">:upnsd-postconfig</span> (deino <span style="font-weight: bold;">:custom</span> (deino-hint-display-type 'lv)) (use-package-deino))
</code></pre>
</div>
</div>
</div>
<div id="outline-container-org295a81c" class="outline-4">
<h4 id="org295a81c">alloy</h4>
<div class="outline-text-4" id="text-org295a81c">
<p>
Here is the configuration for <a href="https://github.com/shadowrylander/alloy">alloy</a>, forked from <a href="https://github.com/noctuid/general.el">general.el</a> by <a href="https://github.com/noctuid">Fox Kiester</a>:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(meq/upnsd alloy
</code></pre>
</div>
<p>
This sets up the following:
</p>
<ul class="org-ul">
<li><a href="https://github.com/shadowrylander/lode">lode</a> by yours truely! :D</li>
<li><a href="https://github.com/shadowrylander/prime">prime</a> by yours truely! :D</li>
<li><a href="https://github.com/lewang/command-log-mode">command-log-mode</a> by <a href="https://github.com/lewang">Le Wang</a></li>
<li><a href="https://github.com/waymondo/use-package-chords">use-package-chords</a> by <a href="https://github.com/waymondo">justin talbott</a></li>
</ul>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces"> <span style="font-weight: bold;">:use-package-preconfig</span> (command-log-mode)
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Important: https://github.com/noctuid/general.el/issues/53#issuecomment-307262154</span>
(use-package-chords)
</code></pre>
</div>
<p>
I don't like having to unbind keys before reassigning them:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces"> <span style="font-weight: bold;">:config</span> (alloy-auto-unbind-keys)
</code></pre>
</div>
<p>
This binds some fundamental keys to the following keymaps:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces">(<span style="font-weight: bold;">defvar</span> <span style="font-weight: bold; font-style: italic;">demon-run</span> '(global override
aiern-insert-state-map
aiern-normal-state-map
aiern-god-state-map
evil-insert-state-map
evil-normal-state-map
evil-god-state-map))
</code></pre>
</div>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces"> (alloy-def <span style="font-weight: bold;">:keymaps</span> demon-run
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Adapted From:</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">Answer: https://stackoverflow.com/a/4557027/10827766</span>
<span style="font-weight: bold; font-style: italic;">;; </span><span style="font-weight: bold; font-style: italic;">User: https://stackoverflow.com/users/387076/gilles-so-stop-being-evil</span>
<span style="font-style: italic;">"\eOA"</span> [up]
<span style="font-style: italic;">"\e[A"</span> [up]
<span style="font-style: italic;">"\eOB"</span> [down]
<span style="font-style: italic;">"\e[B"</span> [down]
<span style="font-style: italic;">"\eOD"</span> [left]
<span style="font-style: italic;">"\e[D"</span> [left]
<span style="font-style: italic;">"\eOC"</span> [right]
<span style="font-style: italic;">"\e[C"</span> [right]
<span style="font-style: italic;">"M-x"</span> 'meq/M-x
(alloy-chord <span style="font-style: italic;">"jj"</span>) 'universal-argument
(naked <span style="font-style: italic;">"<tab>"</span>) 'org-cycle
(naked <span style="font-style: italic;">"backtab"</span>) 'org-shifttab
<span style="font-weight: bold;">:keymaps</span> 'universal-argument-map (alloy-chord <span style="font-style: italic;">"jj"</span>) 'universal-argument-more)
</code></pre>
</div>
<p>
And finally, this allows <code>alloy</code> to assume <code>kbd</code> is being used, or in this case, <a href="https://www.emacswiki.org/emacs/naked.el">naked</a>:
</p>
<div class="org-src-container">
<pre><code class="language-lisp match-braces rainbow-braces"> <span style="font-weight: bold;">:custom</span> (alloy-implicit-naked t))
</code></pre>