diff --git a/users/wpcarro/emacs/default.nix b/users/wpcarro/emacs/default.nix index 19014dd64..c83934d6f 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 000000000..d2811ed39 --- /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 similarity index 72% rename from users/wpcarro/emacs/.emacs.d/wpc/macros.el rename to users/wpcarro/emacs/pkgs/macros/macros.el index 32c9b59dc..3642686ee 100644 --- a/users/wpcarro/emacs/.emacs.d/wpc/macros.el +++ b/users/wpcarro/emacs/pkgs/macros/macros.el @@ -7,19 +7,8 @@ ;;; 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)