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