From 2be95a05370d016f87d34bdccc9556a9547338eb Mon Sep 17 00:00:00 2001
From: Tristan Riehs <tristan.riehs@bordeaux-inp.fr>
Date: Tue, 12 Mar 2024 20:19:31 +0100
Subject: Add command for downloading licenses

---
 create-license.el | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/create-license.el b/create-license.el
index e64f200..92a6f5f 100644
--- a/create-license.el
+++ b/create-license.el
@@ -68,16 +68,23 @@ The destination file name under DIR is given by
     ("Apache2" . "https://www.apache.org/licenses/LICENSE-2.0.txt")
     ("MPL2" . "https://www.mozilla.org/media/MPL/2.0/index.f75d2927d3c1.txt")
     ("CC-BY" . "https://creativecommons.org/licenses/by/4.0/legalcode.txt")
-    ("CC-BY-SA" . "https://creativecommons.org/licenses/by-sa/4.0/legalcode.txt")
+    ("CC-BY-SA" .
+     "https://creativecommons.org/licenses/by-sa/4.0/legalcode.txt")
     ("FDL" . "https://www.gnu.org/licenses/fdl-1.3.txt"))
   "Common known licenses.
 
 Each member of this list is of the form (NAME . URL)."
   :group 'create-license
-  :type '(list (string . string)))
+  :type '(list (cons string string)))
 
-;; autoload ?
-(defun create-license-download-common ())
+;;;###autoload
+(defun create-license-download-common ()
+  "Download licenses listed in `create-license-common'."
+  (interactive)
+  (require 'url-handlers)
+  (dolist (license create-license-common)
+    (url-copy-file (cdr license)
+		   (expand-file-name (car license) create-license-directory))))
 
 (provide 'create-license)
 ;;; create-license.el ends here
-- 
cgit v1.2.3