diff options
author | Raúl Benencia <id@rbenencia.name> | 2024-10-15 22:02:20 -0700 |
---|---|---|
committer | Raúl Benencia <id@rbenencia.name> | 2024-10-15 22:02:20 -0700 |
commit | d670eedb47a78430429ddf7f3adc5261704c83ec (patch) | |
tree | 9e12e98703ed0704339e8d1b45ae4d6a1454c2a5 | |
parent | 1efead94f88950a4277191a23532fe28597cd383 (diff) |
emacs: get started with emacs literate config
-rw-r--r-- | .emacs.d/early-init.el | 30 | ||||
-rw-r--r-- | .emacs.d/rul-emacs.org | 81 |
2 files changed, 94 insertions, 17 deletions
diff --git a/.emacs.d/early-init.el b/.emacs.d/early-init.el index 1e13ee8..28ecb98 100644 --- a/.emacs.d/early-init.el +++ b/.emacs.d/early-init.el @@ -1,30 +1,26 @@ +;; I don't use any of these (menu-bar-mode -1) (tool-bar-mode -1) (scroll-bar-mode -1) -;; Initialise installed packages -(setq package-enable-at-startup t) - -;; Do not report warning errors -(setq native-comp-async-report-warnings-errors 'silent) +;; Avoid initial flash of light. +;; Inspired on prot-emacs-avoid-initial-flash-of-light. +(setq mode-line-format nil) +(set-face-attribute 'default nil :background "#000000" :foreground "#ffffff") +(set-face-attribute 'mode-line nil :background "#000000" :foreground "#ffffff" :box 'unspecified) -;; Truly maximize screen +;; Do not resize when font size changes (setq frame-resize-pixelwise t) -;; Start maximized +;; By default, start maximized (add-to-list 'default-frame-alist '(fullscreen . maximized)) ;; No need for titlebar (modify-frame-parameters nil '((undecorated . t))) -(defun rul-emacs-avoid-initial-flash-of-light () - "Avoid flash of light when starting Emacs. Inspired on - prot-emacs-avoid-initial-flash-of-light." - (setq mode-line-format nil) - (set-face-attribute 'default nil :background "#000000" :foreground "#ffffff") - (set-face-attribute 'mode-line nil :background "#000000" :foreground "#ffffff" :box 'unspecified) - ) - -(rul-emacs-avoid-initial-flash-of-light) +;; Initialise installed packages, otherwise, basic functions are not +;; available during the initialization stage. +(setq package-enable-at-startup t) -;;; early-init.el ends here +;; Do not report warnings. It's too noisy. +(setq native-comp-async-report-warnings-errors 'silent) diff --git a/.emacs.d/rul-emacs.org b/.emacs.d/rul-emacs.org new file mode 100644 index 0000000..64a4be8 --- /dev/null +++ b/.emacs.d/rul-emacs.org @@ -0,0 +1,81 @@ +This is (will be) my Emacs literate configuration file. A self +contained file with all my configuration is useful for documentation +purposes. It will be modeled using the technique described by +Protesilaos for his own Emacs config file: +<https://protesilaos.com/emacs/dotemacs>. + +This method consists in generating all files /a priori/, after modifying +this file, and *not* at load time, as that would be too slow. + +#+begin_src emacs-lisp :tangle no :results none +(org-babel-tangle) +#+end_src + +* Directory and file structure + +- =early-init.el=: quoting the [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Early-Init-File.html][Emacs documentation]], this file is "loaded + before the package system and GUI is initialized, so in it you can + customize variables that affect the package initialization process" +- =init.el=: the skeleton of my configuration framework. It will load + the rest of the modules. +- =rul-emacs-modules/=: a directory with Emacs modules specific to my + configuration. Modules group code related to a topic or theme of + configuration. For example, =rul-prog.el= contains code related to + programming, and =rul-org.el= contains code related to org-mode. If a + module gets too big, I can create a smaller module under the same + topic; for example, =rul-org-agenda.el=. +- =rul-post-init.el=: this file will be loaded after =init.el=, and will + normally live in other git repository. Here I normally add overrides + needed in my work computer. +- =rul-emacs.org=: this file. It (will) generate the rest of the structure. + +* The early init + +** Graphical aspects +Customization of graphical aspects of Emacs, such as size, panels, etc. + +#+begin_src emacs-lisp :tangle "early-init.el" +;; I don't use any of these +(menu-bar-mode -1) +(tool-bar-mode -1) +(scroll-bar-mode -1) + +;; Avoid initial flash of light. +;; Inspired on prot-emacs-avoid-initial-flash-of-light. +(setq mode-line-format nil) +(set-face-attribute 'default nil :background "#000000" :foreground "#ffffff") +(set-face-attribute 'mode-line nil :background "#000000" :foreground "#ffffff" :box 'unspecified) +#+end_src + +** Frame configuration +I like to keep a few frames open all the time. A main frame, where I +open my org files, code, etc. A frame for communication and reading, +such as email and feeds, and a frame for terminals. + +Currently, the frames are all the same, but I will add configuration +to distinguish them so I can automate their placement in my desktop +environment. + +#+begin_src emacs-lisp :tangle "early-init.el" +;; Do not resize when font size changes +(setq frame-resize-pixelwise t) + +;; By default, start maximized +(add-to-list 'default-frame-alist '(fullscreen . maximized)) + +;; No need for titlebar +(modify-frame-parameters nil '((undecorated . t))) +#+end_src + +** Miscellany +#+begin_src emacs-lisp :tangle "early-init.el" +;; Initialise installed packages, otherwise, basic functions are not +;; available during the initialization stage. +(setq package-enable-at-startup t) + +;; Do not report warnings. It's too noisy. +(setq native-comp-async-report-warnings-errors 'silent) +#+end_src + + + |