mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +00:00
* Fixed issue 87. Needs testing
This commit is contained in:
parent
7686db3476
commit
b1c079f1e4
14
yasnippet.el
14
yasnippet.el
@ -150,6 +150,7 @@
|
|||||||
"Yet Another Snippet extension"
|
"Yet Another Snippet extension"
|
||||||
:group 'editing)
|
:group 'editing)
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
(defcustom yas/root-directory nil
|
(defcustom yas/root-directory nil
|
||||||
"Root directory that stores the snippets for each major mode.
|
"Root directory that stores the snippets for each major mode.
|
||||||
|
|
||||||
@ -160,11 +161,11 @@ bulk reloading of all snippets using `yas/reload-all'"
|
|||||||
|
|
||||||
:type '(string)
|
:type '(string)
|
||||||
:group 'yasnippet
|
:group 'yasnippet
|
||||||
|
:require 'yasnippet
|
||||||
:set #'(lambda (symbol roots)
|
:set #'(lambda (symbol roots)
|
||||||
(set-default symbol roots)
|
(set-default symbol roots)
|
||||||
(if (require 'yasnippet nil t)
|
(if (fboundp 'yas/reload-all)
|
||||||
(yas/reload-all)
|
(yas/reload-all))))
|
||||||
(message "[yas] warning: could set `yas/root-directory' since yasnippet is missing"))))
|
|
||||||
|
|
||||||
(defcustom yas/prompt-functions '(yas/x-prompt
|
(defcustom yas/prompt-functions '(yas/x-prompt
|
||||||
yas/dropdown-prompt
|
yas/dropdown-prompt
|
||||||
@ -654,6 +655,7 @@ Here's an example:
|
|||||||
(define-key yas/minor-mode-map "\C-c&\C-v" 'yas/visit-snippet-file)
|
(define-key yas/minor-mode-map "\C-c&\C-v" 'yas/visit-snippet-file)
|
||||||
(define-key yas/minor-mode-map "\C-c&\C-f" 'yas/find-snippets))
|
(define-key yas/minor-mode-map "\C-c&\C-f" 'yas/find-snippets))
|
||||||
|
|
||||||
|
;;;### eval this on require!
|
||||||
(progn
|
(progn
|
||||||
(yas/init-minor-keymap))
|
(yas/init-minor-keymap))
|
||||||
|
|
||||||
@ -747,6 +749,7 @@ behaviour.")
|
|||||||
(list "Load this snippet" 'yas/load-snippet-buffer "\C-c\C-c")
|
(list "Load this snippet" 'yas/load-snippet-buffer "\C-c\C-c")
|
||||||
(list "Try out this snippet" 'yas/tryout-snippet "\C-c\C-t"))))))
|
(list "Try out this snippet" 'yas/tryout-snippet "\C-c\C-t"))))))
|
||||||
|
|
||||||
|
;;;### eval this on require!
|
||||||
(progn
|
(progn
|
||||||
(yas/init-major-keymap))
|
(yas/init-major-keymap))
|
||||||
|
|
||||||
@ -1404,6 +1407,11 @@ content of the file is the template."
|
|||||||
|
|
||||||
(message "done.")))
|
(message "done.")))
|
||||||
|
|
||||||
|
;;;### eval this on require!
|
||||||
|
(progn
|
||||||
|
(when yas/root-directory
|
||||||
|
(yas/reload-all)))
|
||||||
|
|
||||||
(defun yas/quote-string (string)
|
(defun yas/quote-string (string)
|
||||||
"Escape and quote STRING.
|
"Escape and quote STRING.
|
||||||
foo\"bar\\! -> \"foo\\\"bar\\\\!\""
|
foo\"bar\\! -> \"foo\\\"bar\\\\!\""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user