emacs: add comment macro
[~bandali/configs] / .emacs.d / init.el
index 19c4d7a..c7eac7e 100644 (file)
@@ -1,4 +1,4 @@
-;;; init.el --- Amin Bandali's Emacs config -*- lexical-binding: t; eval: (view-mode 1) -*-
+;;; init.el --- Amin Bandali's Emacs config -*- lexical-binding: t -*-
 
 ;; Copyright (C) 2018-2019  Amin Bandali <bandali@gnu.org>
 
@@ -22,8 +22,7 @@
 
 ;; THIS FILE IS AUTO-GENERATED FROM `init.org'.
 
-(defvar a/byte-compiled-init nil
-  "If non-nil, byte-(re)compile init.el on successful tangles.")
+;;; Code:
 
 (defvar a/before-user-init-time (current-time)
   "Value of `current-time' when Emacs begins loading `user-init-file'.")
 
 ;; Solid rocket booster ignition...
 
-(defun a/build-init ()
-  (a/bootstrap-straight)
-  (byte-compile-file "init.el"))
-
 (a/bootstrap-straight)
 
 ;; We have lift off!
   (interactive)
   (straight-transaction
     (straight-mark-transaction-as-init)
-    (load (if a/byte-compiled-init
-              (concat (file-name-sans-extension user-init-file) ".elc")
-            user-init-file))))
+    (load user-init-file)))
 
 (straight-use-package 'use-package)
 (if nil                             ; set to t when need to debug init
 (setq use-package-always-defer t)
 (require 'bind-key)
 
+;; comment macro, useful for commenting out multiple sexps at a time
+(defmacro comment (&rest _)
+  "Comment out one or more s-expressions."
+  (declare (indent defun))
+  nil)
+
 (use-package no-littering
   :demand t
   :config
   (defvar a/show-async-tangle-time nil
     "Show the time spent tangling the file.")
 
-  (defvar a/async-tangle-post-compile
-    (when a/byte-compiled-init "make build-init")
-    "If non-nil, pass to `compile' after successful tangle.")
-
-  ;; TODO: look into why directly byte-compiling init.el causes a
-  ;; number of problems, including magit-status not loading (busy
-  ;; waiting).
-  (defvar a/async-tangle-byte-recompile nil
-    "If non-nil, byte-recompile the file on successful tangle.")
-
   (defun a/async-babel-tangle ()
     "Tangle org file asynchronously."
     (interactive)
        (unless a/show-async-tangle-results
          `(lambda (result)
             (if result
-                (progn
-                  ;; (setq byte-compile-warnings '(not noruntime unresolved))
-                  (message "Tangled %s%s"
-                           ,file-nodir
-                           (if a/show-async-tangle-time
-                               (format " (%.3fs)"
-                                       (float-time (time-subtract (current-time)
-                                                                  ',file-tangle-start-time)))
-                             ""))
-                  (when a/async-tangle-post-compile
-                    (compile a/async-tangle-post-compile))
-                  (when a/async-tangle-byte-recompile
-                    (byte-recompile-file (concat ,file-noext ".el"))))
+                (message "Tangled %s%s"
+                         ,file-nodir
+                         (if a/show-async-tangle-time
+                             (format " (%.3fs)"
+                                     (float-time (time-subtract (current-time)
+                                                                ',file-tangle-start-time)))
+                           ""))
               (message "Tangling %s failed" ,file-nodir))))))))
 
 (add-to-list