forked from FG42/FG42
license template loading done. needs test
This commit is contained in:
parent
76133a7f2b
commit
085117a5c1
|
@ -19,16 +19,17 @@
|
|||
;; Known licenses - Only free softwares license
|
||||
;; I do not like users who use non-free licenses
|
||||
;; TODO: gather a complete list of free software licenses
|
||||
|
||||
;; TODO: build a hash variable from licenses
|
||||
(setq known-licenses '(gpl bsd cc))
|
||||
|
||||
;; Each project plugin should use this function for initializing a versy
|
||||
;; basic New Project environment.
|
||||
(defun new-project () "New project basic function"
|
||||
(setq project-name (read-string "Project Name: "))
|
||||
;; Shit IDE use unix-project-name for dealing with project OS activity stuffs
|
||||
(setq unix-project-name (replace-regexp-in-string "\ " "_" project-name))
|
||||
(setq unix-project-name (downcase (replace-regexp-in-string " " "_" project-name)))
|
||||
;; if specified directory does not exists, shit will make it
|
||||
(setq project-path (read-directory-name "Project Path: " nil nil nil project-name))
|
||||
(setq project-path (read-directory-name "Project Path: " nil nil nil unix-project-name))
|
||||
(if (not (file-exists-p project-path))
|
||||
(progn
|
||||
(mkdir project-path)
|
||||
|
@ -38,7 +39,7 @@
|
|||
;; TODO: find a way to ask a multi choices question
|
||||
(setq project-license (read-string "Project License: "))
|
||||
(if (not (member project-license known-licenses))
|
||||
(setq project-license "other")
|
||||
(setq project-license nil)
|
||||
)
|
||||
(setq project-author (read-string "Project Author: "))
|
||||
(setq project-home-page (read-string "Home Page: "))
|
||||
|
|
|
@ -38,6 +38,9 @@
|
|||
(define-key global-map [menu-bar file new-proj cproj cgeneric] '("Generic project (C)" . generic-c))
|
||||
)
|
||||
|
||||
;; Thsi function exists because maybe SHIT needs more information
|
||||
;; about new project in the feature the new-prject function did not
|
||||
;; cover
|
||||
(defun c-new-project () "Create a new C/C++ project"
|
||||
(new-project)
|
||||
)
|
||||
|
@ -45,5 +48,13 @@
|
|||
(defun generic-c () "Create a generic type C project"
|
||||
(interactive)
|
||||
(c-new-project)
|
||||
(setq current-template-file (concat TEMPLATESPATH "c/generic_c/main.c.tmpl"))
|
||||
(if (project-license)
|
||||
(let (license-data license-file)
|
||||
(setq license-file (concat TEMPLATESPATH (concat "licenses/" (concat project-license ".tmpl"))))
|
||||
(setq license-data (io/read license-file))
|
||||
(log license-data)
|
||||
)
|
||||
)
|
||||
)
|
||||
(init-menus)
|
|
@ -66,6 +66,13 @@
|
|||
(if (= DEBUG 1) (message "[SHIT] DEBUG >>> %s" ARG))
|
||||
)
|
||||
|
||||
|
||||
(defun warning (ARG) "A wrapper around elisp built-in warn
|
||||
function."
|
||||
(warn "[SHIT] WARNING >>> %s ARG")
|
||||
)
|
||||
|
||||
|
||||
(defun start-shit ()
|
||||
"A peace of shit configuration that tune emacs to be an IDE."
|
||||
(interactive)
|
||||
|
|
Loading…
Reference in New Issue