This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+distributions/spacemacs-docker/funcs.el
syl20bnr fb27ede558 Bump year in copyright headers
Happy New Year 2017!
2017-01-05 23:08:17 -05:00

51 lines
2.1 KiB
EmacsLisp

;;; funcs.el --- Spacemacs Base Layer functions File
;;
;; Copyright (c) 2012-2017 Sylvain Benner & Contributors
;;
;; Author: Eugene "JAremko" Yaremenko <w3techplayground@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
;;; License: GPLv3
(defun spacemacs-docker//dump-layers-data ()
"Save used layers and their configurations to
the `spacemacs-docker--default-dump-layer-data-file-path' file"
(with-temp-file docker-spacemacs--default-dump-layer-data-file-path
(let ((used-layers (mapcar (lambda (el)
(or (car-safe el)
el))
dotspacemacs-configuration-layers)))
(insert (format "(setq used-layers '(%-20s%s))\n\n"
"\n"
(mapconcat 'symbol-name
used-layers
(format "%-20s"
"\n"))))
(insert "(setq used-layers-configs '(\n")
(dolist (layer used-layers)
(let ((names (all-completions (format "%s-"
layer)
obarray)))
(dolist (name names)
(let* ((symbol (intern-soft name))
(fp (when (boundp symbol) (symbol-file symbol))))
(when (or (and fp
(string-prefix-p
(configuration-layer/get-layer-path layer)
fp))
(string-match-p (regexp-quote "docker-spacemacs-")
name))
(insert (format "%-28s(%s . %s)\n"
""
name
(symbol-value symbol))))))))
(insert "))\n\n"))))
(defun spacemacs-docker//test-dotfile ()
"Run `dotspacemacs/test-dotfile' and `kill-emacs' with
the code 1 if tests failed."
(unless (dotspacemacs/test-dotfile)
(message "dotspacemacs/test-dotfile FAILED")
(kill-emacs 1)))