From 68f0ed1ee3331cb2b148a6e3b8952c5eb005eb70 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 21 Jan 2021 08:38:38 -0600 Subject: Remove comments --- init.el | 48 ++++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 28 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index d0e30b2..e8a67fd 100644 --- a/init.el +++ b/init.el @@ -2,36 +2,28 @@ ;; This file is automatically tangled from config.org. ;; Hand edits will be overwritten! -;; Prefer newer files to older files +(setq-default load-prefer-newer t) - -;; [[file:~/.emacs.d/config.org::*Prefer newer files to older files][Prefer newer files to older files:1]] -(setq load-prefer-newer t) -;; Prefer newer files to older files:1 ends here - -;; Load the config - -;; I keep most of my config in =config.el=, which is tangled directly -;; from this file. This init just loads that file, either from lisp or -;; directly from Org if it's newer. - - -;; [[file:~/.emacs.d/config.org::*Load the config][Load the config:1]] (let* (;; Speed up init (gc-cons-threshold most-positive-fixnum) (file-name-handler-alist nil) ;; Config file names - (conf (expand-file-name "config" - user-emacs-directory)) - (conf-el (concat conf ".el")) - (conf-org (concat conf ".org"))) - (unless (and (file-newer-than-file-p conf-el conf-org) - (load conf 'no-error)) - ;; A plain require here just loads the older `org' - ;; in Emacs' install dir. We need to add the newer - ;; one to the `load-path', hopefully that's all. - (add-to-list 'load-path (expand-file-name "straight/build/org" - user-emacs-directory)) - (require 'org) - (org-babel-load-file conf-org))) -;; Load the config:1 ends here + (config (expand-file-name "config" + user-emacs-directory)) + (config.el (concat config ".el")) + (config.org (concat config ".org")) + (straight-org-dir (expand-file-name "straight/build/org" + user-emacs-directory))) + ;; Unless config.org is /newer/ than config.el, *or* the config + ;; is able to be loaded without errors, load the config from + ;; config.org. + (unless (or (file-newer-than-file-p config.org config.el) + (load config 'no-error)) + ;; A plain require here just loads the older `org' + ;; in Emacs' install dir. We need to add the newer + ;; one to the `load-path', hopefully that's all. + (when (file-exists-p straight-org-dir) + (add-to-list 'load-path straight-org-dir)) + ;; Load config.org + (require 'org) + (org-babel-load-file config.org))) -- cgit 1.4.1-21-gabe81