From 2675183b072c3c972fc8e5172050553076ab6871 Mon Sep 17 00:00:00 2001 From: Tristan Riehs Date: Tue, 12 Mar 2024 09:23:05 +0100 Subject: Create the core create-license command Add information about dotfiles in the licenses directory. --- create-license.el | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/create-license.el b/create-license.el index f1709d8..364b8c2 100644 --- a/create-license.el +++ b/create-license.el @@ -37,9 +37,26 @@ (defcustom create-license-directory (file-name-as-directory (expand-file-name "licenses" user-emacs-directory)) - "Directory where licenses are stored." + "Directory where licenses are stored. + +`create-license' ignores files in this directory whose name start by a +dot." :group 'create-license :type 'string) +;;;###autoload +(defun create-license (dir name) + "Copy the license NAME in DIR. + +The destination file name under DIR is given by +`create-license-file-name'." + (interactive (list + default-directory + (completing-read + "License: " + (directory-files create-license-directory nil "^[^\\.].*")))) + (copy-file (expand-file-name name create-license-directory) + (expand-file-name create-license-file-name dir))) + (provide 'create-license) ;;; create-license.el ends here -- cgit v1.2.3