init.el (1219B)
1 ;; -*- lexical-binding: t; -*- 2 3 (with-eval-after-load 'epg-config 4 (setq epg-pinentry-mode 'loopback)) 5 6 ;; Settings for graphical instance 7 (setq x-wait-for-event-timeout nil ; remove frame creation delay 8 frame-resize-pixelwise t) ; frames resize by pixel 9 10 ;; Prefer newer files rather than old byte-compiled ones 11 (setq load-prefer-newer t) 12 13 ;; Move custom-file to the lisp directory 14 (setq custom-file (locate-user-emacs-file "lisp/custom-file.el")) 15 16 ;; Add the lisp directory to `load-path' 17 (add-to-list 'load-path (locate-user-emacs-file "lisp")) 18 19 ;; Define a function that loads my config file 20 (defun config-load (&optional tangle) 21 "Load my config file. 22 23 Load \"config.el\". If \"config.el\" doesn't exist, or if prefix 24 arg TANGLE is non-nil, tangle \"config.org\" first." 25 (interactive "P") 26 (if tangle 27 (let ((org (locate-user-emacs-file "config.org"))) 28 (require 'org) 29 (org-babel-tangle-file org) 30 (load "config" t)) 31 (unless (load "config" t) 32 (config-load t)))) 33 34 ;; Enable all local variables temporarily, for `desktop-read' 35 (let ((enable-local-variables :all)) 36 ;; Load custom.el 37 (when (file-exists-p custom-file) 38 (load-file custom-file)) 39 ;; Load config.org 40 (config-load))