Config publishing: capitalize snippet names
This commit is contained in:
parent
a4a04c28c4
commit
2652b52d95
|
@ -17,9 +17,20 @@
|
||||||
(replace-regexp-in-string
|
(replace-regexp-in-string
|
||||||
"[-_]" " "
|
"[-_]" " "
|
||||||
name))))
|
name))))
|
||||||
|
(if (string= "" out) "File template"
|
||||||
|
(let ((sentence (expand-text-abbrevs out)))
|
||||||
|
(concat (char-to-string (upcase (aref sentence 0)))
|
||||||
|
(substring sentence 1))))))
|
||||||
|
|
||||||
|
(defun expand-text-abbrevs (str)
|
||||||
|
(mapconcat
|
||||||
|
(lambda (word)
|
||||||
(cond
|
(cond
|
||||||
((string= "" out) "File Template")
|
((string= word "src") "source")
|
||||||
(t out))))
|
((string-match-p "args?" word) (replace-regexp-in-string "arg" "argument" word))
|
||||||
|
(t word)))
|
||||||
|
(split-string str)
|
||||||
|
" "))
|
||||||
|
|
||||||
(princ
|
(princ
|
||||||
(concat
|
(concat
|
||||||
|
|
Loading…
Reference in a new issue