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)) |
Dave Barach | 605c636 | 2017-01-02 12:22:48 -0500 | [diff] [blame] | 11 | (find-file (concat plugin-name ".am")) |
| 12 | (skel-plugin-makefile-am-fragment) |
| 13 | (setq cmd-args (concat "mkdir -p " plugin-name)) |
Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 14 | (shell-command cmd-args) |
Dave Barach | 605c636 | 2017-01-02 12:22:48 -0500 | [diff] [blame] | 15 | (setq cd-args (concat start-dir "/" plugin-name)) |
Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 16 | (setq default-directory cd-args) |
Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 17 | (find-file (concat plugin-name ".api")) |
Keith Burns (alagalah) | ca46d8c | 2016-03-18 07:22:15 -0700 | [diff] [blame] | 18 | (skel-plugin-api) |
Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 19 | (find-file (concat plugin-name "_all_api_h.h")) |
Keith Burns (alagalah) | ca46d8c | 2016-03-18 07:22:15 -0700 | [diff] [blame] | 20 | (skel-plugin-all-apih) |
Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 21 | (find-file (concat plugin-name ".h")) |
Keith Burns (alagalah) | ca46d8c | 2016-03-18 07:22:15 -0700 | [diff] [blame] | 22 | (skel-plugin-h) |
Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 23 | (find-file (concat plugin-name ".c")) |
Keith Burns (alagalah) | ca46d8c | 2016-03-18 07:22:15 -0700 | [diff] [blame] | 24 | (skel-plugin-main) |
Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 25 | (find-file (concat plugin-name "_msg_enum.h")) |
Keith Burns (alagalah) | ca46d8c | 2016-03-18 07:22:15 -0700 | [diff] [blame] | 26 | (skel-plugin-msg-enum) |
Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 27 | (find-file "node.c") |
Keith Burns (alagalah) | ca46d8c | 2016-03-18 07:22:15 -0700 | [diff] [blame] | 28 | (skel-plugin-node) |
Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 29 | (find-file (concat plugin-name "_test.c")) |
Keith Burns (alagalah) | ca46d8c | 2016-03-18 07:22:15 -0700 | [diff] [blame] | 30 | (skel-plugin-test) |
Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 31 | (cd start-dir)))) |
| 32 | |