diff options
author | Mountain Man <43313373+MountainMan1312@users.noreply.github.com> | 2023-06-05 22:12:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-05 22:12:10 -0400 |
commit | 9c6159ac3993dcd52b34ccb5d5693681c688c75e (patch) | |
tree | ff5d5fd3c6ab2b7319a6aafaf1f3a450a57c4010 /STYLE_GUIDE.md | |
parent | Fix window management keybinds for EXWM (diff) | |
parent | Mass cleanup of mistakes, bad idea but fuck it (diff) | |
download | mmosmacs-9c6159ac3993dcd52b34ccb5d5693681c688c75e.tar.gz mmosmacs-9c6159ac3993dcd52b34ccb5d5693681c688c75e.tar.bz2 mmosmacs-9c6159ac3993dcd52b34ccb5d5693681c688c75e.zip |
Merge `cleanup-everything` branch to `stable` branch
Diffstat (limited to 'STYLE_GUIDE.md')
-rw-r--r-- | STYLE_GUIDE.md | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/STYLE_GUIDE.md b/STYLE_GUIDE.md index d1e4e6b..568f63e 100644 --- a/STYLE_GUIDE.md +++ b/STYLE_GUIDE.md | |||
@@ -13,40 +13,27 @@ Much of this Style Guide was taken from | |||
13 | 13 | ||
14 | ## Organization | 14 | ## Organization |
15 | 15 | ||
16 | Emacs Lisp files should begin with a header. The first line of the | 16 | Emacs Lisp files should begin with a header. The first line of the header should include the filename, a very brief comment (2-5 words), and the `-*- lexical-binding: t; -*-` thing. The next line should be `;;`, and the next should be `;;; Commentary:`, below which should be a more detailed description of the file and it's purpose, as well as any important notes or warnings. |
17 | header should include the filename, a very brief comment (2-5 words), | ||
18 | and the `-*- lexical-binding: t; -*-` thing. The next line(s) should be | ||
19 | a more detailed description of the file and it's purpose. | ||
20 | 17 | ||
21 | ```elisp | 18 | ```elisp |
22 | ;;; -*- lexical-binding: t; -*- | 19 | ;;; init.el --- Init file for MMOSMacs -*- lexical-binding: t; -*- |
23 | ;;; init.el | ||
24 | ;; | 20 | ;; |
25 | ;; Main config file for MMOSMacs; the glue that binds the modules | 21 | ;;; Commentary: |
26 | ;; together. Provides package management, performance tweaks, and | 22 | ;; Main config file for MMOSMacs. |
27 | ;; integrates all the other MMOSMacs modules. | ||
28 | ``` | 23 | ``` |
29 | 24 | ||
30 | All Emacs Lisp files are organized into Sections and Subsections using | 25 | All Emacs Lisp files are organized into Sections and Subsections using comment decorations. Section titles begin with `;;;` and their decorations extend up to 72 chars. Subsections begin with `;;` and their decorations extend up to 36 chars. Titles should be underlined with dashes on the proceeding line. Explanatory comments go below the |
31 | comment decorations. Section titles begin with `;;;`, are ALL CAPS, and | 26 | title underline, and an additional 36-or-72-char line goes at the bottom of the header. |
32 | their decorations extend up to 72 chars. Subsections begin with `;;` | ||
33 | and their decorations extend up to 36 chars. Titles should be underlined | ||
34 | with dashes on the proceeding line. Explanatory comments go below the | ||
35 | title underline, and an additional 36-or-72-char line goes at the bottom | ||
36 | of the header. | ||
37 | 27 | ||
38 | Each subsection should have 2 blank lines between the top line of the | 28 | Each subsection should have 2 blank lines between the top line of the header and the bottom line of code from the previous subsection. Only one line goes between the Section header and the first Subsection, as well as between portions of code within the same subsection. 4 lines go between a new Section header and the previous bit of code. |
39 | header and the bottom line of code from the previous subsection. Only | ||
40 | one line goes between the Section header and the first Subsection, as | ||
41 | well as between portions of code within the same subsection. 4 lines go | ||
42 | between a new Section header and the previous bit of code. | ||
43 | 29 | ||
44 | ```elisp | 30 | ```elisp |
45 | ;; integrates all the other MMOSMacs modules. | 31 | ;;; Commentary: |
32 | ;; Main configuration file for MMOSMacs. | ||
46 | 33 | ||
47 | 34 | ||
48 | ;; --------------------------------------------------------------------- | 35 | ;; --------------------------------------------------------------------- |
49 | ;;; FIRST SECTION TITLE | 36 | ;;; First Section Title |
50 | ;; -------------------- | 37 | ;; -------------------- |
51 | ;; Comments about the purpose of the section go here. | 38 | ;; Comments about the purpose of the section go here. |
52 | ;; It should be concise. Don't go into too much detail. | 39 | ;; It should be concise. Don't go into too much detail. |
@@ -72,7 +59,8 @@ between a new Section header and the previous bit of code. | |||
72 | (setq some-crap nil)) | 59 | (setq some-crap nil)) |
73 | 60 | ||
74 | ;; `something-else` is a little less | 61 | ;; `something-else` is a little less |
75 | ;; likely to be a package | 62 | ;; likely to be a package, but it |
63 | ;; wouldn't surprise me | ||
76 | (use-package something-else | 64 | (use-package something-else |
77 | :straight t) | 65 | :straight t) |
78 | 66 | ||
@@ -87,7 +75,7 @@ between a new Section header and the previous bit of code. | |||
87 | ;; I really don't know what to write | 75 | ;; I really don't know what to write |
88 | ;; in these example comments. | 76 | ;; in these example comments. |
89 | (use-package some-other-thing | 77 | (use-package some-other-thing |
90 | :straight | 78 | :straight t |
91 | :init | 79 | :init |
92 | (other-thing-mode)) | 80 | (other-thing-mode)) |
93 | 81 | ||
@@ -107,8 +95,8 @@ between a new Section header and the previous bit of code. | |||
107 | 95 | ||
108 | - Write heading comments with 3 semicolons, and regular comments with 2. | 96 | - Write heading comments with 3 semicolons, and regular comments with 2. |
109 | - Write margin comments with 1 semicolon. | 97 | - Write margin comments with 1 semicolon. |
110 | - Leave 1 space between the semicolons and the comment text. | 98 | - Put a space between the semicolon and the text for heading and regular comments. |
111 | - Comments longer than 1 word are capitalized and use punctuation. | 99 | - Do not put a space between the semicolon and the text for margin comments. |
112 | 100 | ||
113 | ```elisp | 101 | ```elisp |
114 | ;;; This is a heading comment | 102 | ;;; This is a heading comment |
@@ -116,7 +104,7 @@ between a new Section header and the previous bit of code. | |||
116 | ;; Something something something. | 104 | ;; Something something something. |
117 | (defun foo (bar) | 105 | (defun foo (bar) |
118 | (something something | 106 | (something something |
119 | something-else)) ; for some other reason | 107 | something-else)) ;this is a margin comment |
120 | ``` | 108 | ``` |
121 | 109 | ||
122 | 110 | ||