Chrisbarrett/skeletor.el is a powerful project template creator for
Emacs. I used it before, but not very often. Today, I find it is more
convenient for me to issue a command from dired
, here are my tweaks
with it:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
| (setq skeletor-completing-read-function 'ivy-completing-read)
(defun wr/skeletor--read-project-type ()
"Prompt the user to select a project skeleton."
(let* ((skeletons (->> skeletor--project-types
(-map 'SkeletorProjectType-title)
;; (-sort 'string<)
))
(title
(funcall (or skeletor--read-project-type-fn skeletor-completing-read-function)
"Skeleton: " skeletons nil t)))
(--first (equal title (SkeletorProjectType-title it))
skeletor--project-types)))
(defun wr/skeletor-create-project-at (dir skeleton)
"Interactively create a new project with Skeletor.
Use this command from a `Dired' buffer.
"
(interactive (list (dired-current-directory)
(wr/skeletor--read-project-type)))
;; Dynamically rebind the project directory.
(let ((skeletor-project-directory dir))
(skeletor-create-project skeleton)))
|