[literate] use sed to tangle the file instead of literate-elisp

This commit is contained in:
contrapunctus 2021-02-17 15:20:52 +05:30
parent 5f23271b6e
commit f1a22bc836
2 changed files with 1226 additions and 66 deletions

1256
init.el

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,11 @@
#+TODO: TODO WIP WISH CLEANUP FIXME REVIEW |
#+PROPERTY: header-args :tangle yes :load yes
A bit of sed which can quickly tangle Org literate Elisp
#+BEGIN_SRC emacs-lisp :load no
(start-process-shell-command "sed-tangle" "sed-tangle" "sed -n -e '/#+BEGIN_SRC emacs-lisp$/,/#+END_SRC$/{//!p;}' init.org > tangled-init.el")
#+END_SRC
I initially tried using the literate-elisp package, but -
1. It doesn't interoperate with =describe-*=, =helpful=, or =xref= (see https://github.com/jingtaozf/literate-elisp/issues/7 )
2. It seems to evaluate one source block at a time, resulting in an error if I split up a form across multiple source blocks.
And =org-babel-tangle= takes nearly 27 seconds to tangle this file, at the time of writing. So I went back to using =sed= - see file local variables below.
* init.org
** user interface
@ -1442,21 +1443,18 @@ It'd be really cool to (recenter 3) when you /open/ a section, and (recenter) wh
:commands (wgrep-change-to-wgrep-mode))
#+END_SRC
**
** custom.el
#+BEGIN_SRC emacs-lisp
(setq custom-file "~/.emacs.d/custom.el")
#+END_SRC
**
#+BEGIN_SRC emacs-lisp
(load custom-file)
;; must put this after loading the custom file, or I get prompted each time
#+END_SRC
** doom-acario-dark
Must put this after loading the custom file, or I get prompted about the theme each time.
#+BEGIN_SRC emacs-lisp
;; (require 'doom-themes)
;; (load-theme 'doom-acario-dark)
(require 'doom-themes)
(load-theme 'doom-acario-dark)
#+END_SRC
**
@ -1481,7 +1479,7 @@ It'd be really cool to (recenter 3) when you /open/ a section, and (recenter) wh
#+BEGIN_SRC emacs-lisp
(put 'list-timers 'disabled nil)
#+END_SRC
** GC reset, file local variables
** GC reset
#+BEGIN_SRC emacs-lisp
(setq gc-cons-threshold 400000)
@ -1489,14 +1487,16 @@ It'd be really cool to (recenter 3) when you /open/ a section, and (recenter) wh
;; (profiler-stop)
;; (emacs-init-time)
;; (profiler-report)
;; Local Variables:
;; nameless-current-name: "contrapunctus"
;; eval: (visual-fill-column-mode -1)
;; End:
#+END_SRC
** The End
#+BEGIN_SRC emacs-lisp
(provide 'init)
;;; init.el ends here
#+END_SRC
# Local Variables:
# nameless-current-name: "contrapunctus"
# eval: (visual-fill-column-mode -1)
# eval: (nameless-mode)
# eval: (progn (make-local-variable 'after-save-hook) (add-hook 'after-save-hook (lambda () (start-process-shell-command "sed-tangle" "sed-tangle" "sed -n -e '/#+BEGIN_SRC emacs-lisp$/,/#+END_SRC$/{//!p;}' init.org > init.el"))))
# End: