From 83f8bc36660b2ac40feeb43d739b98593f35cd5e Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Fri, 6 May 2022 14:00:12 +0300 Subject: [PATCH] Add "Fresh installation section" --- .emacs.d/esy.org | 32 +++++++++++++++++++++++++++++--- .emacs.d/init.el | 6 +++++- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/.emacs.d/esy.org b/.emacs.d/esy.org index 49dd448..f7c1c3f 100644 --- a/.emacs.d/esy.org +++ b/.emacs.d/esy.org @@ -6,7 +6,29 @@ * Emacs configuration +** Fresh installation + +To bootstrap this configuration, clone the repository from [[https://git.sr.ht/~eshel/dotfiles][SourceHut]] +and create a symlink from the =.emacs.d= subdirectory into your home +directory, possibly using [[https://www.gnu.org/software/stow/][GNU Stow]]. + +#+begin_src shell + $ git clone https://git.sr.ht/~eshel/dotfiles + $ cd dotfiles/.emacs.d + $ stow -t ~ . + $ emacs +#+end_src + +After the first run of the provided =init.el=, modifications to +=esy.org= will be made available automatically whenever Emacs +restarts. See also [[#bootstrap][Literate config bootstrap]]. + ** Elisp Header +:PROPERTIES: +:CUSTOM_ID: header +:END: + +For further information, see [[info:elisp#Library Headers][elisp#Library Headers]]. #+begin_src emacs-lisp ;;; esy.el --- GNU Emacs configuration -*- lexical-binding: t -*- @@ -50,7 +72,7 @@ rainbow-delimiters rg smtpmail-multi tramp typit vterm vundo which-key whitespace-cleanup-mode hide-mode-line)) - (package-initialize) + (package-install-selected-packages) #+end_src ** Suppressing native compilation warnings @@ -148,10 +170,14 @@ ** Org-mode settings :org: *** Literate config bootstrap +:PROPERTIES: +:CUSTOM_ID: bootstrap +:END: #+begin_src emacs-lisp (defun esy/tangle-and-compile-config () "Tangle literate configuration file." + (interactive) (require 'org) (require 'ob) (let ((source (locate-user-emacs-file "esy.org")) @@ -588,7 +614,7 @@ #+begin_src emacs-lisp (defun esy/customize-ctl-x-map () "Configure the `C-x' keymap." - (require 'ialign) + (require 'ol) ; (require 'magit) (require 'consult) (require 'ace-window) @@ -600,7 +626,7 @@ (keymap-set ctl-x-map "b" #'consult-buffer) (keymap-set ctl-x-4-map "b" #'consult-buffer-other-window) (keymap-set ctl-x-map "!" #'consult-flymake) - (keymap-set ctl-x-map "l" #'ialign) + (keymap-set ctl-x-map "l" #'org-store-link) (keymap-set ctl-x-map "g" #'magit-status) (keymap-set ctl-x-map "s" rg-global-map) (keymap-set ctl-x-map "c" #'org-capture) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 535ce78..e30eabf 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -6,7 +6,11 @@ ;; (require 'benchmark-init) ;; (add-hook 'after-init-hook 'benchmark-init/deactivate) -(load-file (locate-user-emacs-file "esy.el")) +(let ((esy (expand-file-name (locate-user-emacs-file "esy")))) + (or (load esy t t nil t) + (progn + (require 'org) + (org-babel-load-file (concat esy ".org") t)))) (provide 'init) ;;; init.el ends here -- 2.39.5