mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13:04 +00:00
Document yas/new-snippet better
This commit is contained in:
parent
fb45d0e45a
commit
3ce27b8e92
12
yasnippet.el
12
yasnippet.el
@ -2277,8 +2277,11 @@ where snippets of table might exist."
|
|||||||
;; create the .yas-parents file here...
|
;; create the .yas-parents file here...
|
||||||
candidate)))))
|
candidate)))))
|
||||||
|
|
||||||
(defun yas/new-snippet (&optional choose-instead-of-guess)
|
(defun yas/new-snippet (&optional NO-TEMPLATE)
|
||||||
""
|
"Pops a new buffer for writing a snippet.
|
||||||
|
|
||||||
|
Expands a snippet-writing snippet, unless the optional prefix arg
|
||||||
|
NO-TEMPLATE is non-nil."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(let ((guessed-directories (yas/guess-snippet-directories)))
|
(let ((guessed-directories (yas/guess-snippet-directories)))
|
||||||
|
|
||||||
@ -2286,12 +2289,11 @@ where snippets of table might exist."
|
|||||||
(erase-buffer)
|
(erase-buffer)
|
||||||
(kill-all-local-variables)
|
(kill-all-local-variables)
|
||||||
(snippet-mode)
|
(snippet-mode)
|
||||||
|
(yas/minor-mode 1)
|
||||||
(set (make-local-variable 'yas/guessed-modes) (mapcar #'(lambda (d)
|
(set (make-local-variable 'yas/guessed-modes) (mapcar #'(lambda (d)
|
||||||
(intern (yas/table-name (car d))))
|
(intern (yas/table-name (car d))))
|
||||||
guessed-directories))
|
guessed-directories))
|
||||||
(unless (and choose-instead-of-guess
|
(unless no-template (yas/expand-snippet "\
|
||||||
(not (y-or-n-p "Insert a snippet with useful headers? ")))
|
|
||||||
(yas/expand-snippet "\
|
|
||||||
# -*- mode: snippet -*-
|
# -*- mode: snippet -*-
|
||||||
# name: $1
|
# name: $1
|
||||||
# key: $2${3:
|
# key: $2${3:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user