blob: 4f1361a32f20dfb6466bb5a4bb11b0949a8aff61 [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))
Dave Barach605c6362017-01-02 12:22:48 -050011 (find-file (concat plugin-name ".am"))
12 (skel-plugin-makefile-am-fragment)
13 (setq cmd-args (concat "mkdir -p " plugin-name))
Dave Barachb852bfa2016-01-04 15:27:42 -050014 (shell-command cmd-args)
Dave Barach605c6362017-01-02 12:22:48 -050015 (setq cd-args (concat start-dir "/" plugin-name))
Dave Barachb852bfa2016-01-04 15:27:42 -050016 (setq default-directory cd-args)
Dave Barachb852bfa2016-01-04 15:27:42 -050017 (find-file (concat plugin-name ".api"))
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070018 (skel-plugin-api)
Dave Barachb852bfa2016-01-04 15:27:42 -050019 (find-file (concat plugin-name "_all_api_h.h"))
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070020 (skel-plugin-all-apih)
Dave Barachb852bfa2016-01-04 15:27:42 -050021 (find-file (concat plugin-name ".h"))
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070022 (skel-plugin-h)
Dave Barachb852bfa2016-01-04 15:27:42 -050023 (find-file (concat plugin-name ".c"))
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070024 (skel-plugin-main)
Dave Barachb852bfa2016-01-04 15:27:42 -050025 (find-file (concat plugin-name "_msg_enum.h"))
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070026 (skel-plugin-msg-enum)
Dave Barachb852bfa2016-01-04 15:27:42 -050027 (find-file "node.c")
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070028 (skel-plugin-node)
Dave Barachb852bfa2016-01-04 15:27:42 -050029 (find-file (concat plugin-name "_test.c"))
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070030 (skel-plugin-test)
Dave Barachb852bfa2016-01-04 15:27:42 -050031 (cd start-dir))))
32