From 416e6640d663123d1d45fbf0860cbc13c77b3a38 Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Sat, 12 Nov 2022 17:53:29 +0000 Subject: [PATCH] style: file explanations and loading This commit changes the way files are loaded. Instead of being 'require'd and 'provide'd, they are simply 'load'ed, having a positive impact on performance and code quality. Additionally, the headings of file (which thus far have began with three semicolons) now begin with two to fit Emacs lisp conventions. --- init.el | 10 +++++----- lisp/editor.el | 5 +---- lisp/interface.el | 5 +---- lisp/keybinds.el | 5 +---- lisp/language.el | 2 +- lisp/org-mode.el | 6 ++---- lisp/performance.el | 5 +---- 7 files changed, 12 insertions(+), 26 deletions(-) diff --git a/init.el b/init.el index 4e6c7ea..bd31338 100644 --- a/init.el +++ b/init.el @@ -35,9 +35,9 @@ (convert-standard-filename "lisp/"))) ;; Load the code of some external files -(require 'interface) -(require 'editor) -(require 'org-mode) -(require 'keybinds) -(require 'performance) +(load "interface") +(load "editor") +(load "org-mode") +(load "keybinds") +(load "performance") (load "language") diff --git a/lisp/editor.el b/lisp/editor.el index 32575c1..3b834ff 100644 --- a/lisp/editor.el +++ b/lisp/editor.el @@ -1,4 +1,4 @@ -;;; This file customizes Emacs' editor +;; This file customizes Emacs' editor ;; Quit input dialogues after pressing escape once (global-set-key (kbd "") 'keyboard-escape-quit) @@ -74,6 +74,3 @@ "p" '(:wk "Projects")) (set-face-foreground 'vertical-border (face-background 'default)) - -;; Provide this file to init.el -(provide 'editor) diff --git a/lisp/interface.el b/lisp/interface.el index cd391f6..682b195 100644 --- a/lisp/interface.el +++ b/lisp/interface.el @@ -1,4 +1,4 @@ -;;; This file contains configuration for Emacs interface elements. +;; This file contains configuration for Emacs interface elements. ;; Stop Emacs from resizing the window at startup (setq frame-resize-pixelwise t) @@ -47,6 +47,3 @@ (use-package diredfl ; Colourise dired! :hook dired-mode) - -;; Provide this file to init.el -(provide 'interface) diff --git a/lisp/keybinds.el b/lisp/keybinds.el index f5aef58..6869f41 100644 --- a/lisp/keybinds.el +++ b/lisp/keybinds.el @@ -1,4 +1,4 @@ -;;; This file contains keybindings for Dianciemacs +;; This file contains keybindings for Dianciemacs ;; Files (general-create-definer diancite/file @@ -18,6 +18,3 @@ "m s" '(magit-status :wk "Status") "m d" '(magit-dispatch :wk "Dispatch") "m f" '(magit-status :wk "File Dispatch")) - -;; Provide file file init.el -(provide 'keybinds) diff --git a/lisp/language.el b/lisp/language.el index 4f0f942..d8d45a2 100644 --- a/lisp/language.el +++ b/lisp/language.el @@ -1,4 +1,4 @@ -;;; This file contains configuration for languages +;; This file contains configuration for languages ;; Markdown (use-package markdown-mode) diff --git a/lisp/org-mode.el b/lisp/org-mode.el index d595886..382cb5d 100644 --- a/lisp/org-mode.el +++ b/lisp/org-mode.el @@ -1,4 +1,5 @@ -;;; This file contains configuration for Emacs' org-mode +;; This file contains configuration for Emacs' org-mode + ;;; org-mode ;; org-superstar (use-package org-superstar :config @@ -82,6 +83,3 @@ "n a" '(org-agenda :wk "Agenda")) (setq org-agenda-files (quote ("~/Org"))) - -;; Provide this file to init.el -(provide 'org-mode) diff --git a/lisp/performance.el b/lisp/performance.el index 9c0d108..c7f537e 100644 --- a/lisp/performance.el +++ b/lisp/performance.el @@ -1,4 +1,4 @@ -;;; This file improves the performance of Emacs, startup or otherwise +;; This file improves the performance of Emacs, startup or otherwise ;; Reduce garbage collection at startup (setq gc-cons-threshold most-positive-fixnum) @@ -7,6 +7,3 @@ (add-hook 'emacs-startup-hook (lambda () (setq gc-cons-threshold (expt 2 23)))) - -;; Provide this file to init.el -(provide 'performance)