-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathALEC.txt
8357 lines (6876 loc) · 313 KB
/
ALEC.txt
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
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ALEC'S A LANGUAGE FOR EXPRESSING CREATIVITY
(ALEC)
Grant Rettke
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
<2014-02-24 MON>
Table of Contents
─────────────────
1 Start Up
2 Run-time
3 Provisioning
.. 3.1 Background
.. 3.2 Steps
..... 3.2.1 Package
..... 3.2.2 el-get
4 Ends & Means
5 Ends (ALEC)
.. 5.1 The desire
.. 5.2 The story
.. 5.3 Inspirations
6 Means
.. 6.1 Functions & Constants
.. 6.2 Color Theme
.. 6.3 Windows
.. 6.4 Environment
.. 6.5 Code folding
.. 6.6 Buffers
.. 6.7 Frames
.. 6.8 File-system management (GUI)
.. 6.9 File-system/directory management (Console)
.. 6.10 Save history of all things
.. 6.11 Spell-checking
.. 6.12 Syntax checking
.. 6.13 Templating
.. 6.14 White-space management
.. 6.15 Mark and Region
.. 6.16 Modeline
.. 6.17 Speed
.. 6.18 Minibuffer
.. 6.19 Searching / Finding / Replacing [89] [90]
..... 6.19.1 Searching
..... 6.19.2 Finding
..... 6.19.3 Replacing
.. 6.20 Sudo
.. 6.21 Popups
.. 6.22 Intellisense (Auto Completion) [95]
.. 6.23 Symbolic Expression Management [98]
.. 6.24 Evaluation
.. 6.25 Version control / Git
.. 6.26 Command execution helper [105]
.. 6.27 Rectangle / Cursors [107] [108]
.. 6.28 Font
.. 6.29 Project management [114]
.. 6.30 Emacs Speaks Statistics (ESS) [115] [116] [117] [118] [119] [120]
.. 6.31 Org
..... 6.31.1 Discussion
..... 6.31.2 Configuration
.. 6.32 Keyboard
7 Keybindings
.. 7.1 NON-DISRUPTIVE
.. 7.2 SLIGHTLY-DISRUPTIVE
.. 7.3 VERY DISRUPTIVE
8 Modes
.. 8.1 C Language Integrated Production System (CLIPS) [167]
.. 8.2 Comint
.. 8.3 CSS
.. 8.4 Emacs Lisp
.. 8.5 Eshell [174] [175] [176]
.. 8.6 Files
.. 8.7 Graphviz [177] [178] [179]
.. 8.8 Grammar
.. 8.9 Help
.. 8.10 ibuffer
.. 8.11 IELM [187] [188] [189]
.. 8.12 Imenu [191] [192]
.. 8.13 Info [196]
.. 8.14 Javascript [200] [201]
.. 8.15 LilyPond [202]
.. 8.16 Lispy
.. 8.17 Make [204] [205] [206]
.. 8.18 Markdown [207]
.. 8.19 Occur
.. 8.20 Pandoc [209]
.. 8.21 Polymode [212]
.. 8.22 Ruby [218]
.. 8.23 Scheme [219]
.. 8.24 Sh(hell)
.. 8.25 Shell
.. 8.26 Standard ML (SML) [222]
.. 8.27 Strings
.. 8.28 Structured Query Language (SQL) [225]
.. 8.29 Table
.. 8.30 TeX [228] / LaTeX [229] / ConTeXt [230]
.. 8.31 Text
.. 8.32 Vagrant [234]
.. 8.33 Web [236]
.. 8.34 Web browsing
.. 8.35 TRAMP [240]
.. 8.36 YAML
.. 8.37 Diagramming, UML creation, Workflow
..... 8.37.1 Setup
9 Libraries
.. 9.1 Generally nice
.. 9.2 Built-in
.. 9.3 Characters / Unicode
10 Jokes
11 Customize
12 Tangling
.. 12.1 .emacs.el
.. 12.2 eshell/alias
13 Portability
.. 13.1 Windows
..... 13.1.1 Testing
..... 13.1.2 Helper Bindings
..... 13.1.3 AutoHotKey
.. 13.2 OSX
..... 13.2.1 Keyboard
14 Reminders
15 Confessions
1 Start Up
══════════
There are things that must occur during start… *before* everything
else.
Load the newer version of a file: bytecode or lisp. This says a lot.
In the users guide it explains why you may want this turned off. That
way you can develop code and try it out to see how it works and comare
it to the old version which had been byte-compiled. I am not doing
that here.
┌────
│ (setq load-prefer-newer t)
└────
2 Run-time
══════════
Reproducibility is both the foundation of all good science, and, the
thing that allows us to tell, and enjoy, jokes. This system is a
little of both
Paging through hundreds of Emacs related posts in my memory banks,
there is a common decision shared with the reader /not/ to upgrade the
Emacs version. This could be out of laziness, which makes total sense,
and another good reason is that every new release brings change.
Despite the fact that we are subject to decay, which is /just/ change,
most humans don't like either. Change often brings pain, and hard
work. To help alleviate some of the pain, this system will attempt to
capture its configuration at a particular state in time to facilitate
reproducibility. In practice, it will be a bit liberal, though.
This system will only start with the correct version of Emacs, v24.4
┌────
│ (defun gcr/emacs-version-check ()
│ "Enforce version compliance."
│ (interactive)
│ (when (not (and (= emacs-major-version 24)
│ (= emacs-minor-version 4)))
│ (error
│ "Incorrect Emacs runtime. Expected v24.4. Found v%s.%s"
│ (number-to-string emacs-major-version)
│ (number-to-string emacs-minor-version))))
│ (gcr/emacs-version-check)
└────
3 Provisioning
══════════════
3.1 Background
──────────────
In /the old days/, the way that you managed software packages for
Emacs was to do it manually because there was no software distribution
system available. In my case, I just put everything inside of a
Subversion project and moved on. That actually worked fine, but I
didn't like committing compiled code, and handling updates was always
a hassle depending on how files and the directory structure had
changed. Fortunately that all changed with the introduction of Package
and ELPA.
When I first cut my system over to ELPA I went with GNU ELPA and
Marmalade. Eventually I found that they weren't the right thing for me
since the former had a very small collection and the latter,
strangely, had exactly what I wasn't looking for. About that time,
MELPA was starting to really gain momentum.
MELPA is really a community and a belief-system in addition to being a
package repository. They value structure and form, and make sure that
the package builds, and then they do the building for you. They are
doing great things to create, nurture, and guide the community to
define a higher standard for package quality. Around that time, too I
got fed up with manually installing and worrying whether I had the
packages installed or not, so after figuring that there was something
better than some custom code that I wrote, I looked at Cask.
Cask is a declarative approach for expressing dependencies. That
sounds fancy but it isn't. Cask just makes it really easy to obtain
ELPA packages from different repositories. One reason that I really
like is that you see all of your packages in a single place rather
than sprinkled about all over your initialization file. It also lowers
the bar for new users to with just one line of code add a new
repository. Something funny happened though, the more I learned about
Emacs and the community, the more I found the need to manage software
not hosted in MELPA.
MELPA is perfect at what it does, and it is still evolving. Rather
than try to plan for everything, they decided to solve 80% of most
problems for most people and that is super. Now they are looking at
how to handle versioned packages by hosting a stable repository that
uses Git tags, and that is super, too. What about software that
doesn't live in a package though?
You start finding code all over not in packages. EmacsWiki is the
exception given that MELPA supports that. What about random Emacs-Lisp
code you find out on the 'Net? That question got me motivated to learn
about other people's approaches for package management. That is where
I learned about EL-Get.
EL-Get is powerful, and flexible, and concise. What it lacks in
community momentum, it makes up for in raw power. When I find code
that doesn't live in packages, and may never, then I start setting up
EL-Get to grab it for me.
Based upon what I've read, it had its time in the sun. Its power is
still true, and its value is a great, because it truly succeeds at the
goals that it set out on.
The first time I set up Cask, it was the only option for easily
specifying which repository you wanted to use for installing a
package. It was great. Then, I got the bug to be able to easily
collaborate with others by sending them a single initialization file.
Kind of a theoretical goal, but there is *one* person with whom I want
to collaborate that makes it completely make sense. More than a year
after switching from Subversion to Cask, I dug into the options out
there today.
My foray into EL-Get was kind of a mistake, since its role had changed
in the community between then and its inception. I spent a lot of time
not being productive there. Then I figured that Cask would be fine,
but at the time it did not run easily on Windows, which is really
important to me. Based on that, I quit pursuing Cask as an option.
From what I read, Cask does now run easily on Windows, but I am not
revisiting it for now.
One mistake that I made here was assuming that recipes would be the
same between EL-Get and Cask. Doh! Of course they wouldn't be. The
nice side-effect here though was learning the power of EL-Get. It is
very powerful.
The great news as of 24.4 is that Package inside of Emacs allows you
to specify the source repository from which to install a package. This
is a hugely important feature and I am thrilled on all user's
behalf's. The old problem was that sometimes you might want the stable
version of Foo and something you want the development version of Foo.
The problem was that you never quite knew which one you would get
because the packages lived in *both* repositories! Now, it is no
longer an issue, and one of the reasons that I don't need to use Cask
anymore. Package should do it all, and it will, below. That was my
plan. It failed.
My approach was simple. First I identified all of the packages that I
used that were available on MELPA Stable. Then added MELPA Stable as a
repository and added all of those packages to
`package-pinned-packages'. To help me out, I also added a separate
entry just to pull MELPA packages that were not ELPA packages. On this
setup, it worked about %75 of the time. I couldn't figure out why. I
tried every permutation. I removed entries. It wasn't enough. It never
worked right. Here is what it did:
What is happening is simple
• Delete the ELPA directory
• Start this system
• Packages that are pinned to MELPA Stable are installed from MELPA
Long ago Steve Purcell asked someone on GitHub why they want stable. I
don't recall the exact conversation. Perhaps I asked something. His
answer was really simple. It was something like "Going with the TRUNK
tends to be fine. If it breaks, it usually gets fixed quickly". I
understood. I just *really* wanted to try the /reproducible research/
thing with this system. I was very gung-ho about it. It didn't work
out though. Then I started loading everything from MELPA. At that
point, everything worked _perfectly_. I tested it 5 times. I look
forward to seeing how it works out in the future. It is certainly
consistent with what Purcell shared.
3.2 Steps
─────────
3.2.1 Package
╌╌╌╌╌╌╌╌╌╌╌╌╌
Before doing any work with Package it must be initialized. Failure to
do so is the easiest way to waste time and achieve nothing.
┌────
│ (package-initialize)
└────
Use the Org ELPA repository. I won't lock down the version here, I
just want it to be stable. In the Org configuration, I'll at warning
for specific features.
┌────
│ (add-to-list 'package-archives
│ '("org" . "http://orgmode.org/elpa/") t)
└────
GNU stuff is always good.
┌────
│ (add-to-list 'package-archives
│ '("gnu" . "http://elpa.gnu.org/packages/"))
└────
MELPA is critical.
┌────
│ (add-to-list 'package-archives
│ '("melpa" . "http://melpa.org/packages/") t)
└────
If Package+ is not installed, then install it. First the package list
has to be refreshed so that Package knows about the new packages.
┌────
│ (package-refresh-contents)
│ (unless (package-installed-p 'package+)
│ (package-install 'package+))
└────
This is the list of packages that should be installed automatically
and loaded. Any packages not listed here that Package+ finds are
removed.
┌────
│ (package-manifest
│ 'ace-jump-mode
│ 'ace-link
│ 'ace-window
│ 'aggressive-indent
│ 'alert
│ 'anchored-transpose
│ 'anzu
│ 'ascii-art-to-unicode
│ 'auctex
│ 'auto-complete
│ 'auto-complete-chunk
│ 'autotetris-mode
│ 'boxquote
│ 'clips-mode
│ 'ctable
│ 'diff-hl
│ 'diminish
│ 'dired-details+
│ 'dired-imenu
│ 'ess
│ 'ess-R-data-view
│ 'ess-R-object-popup
│ 'esup
│ 'exec-path-from-shell
│ 'expand-region
│ 'f
│ 'figlet
│ 'fill-column-indicator
│ 'flx-ido
│ 'flycheck
│ 'fuzzy
│ 'geiser
│ 'google-this
│ 'graphviz-dot-mode
│ 'highlight-tail
│ 'htmlize
│ 'ido-hacks
│ 'ido-ubiquitous
│ 'ido-vertical-mode
│ 'imenu+
│ 'imenu-anywhere
│ 'inlineR
│ 'json-reformat
│ 'key-chord
│ 'langtool
│ 'lexbind-mode
│ 'magit
│ 'markdown-mode
│ 'metaweblog
│ 'move-text
│ 'multiple-cursors
│ 'neotree
│ 'nyan-mode
│ 'ob-sml
│ 'org-ac
│ 'org-plus-contrib
│ 'osx-browse
│ 'package+
│ 'pandoc-mode
│ 'plantuml-mode
│ 'polymode
│ 'pos-tip
│ 'pretty-mode
│ 'projectile
│ 'r-autoyas
│ 'rainbow-delimiters
│ 's
│ 'smartparens
│ 'smex
│ 'sml-mode
│ 'smooth-scrolling
│ 'solarized-theme
│ 'sparkline
│ 'sqlup-mode
│ 'string-edit
│ 'stripe-buffer
│ 'undo-tree
│ 'unicode-fonts
│ 'vagrant
│ 'web-mode
│ 'wrap-region
│ 'writegood-mode
│ 'xml-rpc
│ 'yaml-mode
│ )
└────
Why doesn't the `F' package get loaded correctly? The directory is in
the `load-path'. The auto-load is in there. It is only on my machine.
I will look into this.
This manual step used to use `load'. That was a mistake. It relied
upon specifying the package directory. The package directory can
change on every install so I had to update this line every time. That
was stupid. `load-library' searches for libraries by name. It works.
┌────
│ (load-library "f")
└────
3.2.2 el-get
╌╌╌╌╌╌╌╌╌╌╌╌
EL-Get handles things that don't easily fit anywhere else.
Initialize EL-Get.
┌────
│ (add-to-list 'load-path "~/.emacs.d/el-get/el-get")
│
│ (unless (require 'el-get nil 'noerror)
│ (with-current-buffer
│ (url-retrieve-synchronously
│ "https://raw.githubusercontent.com/dimitri/el-get/master/el-get-install.el")
│ (goto-char (point-max))
│ (eval-print-last-sexp)))
└────
┌────
│ (setq gcr/el-get-packages nil)
└────
`org-show' [1] looks like the prefect presentation tool for me.
jkitchin is just… he is one a sweet wavelength. This presentation tool
makes it really, really easy to present in a very /Emacs/ way. It is
worth discussing a bit why I got this module in this manner:
• `org-show' is distributed as an org file
• It requires tangling to produce a emacs-lisp file for utilization by
emacs
• John explains how to do so in the file itself via
`org-babel-load-file'
• This works fine on a vanilla, `org' setup
• I do not have a vanilla, `org' setup
• I do not know the issue and I am not going to debug it for now
• The approach here than is to:
• Obtain the file
• Start `emacs' with the `raw' setup defined in this document, which
is nothing but `org' … and from there, tangle `org-show'
• It is manual and that is OK for now
┌────
│ (add-to-list
│ 'el-get-sources
│ '(:name org-show
│ :type http
│ :url "https://raw.githubusercontent.com/jkitchin/jmax/master/org/org-show.org"
│ :website "https://github.com/jkitchin/jmax/blob/master/org/org-show.org"
│ :description "simple presentations in org-mode"))
│ (add-to-list 'gcr/el-get-packages 'org-show)
└────
Make it really easy to remind yourself and others what EMACS really
stands for (in this case it is fun).
┌────
│ (add-to-list
│ 'el-get-sources
│ '(:name emacs-name
│ :type http
│ :url "http://www.splode.com/~friedman/software/emacs-lisp/src/emacs-name.el"
│ :features emacs-name
│ :autoloads nil
│ :website "http://www.splode.com/"
│ :description "emacs acronym expansions"))
│ (add-to-list 'gcr/el-get-packages 'emacs-name)
└────
It is not good to flame people on the Internet. It is good to /know/
what it is all about, and here is a way to see some examples of the
absurdity of it all.
┌────
│ (add-to-list
│ 'el-get-sources
│ '(:name flame
│ :type http
│ :url "http://www.splode.com/~friedman/software/emacs-lisp/src/flame.el"
│ :features flame
│ :autoloads nil
│ :website "http://www.splode.com/"
│ :description "automatic generation of flamage, as if we needed more"))
│ (add-to-list 'gcr/el-get-packages 'flame)
└────
People love horoscopes, so, provide them.
┌────
│ (add-to-list
│ 'el-get-sources
│ '(:name horoscope
│ :type http
│ :url "http://www.splode.com/~friedman/software/emacs-lisp/src/horoscope.el"
│ :features horoscope
│ :autoloads t
│ :website "http://www.splode.com/"
│ :description "generate horoscopes"))
│ (add-to-list 'gcr/el-get-packages 'horoscope)
└────
James Parry [2] must always be honored.
┌────
│ (add-to-list
│ 'el-get-sources
│ '(:name kibologize
│ :type http
│ :url "http://www.splode.com/~friedman/software/emacs-lisp/src/kibologize.el"
│ :features kibologize
│ :autoloads nil
│ :website "http://www.splode.com/"
│ :description "generate ravings about kibology, in the style of kibo"))
│ (add-to-list 'gcr/el-get-packages 'kibologize)
└────
You might not always remember your shopping list, but we will remember
it for you… though not necessarily for wholesale.
┌────
│ (add-to-list
│ 'el-get-sources
│ '(:name shop
│ :type http
│ :url "http://www.splode.com/~friedman/software/emacs-lisp/src/shop.el"
│ :features shop
│ :autoloads nil
│ :website "http://www.splode.com/"
│ :description "generate random shopping lists"))
│ (add-to-list 'gcr/el-get-packages 'shop)
└────
Do you remember when those great AT&T adds were on television and it
changed your life and bought you a kitten? You will.
┌────
│ (add-to-list
│ 'el-get-sources
│ '(:name youwill
│ :type http
│ :url "http://www.splode.com/~friedman/software/emacs-lisp/src/youwill.el"
│ :features youwill
│ :autoloads t
│ :website "http://www.splode.com/"
│ :description "generate meaningless marketing hype"))
│ (add-to-list 'gcr/el-get-packages 'youwill)
└────
A swimming-pool screen-saver.
┌────
│ (add-to-list
│ 'el-get-sources
│ '(:name swimmers
│ :type http
│ :url "http://www.cb1.com/~john/computing/emacs/lisp/games/swimmers.el"
│ :features swimmers
│ :autoloads nil
│ :website "http://www.cb1.com/~john/"
│ :description "Draw a swimming-pool screensaver"))
│ (add-to-list 'gcr/el-get-packages 'swimmers)
└────
┌────
│ (add-to-list 'el-get-sources '(:name emacs-uuid
│ :type github
│ :pkgname "nicferrier/emacs-uuid"))
│ (add-to-list 'gcr/el-get-packages 'emacs-uuid)
│ (add-to-list 'el-get-sources '(:name emacs-world-time-mode
│ :type github
│ :pkgname "nicferrier/emacs-world-time-mode"))
│ (add-to-list 'gcr/el-get-packages 'emacs-world-time-mode)
└────
Today the recipe didn't work, `el-get' couldn't find it. That is
pretty bizarre because /nothing changed/. The recipe still lives here
[3].
Because this is broken for some unknown reason, I'm omitting it and
will simply fix it the /next/ time that I want to run it.
`(add-to-list 'gcr/el-get-packages 'sicp)'
As el-get to make sure that those desired packages are installed.
┌────
│ (el-get 'sync gcr/el-get-packages)
└────
4 Ends & Means
══════════════
There are so many ways to customize a system. Is intent or pragmatics
more important? In my philosophy, the nature of the /end/ is contained
within the properties of the /means/ themselves. They are inseparable.
The traits are the fundamental aspects of this system. They are things
that are critical, they are *everything*. Here my goal is to capture
both the means and the ends.
These are the minimum fundamental features to allow for the fluid
delivery and execution of the creative experience within this medium.
The capture occurs sequentially. The ends are listed first though,
because they are much more meaningful and inspiring to me than the
means, at least in "listed here form". Their execution, of course, is
much more visceral and fun!
The means used to be broken up into highly categorical sections. It
made sense, but it didn't read well. It might make sense from a
reference perspective, but that was about it. This document focuses
more on the flow. Since the fundamental means /ought/ to be concise,
they are intended to be read at a single sitting.
5 Ends (ALEC)
═════════════
This system has changed who I am and how I think. Because it is easier
to focus on the tools rather than the intent, on the means versus the
ends, I focus on this system, this configuration of Emacs. My system
is a provider, a realization, of a language for expressing creativity.
𝔸𝕃𝔼ℂ. ALEC's a Language for Expressing Creativity. That is a truly and
utterly beautiful thing to ponder.
The expression of creativity is why we are born human. Five of our
senses go out into the world searching, always searching. In our
time-space, the expressions that may be consumed by the eye
(paintings, graphic arts) and consumed by the ear (music) are so, so
lovely, and easy for us to understand (How do you address someone
whose /true/ name is Symphony?). We are here to let that voice sing,
and we want all five senses to help do it, for the maximization of
expressivity.
The song, that sweet celestial song, is sometimes more difficult for
people to hear. The honey-kissed embrace of one's love feels different
than a song, and different than laughing at a joke, but they are all
the creative act. Gardening, selling, collecting, tending… they are
all part of the creative act that makes us again be born human. We
always seem to focus on the configuration of those actions (time,
space, causality, and identity), the build of those tools, necessary
to perform the creative act. With time and patience, we will know the
true nature of things. Part of the path is indeed attaining mastery.
Mastery over ourselves, mostly, by some way that is gentle and kind.
That action, that attempt, for me, has partially culminated in the
aggregation of a lifetime of mastery of tools and programming
languages and ideas and studies and training and collaboration and
mystery and magic and laughing, in this birth, in the artifact called
ALEC, and ALEC can only be expressed, for me, for now, with Emacs.
This system is no longer "Emacs". It is not its disparate packages.
They are tools, yes, and more importantly, they are expressions of
creativity. Together in Emacs, in ALEC, they are composed, like parts
of a symphony, together, to allow for the ultimate in the act of
creative expression. The tools themselves possess these traits, both
in their implementation and their intent. That is traditional, in
that, the properties and traits expressed by these "words", these
compositional units, have the properties and traits of the things
expressed by these "words". "Words" is the most expressive element
that I can think of right now, for things that can be atoms, and yet
be combined to form sentences, something larger and more expressive,
in a particular language, which itself can quite magically express
ideas, about itself, or about anything else in existence.
It is like watching a beautiful lotus blooming, spreading its pedals,
having been nourished by the fertile soil, protected in its pond,
knowing that it must strive to reach higher, nurtured by Mother Sun.
The very act, the ultimate act of creative expression, that very
action contains itself and is culminated by itself. It is that which
it is trying to achieve, and to be that, is to do that, for itself and
for all of creation. This ultimate act of creative expression, is
present in the manifestation of Emacs and the packages and the users
who come together to form a perfect symphony of creative expression in
a form that may be captured and represented as a computer file, so
humble and modest, just like a small seed of a proud and mighty
Redwood tree that will eventually reach hundreds and hundreds of feet
into the sky and towards Mother Sun, contains that which it will
become in it's own existence, so too does it contain its own beautiful
destiny in the seeds of beauty and creative expression that are
produced with ALEC (in every form, not just the one described by this
document of course!).
The blossoming of the expression of the computational act, and the
petals that opened in the form of the Turing's machine, Church's
Lambda calculus, and Post's Tag System, are beautiful, and still, are
only petals, that carry the sweet fragrance, because a fragrance is
part of a moment, which is finite, as is every configuration of this
reality. The beauty is still as sweet. The key is seeing the inherent
beauty, the source without start and without end, and then being able
to see that in everyone and everything.
That thing, which was present before the expression of creativity, and
will exist after it, which is not subject to the laws of time, space,
causality, and identity, is the point that everyone surely wishes to
re-visit. That quest, /the/ great motivator of the most softly spoken
and heartfelt desire, itself is surely yet another expression of /that
which is gentle and kind/. The steps taken on that quest, despite
being driven by that perfect intent, are /still/ subject to the four
boundaries of this reality. Those actions, defined by configurations,
like the petals of the lotus, retaining its sweet fragrance, can,
will, and must fade, but, we will shine on in the sweet embrace of
Mother Sun, knowing that loving and warm embrace of sweet perfection,
in our one, and true, home.
5.1 The desire
──────────────
"I want". If only all conversations would start out with a clear goal
in mind. All too often we waste our own, and other people's time
talking and simply trying to figure out what it is what we want. For
most of us, "it", is that thing that will solve all of our problems in
life and make us happy. Technology is no exception.
The perfect integrated development environment is a topic of constant
conversation. For good reason, for most of us it is our only tool.
Unlike carpenters and wood-workers who have a bevy of interesting and
delightful tools, we are stuck with but one. Fortunately for us, our
singular tool allows limitless creation, of tools and more. Alan Kay
said it so well [4]:
The computer is a medium that can dynamically simulate the
details of any other medium, including media that cannot
exist physically. It is not a tool, although it can act
like many tools. The computer is the first metamedium, and
as such it has degrees of freedom for representation and
expression never before encountered and as yet barely
investigated. The protean nature of the computer is such
that it can act like a machine or like a language to be
shaped and exploited.
Even more succinctly, my measure of success is to:
To provide a self-suportable environment in which the creation and
conservation of computer files may occur with ease
As of writing, although there are many nice options out there, none of
them come within even light-years, of power that you are granted for
working with a computer as that metamedium, that GNU Emacs [5]. With
that in mind, the following is what I actually want to do with it.
5.2 The story
─────────────
The creativity that you apply and capture to assemble your system…
this is where all of the fun stuff is. Let me elaborate, everything in
your artifacts are valuable because they tell the story. Actually,
they tell the story about a story, a story that has yet to occur and
also a story that has previously occurred. It is here, where the
actions lives, that all of those things are learned, practiced,
suffered accordingly from, and reveled in! In other words, it is yet
another story, a fun one.
If you haven't noticed by now, either by hearing rumors, reading
accounts, or learning of it yourself: human beings are story-oriented.
Your ability to successfully function in and contribute to society
will be directly proportional to your ability to listen to stories,
tell others' stories, live your life such that you have new stories to
tell, and capture them in some form of persistent storage. Stories
grant us the power to learn from others wisdom that was painfully
acquired thousands of years ago, and it gives you a chance to
contribute the results of your hard work, for the future of humanity,
too. A belief system about the value of story-telling is essential,
critical, and mandatory to successfully achieve your goals with
literate programming.
As I change, the story will change, and the action will change. The
cycle will never end.
Nevertheless, I will attempt to do my best here with the good part of
me being a flawless, rational, and logical human being to:
• Deliver a supportable system
• Deliver an adaptable system
• Deliver an expandable system
5.3 Inspirations
────────────────
Eric Weisstein: Creator of MathWorld [6]
6 Means
═══════
These are features that I consider critical to getting this system up
and running. The original intent of this heading was to identify the
minimal core configuration required to build this very system. It was
more of the "keep it lean" line of thinking, entirely without
justification of course. An interesting thing happened, learning. Once
that core is built up, it just makes total, total sense to build on
it. It feels totally natural, and even "obvious" to do so. Not out of
boredom, but rather, out of ease-of-use. Because of this learning, I
am a lot more comfortable with including things that before I felt
were superficial. That is the power in the composition of the layers
of ideas and features, they become means that build upon each others.
The hardest part is knowing the best way to delineate those layers, if
at all. Perhaps they should simply best be just enjoy, and not
pondered or revealed.
My personal goal is to keep the tangling of this document to less than
30 seconds. It needs to be fast to allow the operator to remain /in
the flow/ and to maximize creative expression. This is a human problem
solved by a technological implementation. It is a work in progress.
Whatever the case, I will keep to this goal because without it, the
operators starts to be unnecessary constricted.
No matter what… no matter what, the tangling must be done in 30
seconds or less. That is the one, only, and single thing that I ever
allow influence the design and implementation of ALEC in this
manifestation because to do anything else would be to seriously
constrain its operator.
6.1 Functions & Constants
─────────────────────────
┌────
│ (defun gcr/untabify-buffer ()
│ "For untabifying the entire buffer."
│ (interactive)
│ (untabify (point-min) (point-max)))
│
│ (defun gcr/untabify-buffer-hook ()
│ "Adds a buffer-local untabify on save hook"
│ (interactive)
│ (add-hook
│ 'after-save-hook
│ (lambda () (gcr/untabify-buffer))
│ nil
│ 'true))
│
│ (defun gcr/disable-tabs ()
│ "Disables tabs."
│ (setq indent-tabs-mode nil))
│
│ (defmacro gcr/on-gnu/linux (statement &rest statements)
│ "Evaluate the enclosed body only when run on GNU/Linux."
│ `(when (eq system-type 'gnu/linux)
│ ,statement
│ ,@statements))
│
│ (defmacro gcr/on-osx (statement &rest statements)
│ "Evaluate the enclosed body only when run on OSX."
│ `(when (eq system-type 'darwin)
│ ,statement
│ ,@statements))
│
│ (defmacro gcr/on-gnu/linux-or-osx (statement &rest statements)
│ "Evaluate the enclosed body only when run on GNU/Linux or OSX."
│ `(when (or (eq system-type 'gnu/linux)
│ (eq system-type 'darwin))
│ ,statement
│ ,@statements))
│
│ (defmacro gcr/on-windows (statement &rest statements)
│ "Evaluate the enclosed body only when run on Microsoft Windows."
│ `(when (eq system-type 'windows-nt)
│ ,statement
│ ,@statements))
│
│ (defmacro gcr/on-gui (statement &rest statements)
│ "Evaluate the enclosed body only when run on GUI."
│ `(when (display-graphic-p)
│ ,statement
│ ,@statements))
│
│ (defmacro gcr/not-on-gui (statement &rest statements)
│ "Evaluate the enclosed body only when run on GUI."
│ `(when (not (display-graphic-p))
│ ,statement
│ ,@statements))
│
│ (defmacro gcr/diminish (mode)
│ "Diminish this mode after it is loaded."
│ (interactive)
│ `(eval-after-load ,mode
│ (diminish ,mode)))
│
│ (defvar gcr/delete-trailing-whitespace-p t
│ "Should trailing whitespace be removed?")
│
│ (defun gcr/delete-trailing-whitespace ()
│ "Delete trailing whitespace for everything but the current line.
│
│ If `gcr/delete-trailing-whitespace-p' is non-nil, then delete the whitespace.
│ This is useful for fringe cases where trailing whitespace is important."
│ (interactive)
│ (when gcr/delete-trailing-whitespace-p
│ (let ((first-part-start (point-min))
│ (first-part-end (point-at-bol))
│ (second-part-start (point-at-eol))
│ (second-part-end (point-max)))
│ (delete-trailing-whitespace first-part-start first-part-end)
│ (delete-trailing-whitespace second-part-start second-part-end))))
│
│ (defun gcr/set-org-babel-default-header-args (property value)
│ "Easily set system header arguments in org mode.
│
│ PROPERTY is the system-wide value that you would like to modify.
│
│ VALUE is the new value you wish to store.
│
│ Attribution: URL `http://orgmode.org/manual/System_002dwide-header-arguments.html#System_002dwide-header-arguments'"
│ (setq org-babel-default-header-args
│ (cons (cons property value)
│ (assq-delete-all property org-babel-default-header-args))))
│
│ (defun gcr/set-org-babel-default-inline-header-args (property value)
│ "See `gcr/set-org-babel-default-header-args'; same but for inline header args."
│ (setq org-babel-default-inline-header-args
│ (cons (cons property value)
│ (assq-delete-all property org-babel-default-inline-header-args))))
│
│ (defun gcr/set-org-babel-default-header-args:R (property value)
│ "See `gcr/set-org-babel-default-header-args'; same but for R.
│
│ This is a copy and paste. Additional languages would warrant a refactor."
│ (setq org-babel-default-header-args:R
│ (cons (cons property value)
│ (assq-delete-all property org-babel-default-header-args:R))))
│
│ (defun gcr/ispell-org-header-lines-regexp (h)
│ "Help ispell ignore org header lines."
│ (interactive)
│ (cons (concat "^#\\+" h ":") ".$"))
│
│ (defun gcr/ispell-a2isra (block-def)
│ "Add to the ispell skip region alist the BLOCK-DEF."
│ (interactive)
│ (add-to-list 'ispell-skip-region-alist block-def))
│
│ (defun gcr/insert-timestamp ()
│ "Produces and inserts a full ISO 8601 format timestamp."
│ (interactive)
│ (insert (format-time-string "%Y-%m-%dT%T%z")))
│
│ (defun gcr/insert-timestamp* ()
│ "Produces and inserts a near-full ISO 8601 format timestamp."
│ (interactive)
│ (insert (format-time-string "%Y-%m-%dT%T")))
│
│ (defun gcr/insert-datestamp ()