From f95e0508323d3ad9743b9f68b773f350753db697 Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Wed, 16 Nov 2022 21:10:34 +0000 Subject: [PATCH] chore(docs): add elisp documentation for each file Apparently this is customary for Emacs configuration files. Doom seems to do this too, so here it is. --- init.el | 11 +++++++++++ lisp/editor.el | 14 ++++++++++++-- lisp/interface.el | 12 +++++++++++- lisp/keybinds.el | 12 +++++++++++- lisp/languages.el | 10 ++++++++++ lisp/org-mode.el | 11 ++++++++++- lisp/performance.el | 10 +++++++++- 7 files changed, 74 insertions(+), 6 deletions(-) diff --git a/init.el b/init.el index 158d200..c772382 100644 --- a/init.el +++ b/init.el @@ -1,3 +1,12 @@ +;;; init.el --- Dianciemacs -*- lexical-binding: t; -*- +;;; Commentary: +;; +;; This is a minimal and elegant Emacs configuration framework. +;; This project aims to keep/make Emacs fast, aesthetic, and beginner-friendly. +;; Maintained by devraza +;; +;;; Code: + ;; Disable Emacs' GTK decorations. Done in this file otherwise done too late. (menu-bar-mode -1) (tool-bar-mode -1) @@ -46,3 +55,5 @@ (add-to-list 'load-path (concat user-emacs-directory (convert-standard-filename "user/"))) (load "init") + +;;; init.el ends here diff --git a/lisp/editor.el b/lisp/editor.el index 609c181..7313ce4 100644 --- a/lisp/editor.el +++ b/lisp/editor.el @@ -1,4 +1,11 @@ -;; This file customizes Emacs' editor +;;; lisp/editor.el --- Default configration for Dianciemacs' editor -*- lexical-binding: t; -*- +;;; Commentary: +;; +;; Emacs' default editing experience sucks a lot. There's too much most people +;; will never need and I personally believe modal keybinds to be superior. +;; So, there's a lot changes Dianciemacs will be making to the editor, all of which can be seen in this file. +;; +;;; Code: ;; Quit input dialogues after pressing escape once (global-set-key (kbd "") 'keyboard-escape-quit) @@ -53,7 +60,8 @@ ;; rainbow-mode - Colourful colour codes! (use-package rainbow-mode - :hook (prog-mode . rainbow-mode)) + :hook + (prog-mode . rainbow-mode)) ;; Keybinds ;; Enable which-key @@ -76,3 +84,5 @@ "m" '(:wk "Magit") "w" '(:wk "Evil") "p" '(:wk "Projects")) + +;;; editor.el ends here diff --git a/lisp/interface.el b/lisp/interface.el index 2e26ace..dc7c7d0 100644 --- a/lisp/interface.el +++ b/lisp/interface.el @@ -1,4 +1,12 @@ -;; This file contains configuration for Emacs interface elements. +;;; lisp/interface.el --- Changes to Emacs' interface -*- lexical-binding: t; -*- +;;; Commentary: +;; +;; Emacs has a little too much going on in it's interface by default - things +;; like GTK dialog boxes for quitting, a scroll bar, a menu bar, etc. are all +;; unnecessary for most users - so disabling that is done right in this file. +;; Additionally, the default theme isn't very aesthetic, so that obviously needs to change too. +;; +;;; Code: ;; Stop Emacs from resizing the window at startup (setq frame-resize-pixelwise t) @@ -57,3 +65,5 @@ (use-package diredfl ; Colourise dired! :hook dired-mode) + +;;; interface.el ends here diff --git a/lisp/keybinds.el b/lisp/keybinds.el index a0035c2..7d21e5e 100644 --- a/lisp/keybinds.el +++ b/lisp/keybinds.el @@ -1,4 +1,12 @@ -;; This file contains keybindings for Dianciemacs +;;; lisp/keybinds.el --- Some default keybinds for Dianciemacs' -*- lexical-binding: t; -*- +;;; Commentary: +;; +;; There's not much to say about this section. Keybinds are a very important +;; part of an editor's editing experience, and in Dianciemacs keys are bound to +;; leader-key (SPC by default). Changing the leader-key can be easily done by +;; changing the `leader-key' constant in the `init.el' at the project root. +;; +;;; Code: ;; Files (general-create-definer diancite/file @@ -33,3 +41,5 @@ "l w" '(:wk "Server") "l w r" '(eglot-reconnect :wk "Restart Server") "l w q" '(eglot-shutdown :wk "Shutdown Server")) + +;;; keybinds.el ends here diff --git a/lisp/languages.el b/lisp/languages.el index c410d2a..f8e1472 100644 --- a/lisp/languages.el +++ b/lisp/languages.el @@ -1,3 +1,11 @@ +;;; lisp/languages.el --- Support for programming languages -*- lexical-binding: t; -*- +;;; Commentary: +;; +;; Trivial changes done by almost everyone - no editor supports every language by default. +;; You will probably be adding on to the stuff in this file - in the `user/' directory, of course. +;; +;;; Code: + ;; This file contains configuration for languages ;; Markdown @@ -40,3 +48,5 @@ ;; Autobrackets (add-hook 'prog-mode-hook 'electric-pair-mode) + +;;; languages.el ends here diff --git a/lisp/org-mode.el b/lisp/org-mode.el index f3f962a..6e56c41 100644 --- a/lisp/org-mode.el +++ b/lisp/org-mode.el @@ -1,4 +1,11 @@ -;; This file contains configuration for Emacs' org-mode +;;; lisp/org-mode.el --- org-mode improvements for Emacs -*- lexical-binding: t; -*- +;;; Commentary: +;; +;; A lot of people out there will agree wholeheartedly that org mode is great. +;; Tons of fine-grained control, simplicity, and extensibilty - all built-in by +;; default into a single tool that works beautifully with Emacs. +;; +;;; Code: ;; org-mode ;; org-superstar (use-package org-superstar @@ -77,3 +84,5 @@ "n t" '(org-table-align :wk "Align Table")) (setq org-agenda-files (quote ("~/Org"))) + +;;; org-mode.el ends here diff --git a/lisp/performance.el b/lisp/performance.el index c7f537e..d745be8 100644 --- a/lisp/performance.el +++ b/lisp/performance.el @@ -1,4 +1,10 @@ -;; This file improves the performance of Emacs, startup or otherwise +;;; lisp/performance.el --- Performance improvements for Emacs -*- lexical-binding: t; -*- +;;; Commentary: +;; +;; Emacs is widely known to be one of the slower editors - despite the +;; great 'native compilation' or the daemon-client relationship. So that needs to change too. +;; +;;; Code: ;; Reduce garbage collection at startup (setq gc-cons-threshold most-positive-fixnum) @@ -7,3 +13,5 @@ (add-hook 'emacs-startup-hook (lambda () (setq gc-cons-threshold (expt 2 23)))) + +;;; performance.el ends here