From 832d146adb888974ed181147ca87bb49f371e79a Mon Sep 17 00:00:00 2001 From: jao Date: Mon, 24 May 2021 06:37:46 +0100 Subject: lexical tangling and optional loading --- init.org | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'init.org') diff --git a/init.org b/init.org index dc8c28f..07398f6 100644 --- a/init.org +++ b/init.org @@ -1,9 +1,12 @@ -#+PROPERTY: header-args :tangle yes :comments yes :results silent +#+property: header-args :lexical t :tangle yes :comments no :results silent +#+auto_tangle: t * Packages +*** Header + #+begin_src emacs-lisp + ;; -*- lexical-binding: t; -*- + #+end_src *** Use package - Bootstrap `use-package' (from [[http://www.lunaryorn.com/2015/01/06/my-emacs-configuration-with-use-package.html][here]]) - #+begin_src emacs-lisp (unless (package-installed-p 'use-package) (package-refresh-contents) @@ -11,18 +14,18 @@ (require 'use-package) #+end_src *** Literate elisp and autotangle - #+BEGIN_SRC emacs-lisp + #+begin_src emacs-lisp (use-package poly-org :ensure t) - (use-package literate-elisp :ensure t) + ;; (use-package literate-elisp :ensure t) (use-package org-auto-tangle :ensure t :hook (org-mode . org-auto-tangle-mode) :diminish) - #+END_SRC + #+end_src *** ELPA Keyring - #+BEGIN_SRC emacs-lisp + #+begin_src emacs-lisp (use-package gnu-elpa-keyring-update :ensure t) - #+END_SRC + #+end_src *** Loading .el newer than .elc files, and eln stuff #+begin_src emacs-lisp (setq load-prefer-newer t) @@ -31,9 +34,6 @@ #+end_src * Initialisation *** Portability macros - - From when we want our configurations to work on an apple tree... - #+begin_src emacs-lisp (defmacro jao-syscase (clauses) (let ((cls (assoc system-type clauses))) @@ -48,7 +48,6 @@ (defmacro jao-when-linux (&rest body) `(jao-syscase ((gnu/linux ,@body)))) #+end_src - *** Paths #+begin_src emacs-lisp (defvar jao-local-lisp-dir "~/lib/elisp" @@ -75,10 +74,6 @@ (load lf) (message "Attempted to load non existing %s" lf)))) - (defun jao-load-org (file) - (let ((file (format "%s.org" (file-name-sans-extension file)))) - (literate-elisp-load-file (expand-file-name file jao-emacs-dir)))) - (defun jao-exec-path (file) (let ((fn (expand-file-name file))) (add-to-list 'exec-path fn nil) -- cgit v1.2.3