;;; spacemacs-funcs --- Reusable functions from Spacemacs ;; Copyright (C) 2017 Alex Whitt ;; Author: Alex Whitt . ;;; Commentary: ;; ;; Loads the funcs.el files from Spacemacs in a somewhat customizable way. ;; Simply add the names of the Spacemacs layers you want to pull utility ;; functions from in spacemacs-funcs-enabled-layers. ;;; Code: (mapc 'load (file-expand-wildcards "/usr/share/emacs/site-lisp/spacemacs-funcs/core*funcs.elc")) (setq debug-on-error nil) (defgroup spacemacs-funcs nil "Spacemacs utility functions" :group 'spacemacs-funcs :prefix "spacemacs-funcs-") (defcustom spacemacs-funcs-enabled-layers nil "A list of Spacemacs layers from which to import utility functions." :type '(repeat string) :group 'spacemacs-funcs) (defun spacemacs-funcs-load-layers () "Load layers specified in spacemacs-funcs-enabled-layers." (dolist (file-string (file-expand-wildcards "/usr/share/emacs/site-lisp/spacemacs-funcs/layers*" t)) (if (and (string-match "layers_.*_\\([[:alnum:]-]+\\)_funcs.elc" file-string) (member (match-string 1 file-string) spacemacs-funcs-enabled-layers)) (load file-string)))) (provide 'spacemacs-funcs) ;;; end ;;; spacemacs-funcs.el ends here