From 028c53fbd7b58b9c076e222a716b0e4a9cde76b1 Mon Sep 17 00:00:00 2001 From: Fabien Dubosson Date: Mon, 16 Nov 2015 14:13:06 +0100 Subject: [PATCH] Create the layer README on create-layer When using `configuration-layer/create-layer`, the `README.org` file is not created from the template. This change corrects this. Close #3259 --- core/core-configuration-layer.el | 9 +++++---- .../{layer-README.template => README.org.template} | 0 .../{extensions.template => extensions.el.template} | 0 .../{packages.template => packages.el.template} | 0 doc/CONTRIBUTE.org | 2 +- doc/CONVENTIONS.org | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) rename core/templates/{layer-README.template => README.org.template} (100%) rename core/templates/{extensions.template => extensions.el.template} (100%) rename core/templates/{packages.template => packages.el.template} (100%) diff --git a/core/core-configuration-layer.el b/core/core-configuration-layer.el index 6c06230b9..e5c7cd068 100644 --- a/core/core-configuration-layer.el +++ b/core/core-configuration-layer.el @@ -215,8 +215,9 @@ layer directory." "this layer already exists.") name)) (t (make-directory layer-dir t) - (configuration-layer//copy-template name "extensions" layer-dir) - (configuration-layer//copy-template name "packages" layer-dir) + (configuration-layer//copy-template name "extensions.el" layer-dir) + (configuration-layer//copy-template name "packages.el" layer-dir) + (configuration-layer//copy-template name "README.org" layer-dir) (message "Configuration layer \"%s\" successfully created." name))))) (defun configuration-layer/make-layer (layer) @@ -408,9 +409,9 @@ If LAYER_DIR is nil, the private directory is used." (let ((src (concat configuration-layer-template-directory (format "%s.template" template))) (dest (if layer-dir - (concat layer-dir "/" (format "%s.el" template)) + (concat layer-dir "/" (format "%s" template)) (concat (configuration-layer//get-private-layer-dir name) - (format "%s.el" template))))) + (format "%s" template))))) (copy-file src dest) (find-file dest) (save-excursion diff --git a/core/templates/layer-README.template b/core/templates/README.org.template similarity index 100% rename from core/templates/layer-README.template rename to core/templates/README.org.template diff --git a/core/templates/extensions.template b/core/templates/extensions.el.template similarity index 100% rename from core/templates/extensions.template rename to core/templates/extensions.el.template diff --git a/core/templates/packages.template b/core/templates/packages.el.template similarity index 100% rename from core/templates/packages.template rename to core/templates/packages.el.template diff --git a/doc/CONTRIBUTE.org b/doc/CONTRIBUTE.org index 5fa8046c9..73e736679 100644 --- a/doc/CONTRIBUTE.org +++ b/doc/CONTRIBUTE.org @@ -56,7 +56,7 @@ layers in. For example a layer for a language would go in the It is recommended to join a =README.org= file with your layer: - ideally this file should document the packages of your layer as well as the key bindings associated with them - - a template is provided in =~/.emacs.d/core/templates/layer-README.template=, + - a template is provided in =~/.emacs.d/core/templates/README.org.template=, use it as much as possible - another good practice is to start from the =README.org= of an existing layer - if a logo exists for the layer you can add it at the top of the =README.org= diff --git a/doc/CONVENTIONS.org b/doc/CONVENTIONS.org index bf963b49c..7d42b781d 100644 --- a/doc/CONVENTIONS.org +++ b/doc/CONVENTIONS.org @@ -328,7 +328,7 @@ as an help command. * Writing documentation Spacemacs provides an example layer =README.org= file in -=~/.emacs.d/core/templates/layer-README.template=. +=~/.emacs.d/core/templates/README.org.template=. ** Spacing in documentation Spacemacs tries to keep the documentation consistent between all layers by