aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2023-10-06 01:19:10 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2023-10-06 01:19:10 +0100
commitb1ba11dc647ce9d24531f67854d61743dc8741db (patch)
treed7f0dc1d443b499209fff783f60683036d89c5a1
parent300e8cbabd689c570fa35d1e32a3ed0f93cdcb20 (diff)
downloaddotfiles-b1ba11dc647ce9d24531f67854d61743dc8741db.tar.gz
dotfiles-b1ba11dc647ce9d24531f67854d61743dc8741db.tar.bz2
dotfiles-b1ba11dc647ce9d24531f67854d61743dc8741db.zip
(Emacs)~license.el separates pure string functions from interactive
-rw-r--r--Emacs/.config/emacs/elisp/license.el33
1 files changed, 21 insertions, 12 deletions
diff --git a/Emacs/.config/emacs/elisp/license.el b/Emacs/.config/emacs/elisp/license.el
index f964f6c..8ea64fd 100644
--- a/Emacs/.config/emacs/elisp/license.el
+++ b/Emacs/.config/emacs/elisp/license.el
@@ -412,26 +412,35 @@ OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org>")))
-(defun +license/insert-complete-license ()
+(defun +license/choose-copy-of-license ()
(interactive)
(let ((choice (completing-read "Choose license: " (mapcar #'car +license/licenses-alist)
nil t)))
- (insert (car (alist-get choice +license/licenses-alist "" nil #'string=)))))
+ (car (alist-get choice +license/licenses-alist "" nil #'string=))))
-(defun +license/insert-copyright-notice ()
- (interactive)
+(defun +license/copyright-notice ()
(let ((license-name (or (if (listp +license/license-choice)
(car +license/license-choice)
+license/license-choice)
"Unlicense")))
- (insert (format "Copyright (C) %s %s
-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 this file. If not, please write to: %s."
- (format-time-string "%Y")
- user-full-name
- license-name
- license-name
- user-mail-address))))
+ (format "Copyright (C) %s %s
+
+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
+this file. If not, please write to: %s."
+ (format-time-string "%Y")
+ user-full-name
+ license-name
+ license-name
+ user-mail-address)))
+
+(defun +license/insert-complete-license ()
+ (interactive)
+ (insert (+license/choose-copy-of-license)))
+
+(defun +license/insert-copyright-notice ()
+ (interactive)
+ (insert (+license/copyright-notice)))
(provide 'license)
;;; license.el ends here