aboutsummaryrefslogtreecommitdiff
path: root/create-license.el
diff options
context:
space:
mode:
authorTristan Riehs <tristan.riehs@bordeaux-inp.fr>2024-03-12 09:23:05 +0100
committerTristan Riehs <tristan.riehs@bordeaux-inp.fr>2024-03-12 09:23:05 +0100
commit2675183b072c3c972fc8e5172050553076ab6871 (patch)
tree14d8051410e9eea2dbaf1a0f0f6a155b0910c35a /create-license.el
parent1ff7db3a3f023177e70776d29fccc3902a8007b9 (diff)
Create the core create-license command
Add information about dotfiles in the licenses directory.
Diffstat (limited to 'create-license.el')
-rw-r--r--create-license.el19
1 files changed, 18 insertions, 1 deletions
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