mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +00:00
dynamic set parent supported
This commit is contained in:
parent
7fc130fdf9
commit
0febc22d72
10
yasnippet.el
10
yasnippet.el
@ -855,6 +855,16 @@ real mode."
|
|||||||
,(yas/make-menu-binding (yas/template-content template))
|
,(yas/make-menu-binding (yas/template-content template))
|
||||||
:keys ,(concat key yas/trigger-symbol))))))))
|
:keys ,(concat key yas/trigger-symbol))))))))
|
||||||
|
|
||||||
|
(defun yas/set-mode-parent (mode parent)
|
||||||
|
"Set parent mode of MODE to PARENT."
|
||||||
|
(setf (yas/snippet-table-parent
|
||||||
|
(yas/snippet-table mode))
|
||||||
|
(yas/snippet-table parent))
|
||||||
|
(when yas/use-menu
|
||||||
|
(define-key (yas/menu-keymap-for-mode mode) (vector 'parent-mode)
|
||||||
|
`(menu-item "parent mode"
|
||||||
|
,(yas/menu-keymap-for-mode parent)))))
|
||||||
|
|
||||||
(defun yas/define (mode key template &optional name)
|
(defun yas/define (mode key template &optional name)
|
||||||
"Define a snippet. Expanding KEY into TEMPLATE.
|
"Define a snippet. Expanding KEY into TEMPLATE.
|
||||||
NAME is a description to this template. Also update
|
NAME is a description to this template. Also update
|
||||||
|
Loading…
x
Reference in New Issue
Block a user