[Emacs Lisp] Personal ~/.emacs.d/ configuration folder.
Revert `fill-column'.
smart-documents.org
@@ -12,46 +12,45 @@
12
12
#+LATEX_HEADER_EXTRA: \newfontfamily\publicsans{Public Sans}
13
13
14
14
#+LATEX: \begin{abstract}
15
Removed:
The idea of /Smart Documents/ came to me as I was reflecting on
16
Removed:
how to improve the document creation process in my workplace. The
17
Removed:
GNU Emacs editor had captured my imagination and I wanted to
18
Removed:
create an accessible and highly productive text editor to benefit
19
Removed:
my organization. In this paper, I'll lay out my vision for the
20
Removed:
/Smart Document/, a file containing both text destined to the
21
Removed:
reader, and code describing how to update, validate, and present
22
Removed:
this text; then, I'll weave my personal GNU Emacs customizations
23
Removed:
with a tutorial. This paper is a /Smart Document/ itself!
15
Added:
The idea of /Smart Documents/ came to me as I was reflecting on how to
16
Added:
improve the document creation process in my workplace. The GNU Emacs
17
Added:
editor had captured my imagination and I wanted to create an
18
Added:
accessible and highly productive text editor to benefit my
19
Added:
organization. In this paper, I'll lay out my vision for the /Smart
20
Added:
Document/, a file containing both text destined to the reader, and
21
Added:
code describing how to update, validate, and present this text; then,
22
Added:
I'll weave my personal GNU Emacs customizations with a tutorial. This
23
Added:
paper is a /Smart Document/ itself!
24
24
#+LATEX: \end{abstract}
25
25
26
26
* Introduction
27
27
28
Removed:
GNU Emacs is most often used as a text editor. It would be unfair
29
Removed:
to say it is just that, because Emacs is capable of so much
30
Removed:
more. The utmost level of customization is afforded by enabling
31
Removed:
the user to rewrite /any/ part of the source code and observe the
32
Removed:
editor's modified behavior in real time. Since its inception in
33
Removed:
1984, GNU Emacs has grown to be much more than a full-featured,
34
Removed:
high-productivity text editor---new /modes/ have been written to
35
Removed:
interact with hundreds of file formats, including =.txt=, =.pdf=,
36
Removed:
=.jpg=, =.csv=, and =.zip= just to name a few. This paper itself
37
Removed:
was written in /Org mode/, a collection of functions enabling the
38
Removed:
harmonious mixing of code and comments in view of publication:
39
Removed:
this is the endgame of /literate programming/, and the basis of my
40
Removed:
vision for /Smart Documents/.
28
Added:
GNU Emacs is most often used as a text editor. It would be unfair to
29
Added:
say it is just that, because Emacs is capable of so much more. The
30
Added:
utmost level of customization is afforded by enabling the user to
31
Added:
rewrite /any/ part of the source code and observe the editor's
32
Added:
modified behavior in real time. Since its inception in 1984, GNU Emacs
33
Added:
has grown to be much more than a full-featured, high-productivity text
34
Added:
editor---new /modes/ have been written to interact with hundreds of
35
Added:
file formats, including =.txt=, =.pdf=, =.jpg=, =.csv=, and =.zip=
36
Added:
just to name a few. This paper itself was written in /Org mode/, a
37
Added:
collection of functions enabling the harmonious mixing of code and
38
Added:
comments in view of publication: this is the endgame of /literate
39
Added:
programming/, and the basis of my vision for /Smart Documents/.
41
40
42
Removed:
The following sections were laid out very deliberately. When we
43
Removed:
start Emacs, the source code blocks contained in this document are
44
Removed:
evaluated sequentially---our editing environment is constructed in
45
Removed:
real time as we execute the blocks in order. For instance, we only
46
Removed:
begin loading packages once we ensured ~use-package~ is working
47
Removed:
properly.[fn::For more information on the detailed steps Emacs
48
Removed:
takes upon starting, refer to
41
Added:
The following sections were laid out very deliberately. When we start
42
Added:
Emacs, the source code blocks contained in this document are evaluated
43
Added:
sequentially---our editing environment is constructed in real time as
44
Added:
we execute the blocks in order. For instance, we only begin loading
45
Added:
packages once we ensured ~use-package~ is working properly.[fn::For
46
Added:
more information on the detailed steps Emacs takes upon starting,
47
Added:
refer to
49
48
[[https://www.gnu.org/software/emacs/manual/html_node/elisp/Startup-Summary.html]].]
50
49
51
50
Customizing Emacs goes far, far beyond rewriting sections of this
52
51
document---feel free to experiment and discover. Here are three
53
Removed:
commands that will help you understand all the symbols in this
54
Removed:
file, if you are browsing this paper within Emacs itself:
52
Added:
commands that will help you understand all the symbols in this file,
53
Added:
if you are browsing this paper within Emacs itself:
55
54
56
55
- ~C-h f~ :: describe function
57
56
- ~C-h v~ :: describe variable
@@ -61,8 +60,8 @@
61
60
62
61
* First-time setup
63
62
64
Removed:
The following code blocks are normally evaluated once---upon
65
Removed:
starting Emacs for the first time.
63
Added:
The following code blocks are normally evaluated once---upon starting
64
Added:
Emacs for the first time.
66
65
67
66
** TODO Unpacking our literate configuration
68
67
:PROPERTIES:
@@ -108,8 +107,8 @@
108
107
** TODO User details
109
108
110
109
One advantage of working with /Smart Documents/ is that they can
111
Removed:
automatically be populated with our details in the header, footer,
112
Removed:
or other appropriate element.
110
Added:
automatically be populated with our details in the header, footer, or
111
Added:
other appropriate element.
113
112
114
113
#+NAME: user-details-get
115
114
#+BEGIN_SRC emacs-lisp
@@ -138,11 +137,10 @@
138
137
139
138
** File system paths
140
139
141
Removed:
In this subsection, we tell Emacs about relevant paths to
142
Removed:
resources.
140
Added:
In this subsection, we tell Emacs about relevant paths to resources.
143
141
144
Removed:
On my MS Windows machine, I add the path to Portable
145
Removed:
Git.[fn::Download from https://git-scm.com/download/win]
142
Added:
On my MS Windows machine, I add the path to Portable Git.[fn::Download
143
Added:
from https://git-scm.com/download/win]
146
144
147
145
#+BEGIN_SRC emacs-lisp :tangle yes
148
146
(when (string-equal system-type "windows-nt")
@@ -157,13 +155,13 @@
157
155
:END:
158
156
159
157
The contents of this Section was automatically moved to
160
Removed:
=~/.emacs.d/init.el=. Use `sd-pack-section' to copy the contents
161
Removed:
back into this section.
158
Added:
=~/.emacs.d/init.el=. Use `sd-pack-section' to copy the contents back
159
Added:
into this section.
162
160
163
Removed:
This is the very first user-editable file loaded by
164
Removed:
Emacs.[fn::This feature became available in version 27.1.] In it,
165
Removed:
we disable GUI elements that would otherwise be loaded and
166
Removed:
displayed once Emacs is ready to accept user input.
161
Added:
This is the very first user-editable file loaded by Emacs.[fn::This
162
Added:
feature became available in version 27.1.] In it, we disable GUI
163
Added:
elements that would otherwise be loaded and displayed once Emacs is
164
Added:
ready to accept user input.
167
165
168
166
It can be found here: [[file:early-init.el]]
169
167
@@ -188,8 +186,8 @@
188
186
** Profiling---start
189
187
190
188
We start the profiler now , and will interrupt it in Section
191
Removed:
[[Profiling---stop]]. We will then present profiling report in
192
Removed:
Section [[Profiling---report]].
189
Added:
[[Profiling---stop]]. We will then present profiling report in Section
190
Added:
[[Profiling---report]].
193
191
194
192
#+NAME: profiler-start
195
193
#+BEGIN_SRC emacs-lisp :tangle yes
@@ -223,17 +221,16 @@
223
221
224
222
** Meta-files
225
223
226
Removed:
In this section, we'll be tidying up the =.emacs.d/=
227
Removed:
directory---by default, many Emacs packages create files useful
228
Removed:
for themselves in our ~user-emacs-directory~. This leads to
229
Removed:
undesirable clutter. Certain packages create files that log
230
Removed:
recently visited files ([[Recently visited files]]); log location of
231
Removed:
known projects ([[Projects' bookmarks]]); log location in recently
232
Removed:
visited files ([[Location in previously visited file]]) The
233
Removed:
commonality between all these files is that they tend to
224
Added:
In this section, we'll be tidying up the =.emacs.d/= directory---by
225
Added:
default, many Emacs packages create files useful for themselves in our
226
Added:
~user-emacs-directory~. This leads to undesirable clutter. Certain
227
Added:
packages create files that log recently visited files ([[Recently
228
Added:
visited files]]); log location of known projects ([[Projects' bookmarks]]);
229
Added:
log location in recently visited files ([[Location in previously visited
230
Added:
file]]) The commonality between all these files is that they tend to
234
231
reference... other files. Thus, I decided to refer to them as
235
Removed:
meta-files. First, let's designate a folder to collect our
236
Removed:
meta-files together:
232
Added:
meta-files. First, let's designate a folder to collect our meta-files
233
Added:
together:
237
234
238
235
#+BEGIN_SRC emacs-lisp :tangle yes
239
236
(setq sd-meta-files-location (concat user-emacs-directory "meta/"))
@@ -265,9 +262,9 @@
265
262
266
263
*** Custom file
267
264
268
Removed:
Load settings created automatically by GNU Emacs Custom. (For
269
Removed:
example, any clickable option/toggle is saved here.) Useful for
270
Removed:
fooling around with ~M-x customize-group <package>~.
265
Added:
Load settings created automatically by GNU Emacs Custom. (For example,
266
Added:
any clickable option/toggle is saved here.) Useful for fooling around
267
Added:
with ~M-x customize-group <package>~.
271
268
272
269
#+NAME: custom-file-location
273
270
#+BEGIN_SRC emacs-lisp :tangle yes
@@ -309,9 +306,8 @@
309
306
310
307
*** GNU/Linux
311
308
312
Removed:
These settings affect the first and subsequent frames spawned by
313
Removed:
Emacs in GNU/Linux. Frame transparency increases when focus is
314
Removed:
lost.
309
Added:
These settings affect the first and subsequent frames spawned by Emacs
310
Added:
in GNU/Linux. Frame transparency increases when focus is lost.
315
311
316
312
#+BEGIN_SRC emacs-lisp :tangle yes
317
313
(when (and (display-graphic-p) (string-equal system-type "gnu/linux"))
@@ -321,8 +317,8 @@
321
317
322
318
** Secrets
323
319
324
Removed:
The code contained in the =secrets.org= file is loaded by Emacs,
325
Removed:
but not rendered in this PDF for the sake of privacy. It contains
320
Added:
The code contained in the =secrets.org= file is loaded by Emacs, but
321
Added:
not rendered in this PDF for the sake of privacy. It contains
326
322
individually identifying information such as names and e-mail
327
323
addresses, which are used to populate Org templates (Section
328
324
[[~org-mode~]]). You need to create this =secrets.org= file, as it is
@@ -335,22 +331,20 @@
335
331
336
332
* Keyboard shortcuts
337
333
338
Removed:
The following bindings strive to further enhance CUA
339
Removed:
mode.[fn::Common User Access. This is a term coined by IBM which
340
Removed:
has influenced user navigation cues on all modern desktop
341
Removed:
OSes. From IBM's CUA, we get the =Ctrl-c= and =Ctrl-v= keyboard
342
Removed:
shortcuts.]
334
Added:
The following bindings strive to further enhance CUA mode.[fn::Common
335
Added:
User Access. This is a term coined by IBM which has influenced user
336
Added:
navigation cues on all modern desktop OSes. From IBM's CUA, we get the
337
Added:
=Ctrl-c= and =Ctrl-v= keyboard shortcuts.]
343
338
344
339
#+BEGIN_SRC emacs-lisp :tangle yes
345
340
(cua-mode)
346
341
#+END_SRC
347
342
348
343
What follows are the most useful keybindings, as well as the
349
Removed:
keybindings to the functions we defined ourselves. It doesn't
350
Removed:
matter if we haven't defined the functions themselves yet; Emacs
351
Removed:
will accept a keybinding for any symbol and does not check if the
352
Removed:
symbol's function definition exists, until the keybinding is
353
Removed:
pressed.
344
Added:
keybindings to the functions we defined ourselves. It doesn't matter
345
Added:
if we haven't defined the functions themselves yet; Emacs will accept
346
Added:
a keybinding for any symbol and does not check if the symbol's
347
Added:
function definition exists, until the keybinding is pressed.
354
348
355
349
** Files
356
350
@@ -460,8 +454,7 @@
460
454
461
455
*** Open LHS & RHS sidebar
462
456
463
Removed:
We define bindings to open both the left-hand & right-hand
464
Removed:
sidebar.
457
Added:
We define bindings to open both the left-hand & right-hand sidebar.
465
458
466
459
#+BEGIN_SRC emacs-lisp :tangle yes
467
460
(global-set-key (kbd "<left-fringe> <mouse-1>")
@@ -480,8 +473,8 @@
480
473
481
474
*** Zoom
482
475
483
Removed:
The typical binding on both GNU/Linux and MS Windows is adequate here: ~C-=~ to
484
Removed:
zoom in, ~C--~ to zoom out.
476
Added:
The typical binding on both GNU/Linux and MS Windows is adequate here:
477
Added:
~C-=~ to zoom in, ~C--~ to zoom out.
485
478
486
479
It seems that starting with Emacs 27.1, Control + mousewheel works.
487
480
@@ -498,8 +491,8 @@
498
491
command. You may navigate in a buffer by keeping =Alt= pressed,
499
492
optionally inputting a number from the keypad or number row, then
500
493
pressing any of the following movement keys: =j=, =k=, =h=, and
501
Removed:
=l=. You will move in that direction in the amount of the
502
Removed:
numerical argument.
494
Added:
=l=. You will move in that direction in the amount of the numerical
495
Added:
argument.
503
496
504
497
#+NAME: keybinding-navigation
505
498
#+CAPTION[Navigation keybindings]: Navigation keybindings.
@@ -562,10 +555,9 @@
562
555
563
556
** One-click workflows
564
557
565
Removed:
A major advantage of the Emacs document production system:
566
Removed:
arbitrarily complicated functions can be assigned to very simple
567
Removed:
keybindings. This means we can automate workflows up to a pretty
568
Removed:
absurd level.
558
Added:
A major advantage of the Emacs document production system: arbitrarily
559
Added:
complicated functions can be assigned to very simple keybindings. This
560
Added:
means we can automate workflows up to a pretty absurd level.
569
561
570
562
*** Export to PDF
571
563
@@ -609,8 +601,8 @@
609
601
610
602
* Packages
611
603
612
Removed:
Packages are collections of =.el= files providing added
613
Removed:
functionality to Emacs.
604
Added:
Packages are collections of =.el= files providing added functionality
605
Added:
to Emacs.
614
606
615
607
** Meta
616
608
@@ -634,8 +626,8 @@
634
626
635
627
*** TODO Convenient package update
636
628
637
Removed:
One-function rollup of upgradeable package tagging, download and
638
Removed:
lazy install.
629
Added:
One-function rollup of upgradeable package tagging, download and lazy
630
Added:
install.
639
631
640
632
#+BEGIN_SRC emacs-lisp :tangle yes
641
633
@@ -679,8 +671,8 @@
679
671
*** Syntax checking
680
672
681
673
We require a package to highlight syntax errors and warnings. The
682
Removed:
~flycheck~ package ensures we are aware of all our code's
683
Removed:
syntactical shortcomings.
674
Added:
~flycheck~ package ensures we are aware of all our code's syntactical
675
Added:
shortcomings.
684
676
685
677
#+NAME: flycheck
686
678
#+BEGIN_SRC emacs-lisp :tangle yes
@@ -698,22 +690,22 @@
698
690
699
691
*** Insert template from keyword
700
692
701
Removed:
Thanks to ~yasnippet~, we can type certain keywords, then press
702
Removed:
=TAB=, to automatically insert a predefined text snippet. We can
703
Removed:
then navigate through the snippet by using =<tab>= (next field)
704
Removed:
and =<backtab>= (previous field).[fn::=<backtab>= is synonymous
705
Removed:
with pressing shift-tab.]
693
Added:
Thanks to ~yasnippet~, we can type certain keywords, then press =TAB=,
694
Added:
to automatically insert a predefined text snippet. We can then
695
Added:
navigate through the snippet by using =<tab>= (next field) and
696
Added:
=<backtab>= (previous field).[fn::=<backtab>= is synonymous with
697
Added:
pressing shift-tab.]
706
698
707
Removed:
For instance: typing =src= then pressing =TAB= will expand the
708
Removed:
keyword to the following text:
699
Added:
For instance: typing =src= then pressing =TAB= will expand the keyword
700
Added:
to the following text:
709
701
710
702
: #+BEGIN_SRC emacs-lisp :tangle yes
711
703
:
712
704
: #+END_SRC
713
705
714
706
We notice that emacs-lisp is highlighted---this is the first
715
Removed:
modifiable field. Many clever programming tricks can be performed
716
Removed:
with ~yasnippet~ to save us a ton of time with boilerplate text!
707
Added:
modifiable field. Many clever programming tricks can be performed with
708
Added:
~yasnippet~ to save us a ton of time with boilerplate text!
717
709
718
710
#+NAME: yasnippet
719
711
#+BEGIN_SRC emacs-lisp :tangle yes
@@ -740,8 +732,8 @@
740
732
741
733
*** Versioning of files
742
734
743
Removed:
Wonderful Git porcelain for Emacs. Enables the administration of a
744
Removed:
Git repository in a pain-free way.
735
Added:
Wonderful Git porcelain for Emacs. Enables the administration of a Git
736
Added:
repository in a pain-free way.
745
737
746
738
#+BEGIN_SRC emacs-lisp :tangle yes
747
739
(use-package magit
@@ -768,9 +760,9 @@
768
760
769
761
*** Jump to symbol's definition
770
762
771
Removed:
~dumb-jump~ is a reliable symbol definition finder. It uses
772
Removed:
different matching algorithms and heuristics to provide a very
773
Removed:
educated guess on the location of a symbol's definition.
763
Added:
~dumb-jump~ is a reliable symbol definition finder. It uses different
764
Added:
matching algorithms and heuristics to provide a very educated guess on
765
Added:
the location of a symbol's definition.
774
766
775
767
#+BEGIN_SRC emacs-lisp :tangle yes
776
768
(use-package dumb-jump)
@@ -890,8 +882,8 @@
890
882
*** Accounting
891
883
892
884
Ledger is a creation of John Wiegley's. It enables double-entry
893
Removed:
accounting in a simple plaintext format, and reliable verification
894
Removed:
of account balances through time.[fn::For more information, visit
885
Added:
accounting in a simple plaintext format, and reliable verification of
886
Added:
account balances through time.[fn::For more information, visit
895
887
https://www.ledger-cli.org/.]
896
888
897
889
#+BEGIN_SRC emacs-lisp :tangle yes
@@ -980,8 +972,8 @@
980
972
981
973
*** Highlight /color/ keywords in that color
982
974
983
Removed:
This highlights hexadecimal numbers which look like colors, in
984
Removed:
that same color.
975
Added:
This highlights hexadecimal numbers which look like colors, in that
976
Added:
same color.
985
977
986
978
#+BEGIN_SRC emacs-lisp :tangle yes
987
979
(use-package rainbow-mode
@@ -1003,8 +995,8 @@
1003
995
*** Emojis
1004
996
1005
997
Emojis are a symbol of modernity, and their tasteful use enables
1006
Removed:
communicating with people from around the world---we're all for
1007
Removed:
that! B-) \smiley
998
Added:
communicating with people from around the world---we're all for that!
999
Added:
B-) \smiley
1008
1000
1009
1001
#+BEGIN_SRC emacs-lisp :tangle yes
1010
1002
(use-package emojify
@@ -1013,26 +1005,26 @@
1013
1005
1014
1006
* ~org-mode~
1015
1007
1016
Removed:
Org mode is so significant that this section of the paper deserves
1017
Removed:
its own introduction.
1008
Added:
Org mode is so significant that this section of the paper deserves its
1009
Added:
own introduction.
1018
1010
1019
1011
** Introduction
1020
1012
1021
Removed:
Phew, after all this initialization, I can finally introduce Org
1022
Removed:
mode! I am so *excited*.
1013
Added:
Phew, after all this initialization, I can finally introduce Org mode!
1014
Added:
I am so *excited*.
1023
1015
1024
1016
Org mode replaces aword processor, a presentation creator, and a
1025
Removed:
spreadsheet editor. The spreadsheet ability captures more than 80%
1026
Removed:
use cases wherein one wishes to include a table in a text document
1017
Added:
spreadsheet editor. The spreadsheet ability captures more than 80% use
1018
Added:
cases wherein one wishes to include a table in a text document
1027
1019
destined for physical publication. (It is clear that Excel
1028
1020
spreadsheets are /not/ destined for physical publication---simply
1029
Removed:
attempt to print an Excel spreadsheet with the default settings.)
1030
Removed:
In my opinion, Org mode matches all /useful/ features of the
1031
Removed:
Microsoft Office suite 1-to-1.
1021
Added:
attempt to print an Excel spreadsheet with the default settings.) In
1022
Added:
my opinion, Org mode matches all /useful/ features of the Microsoft
1023
Added:
Office suite 1-to-1.
1032
1024
1033
Removed:
What follows are customizations designed to make Org mode behave
1034
Removed:
more like Microsoft Word. The end goal is, once again, to draw as
1035
Removed:
many new users to Emacs as possible!
1025
Added:
What follows are customizations designed to make Org mode behave more
1026
Added:
like Microsoft Word. The end goal is, once again, to draw as many new
1027
Added:
users to Emacs as possible!
1036
1028
1037
1029
Check out how much information Org mode keeps concerning the most
1038
1030
recent header:
@@ -1055,8 +1047,8 @@
1055
1047
1056
1048
*** Base folder
1057
1049
1058
Removed:
Org base directory is in user home on GNU/Linux, or in =AppData=
1059
Removed:
in MS Windows.
1050
Added:
Org base directory is in user home on GNU/Linux, or in =AppData= in MS
1051
Added:
Windows.
1060
1052
1061
1053
#+NAME: org-directory
1062
1054
#+BEGIN_SRC emacs-lisp :tangle yes
@@ -1071,11 +1063,10 @@
1071
1063
1072
1064
** Org cosmetics
1073
1065
1074
Removed:
First, we ensure the display of markup symbols for *bold*,
1075
Removed:
/italic/, _underlined_ and +strikethrough+ text, and ensure our
1076
Removed:
document appears indented upon loading.[fn::It /appears/ indented,
1077
Removed:
but the underlying plaintext file does not contain tab
1078
Removed:
characters!]
1066
Added:
First, we ensure the display of markup symbols for *bold*, /italic/,
1067
Added:
_underlined_ and +strikethrough+ text, and ensure our document appears
1068
Added:
indented upon loading.[fn::It /appears/ indented, but the underlying
1069
Added:
plaintext file does not contain tab characters!]
1079
1070
1080
1071
We then set values for many other Org-related cosmetic symbols.
1081
1072
@@ -1091,11 +1082,11 @@
1091
1082
1092
1083
*** Dynamic numbering of headlines
1093
1084
1094
Removed:
We enable the dynamic numbering of headlines in an Org buffer. We
1095
Removed:
also set the numbering face to ~org-special-keyword~, which
1096
Removed:
specifies a ~:background white~ attribute. This is necessary
1097
Removed:
because otherwise, the background of the numbering may be
1098
Removed:
overridden by the ~TODO~ face attribute ~:background coral~.
1085
Added:
We enable the dynamic numbering of headlines in an Org buffer. We also
1086
Added:
set the numbering face to ~org-special-keyword~, which specifies a
1087
Added:
~:background white~ attribute. This is necessary because otherwise,
1088
Added:
the background of the numbering may be overridden by the ~TODO~ face
1089
Added:
attribute ~:background coral~.
1099
1090
1100
1091
#+BEGIN_SRC emacs-lisp :tangle yes
1101
1092
(add-hook 'org-mode-hook 'org-num-mode)
@@ -1103,10 +1094,10 @@
1103
1094
#+END_SRC
1104
1095
1105
1096
By default, we hide Org document properties such as =#+TITLE=,
1106
Removed:
=#+AUTHOR=, and =#+DATE=, because those keywords are defined when
1107
Removed:
the document template is populated. We can nevertheless always
1108
Removed:
access those properties and edit them manually, with a simple
1109
Removed:
keyboard shortcut (cf. Section [[Open Org mode document properties]]).
1097
Added:
=#+AUTHOR=, and =#+DATE=, because those keywords are defined when the
1098
Added:
document template is populated. We can nevertheless always access
1099
Added:
those properties and edit them manually, with a simple keyboard
1100
Added:
shortcut (cf. Section [[Open Org mode document properties]]).
1110
1101
1111
1102
*** Document properties
1112
1103
@@ -1156,8 +1147,8 @@
1156
1147
1157
1148
** Programming a Smart Documents
1158
1149
1159
Removed:
The following languages can be used inside =SRC= blocks, in view
1160
Removed:
of being executed by the Org Babel backend upon document export.
1150
Added:
The following languages can be used inside =SRC= blocks, in view of
1151
Added:
being executed by the Org Babel backend upon document export.
1161
1152
1162
1153
#+BEGIN_SRC emacs-lisp :tangle yes
1163
1154
(setq org-babel-load-languages
@@ -1178,10 +1169,10 @@
1178
1169
1179
1170
** Agenda
1180
1171
1181
Removed:
The agenda displays a chronological list of headings across all
1182
Removed:
agenda files for which the heading or body contain a matching
1183
Removed:
=org-time-stamp=.[fn::An =org-time-stamp= can be inserted with
1184
Removed:
~C-c .~ (period)]
1172
Added:
The agenda displays a chronological list of headings across all agenda
1173
Added:
files for which the heading or body contain a matching
1174
Added:
=org-time-stamp=.[fn::An =org-time-stamp= can be inserted with ~C-c .~
1175
Added:
(period)]
1185
1176
1186
1177
We open the agenda in a separate window.
1187
1178
@@ -1191,14 +1182,14 @@
1191
1182
1192
1183
** LaTeX export
1193
1184
1194
Removed:
We'll be compiling our documents with LuaTeX. This will afford us
1195
Removed:
some future-proofing, since it was designated as the successor to
1196
Removed:
pdfTeX by the latter's creators.
1185
Added:
We'll be compiling our documents with LuaTeX. This will afford us some
1186
Added:
future-proofing, since it was designated as the successor to pdfTeX by
1187
Added:
the latter's creators.
1197
1188
1198
Removed:
First, we define the command executed when an Org file is exported
1199
Removed:
to LaTeX. We'll use =latexmk=, the Perl script which automagically
1200
Removed:
runs binaries related to LaTeX in the correct order and the right
1201
Removed:
amount of times.
1189
Added:
First, we define the command executed when an Org file is exported to
1190
Added:
LaTeX. We'll use =latexmk=, the Perl script which automagically runs
1191
Added:
binaries related to LaTeX in the correct order and the right amount of
1192
Added:
times.
1202
1193
1203
1194
Options and why we need them:
1204
1195
- ~-shell-excape~ :: required by minted to color source blocks
@@ -1216,8 +1207,8 @@
1216
1207
*** Exporting timestamps
1217
1208
1218
1209
We customize the format for org time stamps to make them appear
1219
Removed:
monospaced in our exported LaTeX documents. This makes them
1220
Removed:
visually distinguishable from body text.
1210
Added:
monospaced in our exported LaTeX documents. This makes them visually
1211
Added:
distinguishable from body text.
1221
1212
1222
1213
#+BEGIN_SRC emacs-lisp :tangle yes
1223
1214
(setq org-latex-active-timestamp-format
@@ -1228,8 +1219,7 @@
1228
1219
1229
1220
*** LaTeX packages
1230
1221
1231
Removed:
The following packages are loaded for every time we export to
1232
Removed:
LaTeX.
1222
Added:
The following packages are loaded for every time we export to LaTeX.
1233
1223
1234
1224
#+BEGIN_SRC emacs-lisp :tangle yes
1235
1225
(setq org-latex-packages-alist
@@ -1253,8 +1243,8 @@
1253
1243
1254
1244
*** Colored source blocks in PDF export
1255
1245
1256
Removed:
Little bonus for GNU/Linux users: syntax highlighting for source
1257
Removed:
code blocks in LaTeX exports.
1246
Added:
Little bonus for GNU/Linux users: syntax highlighting for source code
1247
Added:
blocks in LaTeX exports.
1258
1248
1259
1249
#+BEGIN_SRC emacs-lisp :tangle yes
1260
1250
(when (string-equal system-type "gnu/linux")
@@ -1269,8 +1259,8 @@
1269
1259
*** Cleaning directory after export
1270
1260
1271
1261
Now, we set the files to be deleted when a LaTeX \rightarrow PDF
1272
Removed:
compilation occurs. We only care about two files, in the end: the
1273
Removed:
Org mode file for edition, and the PDF for distribution.
1262
Added:
compilation occurs. We only care about two files, in the end: the Org
1263
Added:
mode file for edition, and the PDF for distribution.
1274
1264
1275
1265
#+BEGIN_SRC emacs-lisp :tangle yes
1276
1266
(setq org-latex-logfiles-extensions
@@ -1282,16 +1272,16 @@
1282
1272
1283
1273
*** Chronological diary entries
1284
1274
1285
Removed:
By default, Org agenda inserts diary entries as the first under
1286
Removed:
the selected date. It is preferable to insert entries in the order
1287
Removed:
that they were recorded, i.e. chronologically.
1275
Added:
By default, Org agenda inserts diary entries as the first under the
1276
Added:
selected date. It is preferable to insert entries in the order that
1277
Added:
they were recorded, i.e. chronologically.
1288
1278
1289
1279
#+BEGIN_SRC emacs-lisp :tangle yes
1290
1280
(setq org-agenda-insert-diary-strategy 'date-tree-last)
1291
1281
#+END_SRC
1292
1282
1293
Removed:
What follows is an additional document class structures that can
1294
Removed:
be exported in LaTeX.
1283
Added:
What follows is an additional document class structures that can be
1284
Added:
exported in LaTeX.
1295
1285
1296
1286
#+BEGIN_SRC emacs-lisp :tangle no
1297
1287
;; (add-to-list 'org-latex-classes
@@ -1305,25 +1295,24 @@
1305
1295
1306
1296
*** Table of contents
1307
1297
1308
Removed:
By default, body text can immediately follow the table of
1309
Removed:
contents. It is however cleaner to separate table of contents with
1310
Removed:
the rest of the work.
1298
Added:
By default, body text can immediately follow the table of contents. It
1299
Added:
is however cleaner to separate table of contents with the rest of the
1300
Added:
work.
1311
1301
1312
1302
#+BEGIN_SRC emacs-lisp :tangle yes
1313
1303
(setq org-latex-toc-command "\\tableofcontents\\clearpage")
1314
1304
#+END_SRC
1315
1305
1316
Removed:
The following makes =TODO= items appear red and =CLOSED= items
1317
Removed:
appear green in Org's LaTeX exports. Very stylish, much flair!
1306
Added:
The following makes =TODO= items appear red and =CLOSED= items appear
1307
Added:
green in Org's LaTeX exports. Very stylish, much flair!
1318
1308
1319
1309
** TODO Org links
1320
1310
1321
Removed:
This is a mind-bending capacity of Org mode: we can assign
1322
Removed:
arbitrary functions to be executed when a user follows an Org
1323
Removed:
link. Org links appear like hyperlinks both in buffers and PDF
1324
Removed:
exports---e.g. the following link to this very section, Section
1325
Removed:
[[Org links]]---but their in-buffer behavior can be arbitrarily
1326
Removed:
assigned.
1311
Added:
This is a mind-bending capacity of Org mode: we can assign arbitrary
1312
Added:
functions to be executed when a user follows an Org link. Org links
1313
Added:
appear like hyperlinks both in buffers and PDF exports---e.g. the
1314
Added:
following link to this very section, Section [[Org links]]---but their
1315
Added:
in-buffer behavior can be arbitrarily assigned.
1327
1316
1328
1317
#+BEGIN_SRC emacs-lisp :tangle no
1329
1318
(org-add-link-type
@@ -1339,17 +1328,17 @@
1339
1328
1340
1329
* One-click workflows
1341
1330
1342
Removed:
In this section, we'll implement useful one-click workflows. It
1343
Removed:
comes later keybinding definitions for two reasons:
1331
Added:
In this section, we'll implement useful one-click workflows. It comes
1332
Added:
later keybinding definitions for two reasons:
1344
1333
1345
1334
1. To a new user, keybindings are more important than the precise
1346
Removed:
implementation of the bound function---it is more important to
1347
Removed:
know how to drive a car than how a car works.
1348
Removed:
2. If the following subsections share the same name as the
1349
Removed:
keybinding subsection (Section [[Keyboard shortcuts]]), the links
1350
Removed:
will resolve to the earliest heading in the document, i.e. the
1351
Removed:
keybinding subsection and not the subsection describing the
1352
Removed:
`one-click workflow'.
1335
Added:
implementation of the bound function---it is more important to know
1336
Added:
how to drive a car than how a car works.
1337
Added:
2. If the following subsections share the same name as the keybinding
1338
Added:
subsection (Section [[Keyboard shortcuts]]), the links will resolve to
1339
Added:
the earliest heading in the document, i.e. the keybinding
1340
Added:
subsection and not the subsection describing the `one-click
1341
Added:
workflow'.
1353
1342
1354
1343
** TODO Export to PDF
1355
1344
@@ -1452,8 +1441,8 @@
1452
1441
:END:
1453
1442
1454
1443
We start by defining some icons we wish to include in our user
1455
Removed:
interface. Emacs allows the usage of GIF images---this paves the
1456
Removed:
way for UI elements which may be animated.
1444
Added:
interface. Emacs allows the usage of GIF images---this paves the way
1445
Added:
for UI elements which may be animated.
1457
1446
1458
1447
#+BEGIN_SRC emacs-lisp :tangle yes
1459
1448
(defcustom sd-icon-loading
@@ -1476,9 +1465,8 @@
1476
1465
**** Header line
1477
1466
1478
1467
In Org mode, the document header line will be the title of the
1479
Removed:
document we are working on currently. We start by defining
1480
Removed:
keybindings for our header line buttons for navigating through
1481
Removed:
open windows.
1468
Added:
document we are working on currently. We start by defining keybindings
1469
Added:
for our header line buttons for navigating through open windows.
1482
1470
1483
1471
#+BEGIN_SRC emacs-lisp :tangle yes
1484
1472
(defvar sd-header-line-previous-buffer-keymap
@@ -1544,9 +1532,9 @@
1544
1532
1545
1533
**** Mode line
1546
1534
1547
Removed:
This interpretation of the ideal mode line is the result of
1548
Removed:
carefully studying the default ~mode-line~, as well as studying
1549
Removed:
various customizations online.
1535
Added:
This interpretation of the ideal mode line is the result of carefully
1536
Added:
studying the default ~mode-line~, as well as studying various
1537
Added:
customizations online.
1550
1538
1551
1539
#+BEGIN_SRC emacs-lisp :tangle yes
1552
1540
(defvar sd-mode-line-lock-buffer-keymap
@@ -1592,11 +1580,10 @@
1592
1580
1593
1581
*** Column filling
1594
1582
1595
Removed:
A line of text is considered ``filled'' when it reaches 79
1596
Removed:
characters in length.
1583
Added:
A line of text is considered ``filled'' when it reaches 70 characters
1584
Added:
in length.
1597
1585
1598
1586
#+BEGIN_SRC emacs-lisp :tangle yes
1599
Removed:
(setq-default fill-column 66)
1600
1587
(add-hook 'org-mode-hook
1601
1588
'turn-on-auto-fill) ; Automatically break lines longer
1602
1589
; than =fill-column=.
@@ -1607,8 +1594,7 @@
1607
1594
*** Beautiful symbols
1608
1595
1609
1596
We want the Emacs Lisp keyword =lambda= to be rendered as \lambda
1610
Removed:
within the editor. This is mostly for a subjective ``cool''
1611
Removed:
factor.
1597
Added:
within the editor. This is mostly for a subjective ``cool'' factor.
1612
1598
1613
1599
#+BEGIN_SRC emacs-lisp :tangle yes
1614
1600
(global-prettify-symbols-mode 1)
@@ -1640,9 +1626,9 @@
1640
1626
*** Electric modes
1641
1627
1642
1628
Electricity is a very important technology. In Emacs jargon,
1643
Removed:
``electric'' modes tend to automate behaviors or present some
1644
Removed:
elegant simplification to a workflow.[fn::More information can be
1645
Removed:
found at [[https://www.emacswiki.org/emacs/Electricity]].]
1629
Added:
``electric'' modes tend to automate behaviors or present some elegant
1630
Added:
simplification to a workflow.[fn::More information can be found at
1631
Added:
[[https://www.emacswiki.org/emacs/Electricity]].]
1646
1632
1647
1633
#+BEGIN_SRC emacs-lisp :tangle yes
1648
1634
(electric-pair-mode) ; Certain character pairs are automatically completed.
@@ -1651,7 +1637,8 @@
1651
1637
1652
1638
** Minibuffer
1653
1639
1654
Removed:
We replace the longer ~yes-or-no-p~ questions with more convenient ~y-or-n-p~.
1640
Added:
We replace the longer ~yes-or-no-p~ questions with more convenient
1641
Added:
~y-or-n-p~.
1655
1642
1656
1643
#+BEGIN_SRC emacs-lisp :tangle yes
1657
1644
(defalias 'yes-or-no-p 'y-or-n-p)
@@ -1682,11 +1669,10 @@
1682
1669
*** Colors
1683
1670
1684
1671
The default face is a black foreground on a white background, this
1685
Removed:
matches MS Word. We are striving for a simple, intuitive color
1686
Removed:
scheme.
1672
Added:
matches MS Word. We are striving for a simple, intuitive color scheme.
1687
1673
1688
Removed:
Most of the visual cues derived from color are identical in both
1689
Removed:
light and dark themes (Table [[theme-color-1]]).
1674
Added:
Most of the visual cues derived from color are identical in both light
1675
Added:
and dark themes (Table [[theme-color-1]]).
1690
1676
1691
1677
#+NAME: theme-color-1
1692
1678
#+CAPTION[Light and dark themes' colors]: Light and dark themes' colors.
@@ -1709,18 +1695,18 @@
1709
1695
1710
1696
*** Cursors
1711
1697
1712
Removed:
In order to imitate other modern text editors, we resort to a
1713
Removed:
blinking bar cursor. We choose red, the most captivating color,
1714
Removed:
because the cursor is arguably the region on our screen:
1698
Added:
In order to imitate other modern text editors, we resort to a blinking
1699
Added:
bar cursor. We choose red, the most captivating color, because the
1700
Added:
cursor is arguably the region on our screen:
1715
1701
1716
1702
1. most often looked at;
1717
1703
2. most often searched when lost.
1718
1704
1719
Removed:
In files containing only ~fixed-pitch~ fonts (i.e. files containing only code),
1720
Removed:
the cursor becomes a high-visibility box.
1705
Added:
In files containing only ~fixed-pitch~ fonts (i.e. files containing
1706
Added:
only code), the cursor becomes a high-visibility box.
1721
1707
1722
Removed:
In files containing a mix of ~variable-pitch~ and ~fixed-pitch~ fonts, the
1723
Removed:
cursor is a more MS Word-like bar.
1708
Added:
In files containing a mix of ~variable-pitch~ and ~fixed-pitch~ fonts,
1709
Added:
the cursor is a more MS Word-like bar.
1724
1710
1725
1711
#+BEGIN_SRC emacs-lisp :tangle yes
1726
1712
(setq-default cursor-type 'bar)
@@ -1787,10 +1773,10 @@
1787
1773
[[~/.emacs.d/img/smart-documents/ClaudeGaramond.jpeg]]
1788
1774
1789
1775
#+LATEX: \garamond
1790
Removed:
\lettrine{G}{ood} golly, nobody wishes for a /pedestrian/ theme!
1791
Removed:
Let your entourage know that you're rocking an editor fit for a
1792
Removed:
king with this finely crafted `wealthy' theme. Selecting it shall
1793
Removed:
enable the following fancitudes:
1776
Added:
\lettrine{G}{ood} golly, nobody wishes for a /pedestrian/ theme! Let
1777
Added:
your entourage know that you're rocking an editor fit for a king with
1778
Added:
this finely crafted `wealthy' theme. Selecting it shall enable the
1779
Added:
following fancitudes:
1794
1780
1795
1781
1. The default font shall be sublimed in the form of /EB Garamond/
1796
1782
2. Bullets will be tastefully replaced with pointing fingers
@@ -1800,14 +1786,14 @@
1800
1786
\lettrine{C}{laude} Garamont (c. 1510--1561), known commonly as
1801
1787
*Claude Garamond*, was a French type designer, publisher and
1802
1788
punch-cutter based in Paris. Garamond worked as an engraver of
1803
Removed:
punches, the masters used to stamp matrices, the moulds used to
1804
Removed:
cast metal type. He worked in the tradition now called old-style
1805
Removed:
serif design, which produced letters with a relatively organic
1806
Removed:
structure resembling handwriting with a pen but with a slightly
1807
Removed:
more structured and upright design. Considered one of the leading
1808
Removed:
type designers of all time, he is recognised to this day for the
1809
Removed:
elegance of his typefaces. Many old-style serif typefaces are
1810
Removed:
collectively known as Garamond, named after the designer.
1789
Added:
punches, the masters used to stamp matrices, the moulds used to cast
1790
Added:
metal type. He worked in the tradition now called old-style serif
1791
Added:
design, which produced letters with a relatively organic structure
1792
Added:
resembling handwriting with a pen but with a slightly more structured
1793
Added:
and upright design. Considered one of the leading type designers of
1794
Added:
all time, he is recognised to this day for the elegance of his
1795
Added:
typefaces. Many old-style serif typefaces are collectively known as
1796
Added:
Garamond, named after the designer.
1811
1797
1812
1798
From [[https://en.wikipedia.org/wiki/Claude_Garamond]]
1813
1799
#+END_QUOTE
@@ -1829,8 +1815,8 @@
1829
1815
* Late setup
1830
1816
1831
1817
At this point, our editor is almost ready to run. Phew! All that's
1832
Removed:
left to do is to interrupt our profiling activities, and smartly
1833
Removed:
store the result of our profiling.
1818
Added:
left to do is to interrupt our profiling activities, and smartly store
1819
Added:
the result of our profiling.
1834
1820
1835
1821
** Profiling---stop
1836
1822