(Emacs/elisp/license)~Behavior when licence-choice is NIL

Instead of defaulting to the Unlicense, we now completely copyright
the material.  This is the default behavior when a LICENSE is not
attached to a project in open source: copyright is completely
preserved.
This commit is contained in:
2024-04-18 15:23:54 +06:30
parent 65c7cd0138
commit 198f8d57d8

View File

@@ -419,20 +419,22 @@ For more information, please refer to <https://unlicense.org>")))
(car (alist-get choice +license/licenses-alist "" nil #'string=)))) (car (alist-get choice +license/licenses-alist "" nil #'string=))))
(defun +license/copyright-notice () (defun +license/copyright-notice ()
(let ((license-name (or (if (listp +license/license-choice) (let ((license-name (if (listp +license/license-choice)
(car +license/license-choice) (car +license/license-choice)
+license/license-choice) +license/license-choice)))
"Unlicense"))) (concat
(format "Copyright (C) %s %s (format "Copyright (C) %s %s\n\n" (format-time-string "%Y") user-full-name)
(if license-name
You may distribute and modify this code under the terms of the %s (format "You may distribute and modify this code under the terms of the %s
license. You should have received a copy of the %s license with license. You should have received a copy of the %s license with
this file. If not, please write to: %s." this file. If not, please write to: %s."
(format-time-string "%Y") license-name
user-full-name license-name
license-name user-mail-address)
license-name (format
user-mail-address))) "All rights reserved. You may not distribute or modify this code
without explicit legal permission from the author \"%s\""
user-full-name)))))
(defun +license/insert-complete-license () (defun +license/insert-complete-license ()
(interactive) (interactive)