blob: 006ae54dc1142e645b06ac0ab69f25eda1f6ba54 [file] [log] [blame]
Dave Barachb852bfa2016-01-04 15:27:42 -05001(defun make-plugin ()
2 "Create a plugin"
3 (interactive)
4 (save-excursion
5 (let (cd-args cmd-args start-dir)
6 (setq start-dir default-directory)
7 (makunbound 'plugin-name)
8 (makunbound 'PLUGIN-NAME)
9 (setq plugin-name (read-string "Plugin name: "))
10 (setq PLUGIN-NAME (upcase plugin-name))
11 (setq cmd-args (concat "mkdir -p " plugin-name "-plugin/" plugin-name))
12 (shell-command cmd-args)
13 (setq cd-args (concat start-dir plugin-name "-plugin"))
14 (setq default-directory cd-args)
15 (find-file "Makefile.am")
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070016 (skel-plugin-makefile)
Dave Barachb852bfa2016-01-04 15:27:42 -050017 (find-file "configure.ac")
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070018 (skel-plugin-configure)
Dave Barachb852bfa2016-01-04 15:27:42 -050019 (setq default-directory (concat cd-args "/" plugin-name))
20 (find-file (concat plugin-name ".api"))
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070021 (skel-plugin-api)
Dave Barachb852bfa2016-01-04 15:27:42 -050022 (find-file (concat plugin-name "_all_api_h.h"))
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070023 (skel-plugin-all-apih)
Dave Barachb852bfa2016-01-04 15:27:42 -050024 (find-file (concat plugin-name ".h"))
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070025 (skel-plugin-h)
Dave Barachb852bfa2016-01-04 15:27:42 -050026 (find-file (concat plugin-name ".c"))
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070027 (skel-plugin-main)
Dave Barachb852bfa2016-01-04 15:27:42 -050028 (find-file (concat plugin-name "_msg_enum.h"))
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070029 (skel-plugin-msg-enum)
Dave Barachb852bfa2016-01-04 15:27:42 -050030 (find-file "node.c")
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070031 (skel-plugin-node)
Dave Barachb852bfa2016-01-04 15:27:42 -050032 (find-file (concat plugin-name "_test.c"))
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070033 (skel-plugin-test)
Dave Barachb852bfa2016-01-04 15:27:42 -050034 (cd start-dir))))
35