Table of Contents

Work in progress, there will be errors

Currently there is an issue with org-mode verions…

1. installation

  (let ((dir (file-name-directory (buffer-file-name)))
        (target "~/.config/emacs-org/src"))
    (delete-file "~/.emacs.d/init.el")
    (make-directory "~/.config/emacs-org/" t)
;     ((file-directory-p target) (delete-directory target t))
     ((file-symlink-p target) (delete-file target)))
    (make-symbolic-link dir target t)
    (make-symbolic-link (concat dir "init.el") "~/.emacs.d/init.el" t))
  (message "emacs conf bootstrapped, please relaunch emacs")

2. init

 (when (version< "27" emacs-version)
  (message "version OK")
  (setq package-enable-at-startup nil))

(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 6))
  (unless (file-exists-p bootstrap-file)
         'silent 'inhibit-cookies)
      (goto-char (point-max))
  (load bootstrap-file nil 'nomessage))
(straight-use-package 'org)
(straight-use-package 'use-package)
(require 'org)
(message "hello")
(org-babel-load-file "~/.config/emacs-org/src/index.org")

3. context

throughout loading our configs we'll need to know whether to enable certain elements. This sets up all predicates for any kind of selection we'll need. We start off with a few indicators as to which kind of device we're dealing with.

(intern "my/phone")
(intern "my/laptop")
(intern "my/uconsole")
(intern "my/boox")
(intern "my/unknown")
(defconst my/device-type
  (let ((phone (file-exists-p "~/.DEVICE_PHONE"))
        (boox (file-exists-p "~/.DEVICE_BOOX"))
        (hostname (system-name)))
     (phone 'my/phone)
     (boox 'my/boox)
     ((string= hostname "jeroen-XPS-9320") 'my/laptop)
     (t 'my/unknown))))

(defun my/device-phone-p ()
  (eq my/device-type 'my/phone))

(defun my/device-laptop-p ()
  (eq my/device-type 'my/laptop))

(defun my/device-boox-p ()
  (eq my/device-type 'my/boox))

(defun my/prefer-light-p ()

We'll also want to know if there's a window manager available.

(defun my/window-manager-p ()
  (and (display-graphic-p)
       (progn (when (get-buffer " *window-manager*")
                (kill-buffer " *window-manager*"))
              (when (get-buffer " *window-manager-error*")
                (kill-buffer " *window-manager-error*"))
              (when (executable-find "wmctrl")
                (shell-command "wmctrl -m ; echo $?" " *window-manager*" " *window-manager-error*"))
              (eq nil (get-buffer " *window-manager-error*")))))

4. org babel

We'll be loading different org files for parsing so let's make it easy and less error sensitive, so if one file fails, it won't take down the rest of the execution.

(defconst my/emacs-org-conf-basepath "~/.config/emacs-org/src/")

(defun my/emacs-org-load-file (filename)
  (condition-case err
      (org-babel-load-file (concat my/emacs-org-conf-basepath filename))
    ((debug error) (progn
                     (message (format "Error loading org-file: %S (%s)\n" err filename))
                   (with-current-buffer (get-buffer-create "*org-load-errors*")
                     (goto-char (point-max))
                     (insert (format "Error loading org-file: %S (%s)\n" err filename))
                     (insert (with-temp-buffer (backtrace) (buffer-string))))))))

5. exwm


Code specific to exwm, should only be included at specific situations.

(when (and (not (my/device-phone-p))
           (not (my/window-manager-p)))
  (message "exwm eligable to boot")
  (my/emacs-org-load-file "exwm.org"))

6. interface


(my/emacs-org-load-file "interface.org")

7. org


(my/emacs-org-load-file "org.org")

8. generic development


(my/emacs-org-load-file "development.org")