;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\207" [require cl-lib newcomment] 2) (defconst lice:version "0.2") (defconst lice:system-template-directory (byte-code "\302\303\203\f\304!\206 \"\207" [load-file-name default-directory expand-file-name "template" file-name-directory] 4)) (defvar lice:custom-template-directory (expand-file-name "lice" user-emacs-directory)) (byte-code "\304\305\306\307\310\311\312\313\314\315& \210\316\317\320\321\322\323\306\211 :\203: @\324\325\326\327\330\331\332\n@!!#\n@F B A\211\202 \237+\333\"%\210\334\335\336\337\312\305\340\341&\210\334\317\342\343\312\305\340\317&\210\334\344\345\346\312\305\347\350\340\351& \210\334\352\353\354\312\305\347\350\340\351& \210\334\355\356\357\312\305\340\360&\210\334\361\362\363\312\305\340\364&\207" [comment-styles #:--cl-var-- x #:--cl-var-- custom-declare-group lice nil "License And Header Template" :prefix "lice:" :group tools :link (url-link "https://github.com/buzztaiki/lice-el") define-widget lice:comment-style choice "The comment style selection widget." :args append const :tag replace-regexp-in-string "-" " " capitalize symbol-name ((other :tag "Mode Default" nil)) custom-declare-variable lice:license-directories (list lice:system-template-directory lice:custom-template-directory) "The location of License template directories." :type (repeat directory) 'extra-line "The comment style for license insertion.\nWhen nil, `comment-style' value is used." lice:default-license "gpl-3.0" "The default license name." :safe stringp string lice:copyright-holder (user-full-name) "The copyright holder." lice:header-spec '(lice:insert-copyright lice:insert-license) "The license header spec.\nEach element should be function.\nThese functions should take one argument, license object, and\nshould insert header string fragment." (repeat function) lice:mode-comments (append (cl-loop for mode in '(c-mode c++-mode java-mode groovy-mode) collect (list mode :comment-start "/*" :comment-end "*/")) '((nxml-mode :comment-continue " "))) "The definition of mode specific comments.\nEach elements are follows:\n (MODE . PROPERTIES))\nMode is a `major-mode' which is applied PROPERTIES.\nPROPERTIES is a plist whitch has following properties:\n :comment-start - `comment-start' of this MODE.\n :comment-end - `comment-end' of this MODE.\n :comment-style - `comment-style' of this MODE.\n :comment-continue - `comment-continue' of this MODE." (repeat (cons :format "%v" :indent 9 (function :tag "Mode" :size 20) (sexp :tag "" :value-to-internal (lambda (widget value) (prin1-to-string value)))))] 15) (defvar lice:license-history nil) #@71 Return a license list. Each element are follows: (SIMPLE-NAME . FILE) (defalias 'lice:licenses #[nil "\304\211\304 :\203( @\211\203!\305\n!\203!\306 \307\n!\" A\211\202 \310 \311\",\207" [lice:license-directories #1=#:--cl-var-- dir licenses nil file-directory-p append lice:directory-licenses sort #[(a b) "@ @\231\207" [a b] 2]] 5 (#$ . 2718)]) (defalias 'lice:directory-licenses #[(dir) "\306\307\"\310\211\310\211\307\f :\2038 @\311\n!\312\n!\203/\313\f \"\204/\f\nB B A\310\f\202 \237.\207" [dir #1=#:--cl-var-- file licenses name #2=#:--cl-var-- directory-files t nil file-name-nondirectory file-regular-p assoc #3=#:--cl-var--] 4]) #@68 Insert license and headers. NAME is a template name for insertion. (defalias 'lice #[(name) "\306\307 \"\211\204\310\311\"\210\214``}\210\n\312 :\203. @\211 !\210db\210 A\211\202*\313 !\203;\314ed #\210db*\207" [name license lice:header-spec #1=#:--cl-var-- component major-mode assoc lice:licenses error "Unknown license name: %s" nil lice:comment-enabled-p lice:comment-region] 5 (#$ . 3394) (list (lice:read-license))]) (defalias 'lice:insert-copyright #[(license) "\301\302\303\304!#c\207" [lice:copyright-holder format "Copyright (C) %s %s\n\n" format-time-string "%Y"] 4]) (defalias 'lice:insert-license #[(license) "\301A!\210db\210\302\303x\210`d|\210\302c\207" [license insert-file-contents "\n" nil] 2]) (defalias 'lice:read-license #[nil "\301\302\303\"\304 \305\306\305\307&\207" [lice:default-license completing-read format "License Name (%s): " lice:licenses nil t lice:license-history] 8]) (defalias 'lice:mode-comment #[(mode) "\205 \236A\206\302\303N!\207" [mode lice:mode-comments lice:mode-comment derived-mode-parent] 3]) (defalias 'lice:comment-region #[(start end mode) "\306!\307 \310\"\206\f\n\307 \311\"\206 \307 \312\"\206\"\f\206\" \307 \313\"\206,\214}\210\314ed\"\210\315ed\".\207" [mode comment comment-start comment-end lice:comment-style comment-style lice:mode-comment plist-get :comment-start :comment-end :comment-style :comment-continue comment-region delete-trailing-whitespace comment-continue start end] 3]) (defalias 'lice:comment-enabled-p #[(mode) "\303!\304 \305\"\206\f\n)\207" [mode comment comment-start lice:mode-comment plist-get :comment-start] 3]) (provide 'lice)