about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--users/wpcarro/emacs/default.nix1
-rw-r--r--users/wpcarro/emacs/pkgs/macros/default.nix10
-rw-r--r--users/wpcarro/emacs/pkgs/macros/macros.el (renamed from users/wpcarro/emacs/.emacs.d/wpc/macros.el)20
3 files changed, 12 insertions, 19 deletions
diff --git a/users/wpcarro/emacs/default.nix b/users/wpcarro/emacs/default.nix
index 19014dd6460f..c83934d6f063 100644
--- a/users/wpcarro/emacs/default.nix
+++ b/users/wpcarro/emacs/default.nix
@@ -47,6 +47,7 @@ let
       bookmark
       cycle
       list
+      macros
       maybe
       set
       string
diff --git a/users/wpcarro/emacs/pkgs/macros/default.nix b/users/wpcarro/emacs/pkgs/macros/default.nix
new file mode 100644
index 000000000000..d2811ed39fc6
--- /dev/null
+++ b/users/wpcarro/emacs/pkgs/macros/default.nix
@@ -0,0 +1,10 @@
+{ pkgs, depot, ... }:
+
+pkgs.callPackage
+  ({ emacsPackages }:
+  emacsPackages.trivialBuild {
+    pname = "macros";
+    version = "1.0.0";
+    src = ./macros.el;
+  })
+{ }
diff --git a/users/wpcarro/emacs/.emacs.d/wpc/macros.el b/users/wpcarro/emacs/pkgs/macros/macros.el
index 32c9b59dcd50..3642686eeb4b 100644
--- a/users/wpcarro/emacs/.emacs.d/wpc/macros.el
+++ b/users/wpcarro/emacs/pkgs/macros/macros.el
@@ -7,20 +7,9 @@
 ;;; Commentary:
 ;; This file contains helpful variables that I use in my ELisp development.
 
-;; TODO: Consider a macro solution for mimmicking OCaml's auto resolution of
-;; dependencies using `load-path' and friends.
-
 ;;; Code:
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Dependencies
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(require 'f)
-(require 'string)
-(require 'symbol)
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Library
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
@@ -42,13 +31,6 @@ Usage: (macros-add-hook-before-save 'reason-mode-hook #'refmt-before-save)"
              (lambda ()
                (add-hook 'before-save-hook ,f))))
 
-;; TODO: Privatize?
-(defun macros--namespace ()
-  "Return the namespace for a function based on the filename."
-  (->> (buffer-file-name)
-       f-filename
-       f-base))
-
 (defmacro macros-comment (&rest _)
   "Empty comment s-expresion where `BODY' is ignored."
   `nil)
@@ -56,7 +38,7 @@ Usage: (macros-add-hook-before-save 'reason-mode-hook #'refmt-before-save)"
 (defmacro macros-support-file-extension (ext mode)
   "Register MODE to automatically load with files ending with EXT extension.
 Usage: (macros-support-file-extension \"pb\" protobuf-mode)"
-  (let ((extension (string-format "\\.%s\\'" ext)))
+  (let ((extension (format "\\.%s\\'" ext)))
     `(add-to-list 'auto-mode-alist '(,extension . ,mode))))
 
 (provide 'macros)