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
|
;; Known licenses - Only free softwares license
|
||||||
;; I do not like users who use non-free licenses
|
;; I do not like users who use non-free licenses
|
||||||
;; TODO: gather a complete list of free software licenses
|
;; TODO: gather a complete list of free software licenses
|
||||||
|
;; TODO: build a hash variable from licenses
|
||||||
(setq known-licenses '(gpl bsd cc))
|
(setq known-licenses '(gpl bsd cc))
|
||||||
|
|
||||||
;; Each project plugin should use this function for initializing a versy
|
;; Each project plugin should use this function for initializing a versy
|
||||||
;; basic New Project environment.
|
;; basic New Project environment.
|
||||||
(defun new-project () "New project basic function"
|
(defun new-project () "New project basic function"
|
||||||
(setq project-name (read-string "Project Name: "))
|
(setq project-name (read-string "Project Name: "))
|
||||||
;; Shit IDE use unix-project-name for dealing with project OS activity stuffs
|
;; 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
|
;; 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))
|
(if (not (file-exists-p project-path))
|
||||||
(progn
|
(progn
|
||||||
(mkdir project-path)
|
(mkdir project-path)
|
||||||
|
@ -38,7 +39,7 @@
|
||||||
;; TODO: find a way to ask a multi choices question
|
;; TODO: find a way to ask a multi choices question
|
||||||
(setq project-license (read-string "Project License: "))
|
(setq project-license (read-string "Project License: "))
|
||||||
(if (not (member project-license known-licenses))
|
(if (not (member project-license known-licenses))
|
||||||
(setq project-license "other")
|
(setq project-license nil)
|
||||||
)
|
)
|
||||||
(setq project-author (read-string "Project Author: "))
|
(setq project-author (read-string "Project Author: "))
|
||||||
(setq project-home-page (read-string "Home Page: "))
|
(setq project-home-page (read-string "Home Page: "))
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
(define-key global-map [menu-bar file new-proj cproj kmodule] '("Kernel Module" . kmodule))
|
(define-key global-map [menu-bar file new-proj cproj kmodule] '("Kernel Module" . kmodule))
|
||||||
|
|
||||||
(define-key global-map [menu-bar file new-proj cproj separator2] '("--"))
|
(define-key global-map [menu-bar file new-proj cproj separator2] '("--"))
|
||||||
|
|
||||||
(define-key global-map [Ctrl-x p c n ] 'make-cpp)
|
(define-key global-map [Ctrl-x p c n ] 'make-cpp)
|
||||||
(define-key global-map [menu-bar file new-proj cproj cpp-make] '("Make project (C++)" . make-cpp))
|
(define-key global-map [menu-bar file new-proj cproj cpp-make] '("Make project (C++)" . make-cpp))
|
||||||
|
|
||||||
|
@ -38,6 +38,9 @@
|
||||||
(define-key global-map [menu-bar file new-proj cproj cgeneric] '("Generic project (C)" . generic-c))
|
(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"
|
(defun c-new-project () "Create a new C/C++ project"
|
||||||
(new-project)
|
(new-project)
|
||||||
)
|
)
|
||||||
|
@ -45,5 +48,13 @@
|
||||||
(defun generic-c () "Create a generic type C project"
|
(defun generic-c () "Create a generic type C project"
|
||||||
(interactive)
|
(interactive)
|
||||||
(c-new-project)
|
(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)
|
(init-menus)
|
|
@ -66,6 +66,13 @@
|
||||||
(if (= DEBUG 1) (message "[SHIT] DEBUG >>> %s" ARG))
|
(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 ()
|
(defun start-shit ()
|
||||||
"A peace of shit configuration that tune emacs to be an IDE."
|
"A peace of shit configuration that tune emacs to be an IDE."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
|
Loading…
Reference in New Issue