summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--config.org41
1 files changed, 24 insertions, 17 deletions
diff --git a/config.org b/config.org index 4596ef6..25627ee 100644 --- a/config.org +++ b/config.org
@@ -1238,40 +1238,47 @@ I realized I didn’t need =early-init.el=, since it really only set =load-prefe
1238 (when (file-newer-than-file-p config (expand-file-name 1238 (when (file-newer-than-file-p config (expand-file-name
1239 "README.md" 1239 "README.md"
1240 user-emacs-directory)) 1240 user-emacs-directory))
1241 (message "Exporting README.md...")
1241 (require 'ox-md) 1242 (require 'ox-md)
1242 (org-md-export-to-markdown)) 1243 (with-demoted-errors "Problem exporting README.md: %S"
1244 (org-md-export-to-markdown)))
1243 ;; tangle config.org 1245 ;; tangle config.org
1244 (when (file-newer-than-file-p config (expand-file-name 1246 (when (file-newer-than-file-p config (expand-file-name
1245 "config.el" 1247 "config.el"
1246 user-emacs-directory)) 1248 user-emacs-directory))
1249 (message "Tangling config.org...")
1247 (require 'org) 1250 (require 'org)
1248 (let ((inits (org-babel-tangle))) 1251 (let ((inits (org-babel-tangle)))
1249 ;; byte-compile resulting files 1252 ;; byte-compile resulting files
1253 (message "Byte-compiling...")
1250 (dolist (f inits) 1254 (dolist (f inits)
1251 (when (string-match "\\.el\\'" f) 1255 (when (string-match "\\.el\\'" f)
1252 (byte-compile-file f (not disable-load))))))))))) 1256 (byte-compile-file f (not disable-load)))))))))))
1253 #+end_src 1257 #+END_SRC
1254
1255*** Add a hook to tangle when quitting
1256
1257#+begin_src emacs-lisp
1258 (defun acdw/refresh-emacs-no-load ()
1259 (refresh-emacs 'disable-load))
1260
1261 (add-hook 'kill-emacs-hook #'acdw/refresh-emacs-no-load)
1262#+end_src
1263 1258
1264** Ancillary scripts 1259** Ancillary scripts
1265 1260
1266*** emacsdc 1261*** emacsdc
1267 1262
1268Here’s a wrapper script that’ll start =emacs –daemon= if there isn’t one, and then launch =emacsclient= with the arguments. I’d recommend installing with either ~ln -s bin/emacsdc $HOME/.local/bin/~, or adding =$HOME/.local/bin= to your =$PATH=. 1263Here's a wrapper script that'll start =emacs –daemon= if there isn't
1264one, and then launch =emacsclient= with the arguments. I'd recommend
1265installing with either ~ln -s bin/emacsdc $HOME/.local/bin/~, or
1266adding =$HOME/.local/bin= to your =$PATH=.
1269 1267
1270#+begin_src sh :tangle bin/emacsdc :mkdirp yes :shebang "#!/bin/sh" 1268#+BEGIN_SRC sh :tangle bin/emacsdc :mkdirp yes :shebang "#!/bin/sh"
1271 if ! emacsclient -nc "$@" 2>/dev/null; then 1269if ! emacsclient -nc "$@" 2>/dev/null; then
1272 emacs --daemon 1270 emacs --daemon
1273 emacsclient -nc "$@" 1271 emacsclient -nc "$@"
1274 fi 1272fi
1273#+END_SRC
1274
1275*** Emacs.cmd
1276
1277Here’s a wrapper script that’ll run Emacs on Windows, with a custom =$HOME=. I have mine setup like this: Emacs is downloaded from [[https://mirrors.tripadvisor.com/gnu/emacs/windows/emacs-27/emacs-27.1-x86_64.zip][the GNU mirror]] and unzipped to =~/Downloads/emacs/=. =Emacs.cmd= sets =$HOME= to =~/Downloads/emacshome/=, which is where =.emacs.d= is, and whatever else I might want to throw in there.
1278
1279#+begin_src bat :tangle bin/Emacs.cmd
1280 set HOME=%~dp0..\..\emacshome
1281 "%~dp0runemacs.exe" %*
1275#+end_src 1282#+end_src
1276 1283
1277** License 1284** License