Skip to content

Latest commit

 

History

History
61 lines (59 loc) · 2.21 KB

baseplatform.org

File metadata and controls

61 lines (59 loc) · 2.21 KB

First file to load - has almost no dependencies

1 - Local variables

It is possible to move this configuration out of the default .emacs.d But why?

(setq my/config-folder-location user-emacs-directory)
(setq user-full-name "Ilya Antonov")
(setq user-mail-address "[email protected]")

2 - Manual loading of el files

Some .el files are downloaded manually as support for them was stopped or there were deployment issues

(add-to-list 'load-path (concat my/config-folder-location "manual_el"))

3 - Repositories

List repositories we want to install from

(setq package-archives '(("org"       . "https://orgmode.org/elpa/")
                         ("gnu"       . "https://elpa.gnu.org/packages/")
                         ("melpa"     . "https://melpa.org/packages/")
                         ("melpa-stable" . "https://stable.melpa.org/packages/")))

Initialize the packages manually instead of running after the init file is loaded

(setq package-enable-at-startup nil)
(package-initialize)
(unless package-archive-contents
  (package-refresh-contents))

4 - Use-package

  • :init is executed before a package is loaded
  • :config is executed after a package is loaded
(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))
(require 'use-package)

5 - my/add-package-to-list

(defvar my/package-hashmap (make-hash-table :test 'equal))

(defun my/add-to-package-list (package-with-apostrophe)
  "Adds the package to my/package-hashmap hashmap.
Ensure that it is escaped with apostrophe to avoid evaluation"
  (puthash (format "%s" package-with-apostrophe) package-with-apostrophe my/package-hashmap))

6 - Getting the system path

(use-package exec-path-from-shell
  :ensure t
  :config (my/add-to-package-list 'exec-path-from-shell))
(exec-path-from-shell-initialize)

7 - Emacs server

(server-start)