Fix auto-insert templates and macro
This commit is contained in:
parent
db601a903d
commit
5728518b73
1 changed files with 5 additions and 5 deletions
|
@ -7,8 +7,8 @@
|
|||
(setq auto-insert-alist '())))
|
||||
|
||||
(after "yasnippet"
|
||||
(defun template (file-regexp uuid mode &optional project-only)
|
||||
(define-auto-insert file-regexp `(lambda () (my--template-insert ,uuid ',mode ,project-only))))
|
||||
(defmacro template (file-regexp uuid mode &optional project-only)
|
||||
`(define-auto-insert ,file-regexp '(lambda () (my--template-insert ,uuid ,mode ,project-only))))
|
||||
|
||||
(defun my--template-insert (uuid mode &optional project-only)
|
||||
"Expand snippet template in MODE by its UUID"
|
||||
|
@ -23,8 +23,8 @@
|
|||
|
||||
;; C/C++
|
||||
(template "/Makefile$" "%%" 'makefile-gmake-mode)
|
||||
(template "/main\\.\\([Cc]\\|cc\\|cpp\\)$" "%main.cpp%" 'c++-mode)
|
||||
(template "/win32_\\.\\([Cc]\\|cc\\|cpp\\)$" "%winmain.cpp%" 'c++-mode)
|
||||
(template "/main\\.\\(cc\\|cpp\\)$" "%main.cpp%" 'c++-mode)
|
||||
(template "/win32_\\.\\(cc\\|cpp\\)$" "%winmain.cpp%" 'c++-mode)
|
||||
(template "\\.\\([Hh]\\|hpp\\)$" "%.h%" 'c++-mode)
|
||||
(template "\\.\\([Cc]\\|cc\\|cpp\\)$" "%.cpp%" 'c++-mode)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue