Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 1 | (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") |
| 16 | (plugin-makefile-skel) |
| 17 | (find-file "configure.ac") |
| 18 | (plugin-configure-skel) |
| 19 | (setq default-directory (concat cd-args "/" plugin-name)) |
| 20 | (find-file (concat plugin-name ".api")) |
| 21 | (plugin-api-skel) |
| 22 | (find-file (concat plugin-name "_all_api_h.h")) |
| 23 | (plugin-all-apih-skel) |
| 24 | (find-file (concat plugin-name ".h")) |
| 25 | (plugin-h-skel) |
| 26 | (find-file (concat plugin-name ".c")) |
| 27 | (plugin-main-skel) |
| 28 | (find-file (concat plugin-name "_msg_enum.h")) |
| 29 | (plugin-msg-enum-skel) |
| 30 | (find-file "node.c") |
| 31 | (plugin-node-skel) |
| 32 | (find-file (concat plugin-name "_test.c")) |
| 33 | (plugin-test-skel) |
| 34 | (cd start-dir)))) |
| 35 | |