* new default: (setq yas/show-menu-p 'abbreviate)

* `yas/visit-snippet' now ignores yas/prompt-functions
* default `yas/buffer-local-condition' only restrictive for trigger key expansions
This commit is contained in:
capitaomorte 2010-05-15 20:10:33 +00:00
parent 2ccd85a726
commit 503e105b3e

View File

@ -354,7 +354,7 @@ This affects `yas/insert-snippet', `yas/visit-snippet-file'"
:type 'boolean :type 'boolean
:group 'yasnippet) :group 'yasnippet)
(defcustom yas/use-menu 'real-modes (defcustom yas/use-menu 'abbreviate
"Display a YASnippet menu in the menu bar. "Display a YASnippet menu in the menu bar.
When non-nil, submenus for each snippet table will be listed When non-nil, submenus for each snippet table will be listed
@ -480,8 +480,9 @@ Attention: These hooks are not run when exiting nested/stackd snippet expansion!
"Hooks to run just before expanding a snippet.") "Hooks to run just before expanding a snippet.")
(defvar yas/buffer-local-condition (defvar yas/buffer-local-condition
'(if (or (fourth (syntax-ppss)) '(if (and (or (fourth (syntax-ppss))
(fifth (syntax-ppss))) (fifth (syntax-ppss)))
(eq (symbol-function this-command) 'yas/expand-from-trigger-key))
'(require-snippet-condition . force-in-comment) '(require-snippet-condition . force-in-comment)
t) t)
"Snippet expanding condition. "Snippet expanding condition.
@ -2282,6 +2283,7 @@ visited file in `snippet-mode'."
(interactive) (interactive)
(let* ((yas/buffer-local-condition 'always) (let* ((yas/buffer-local-condition 'always)
(templates (yas/all-templates (yas/get-snippet-tables))) (templates (yas/all-templates (yas/get-snippet-tables)))
(yas/prompt-functions '(yas/ido-prompt yas/completing-prompt))
(template (and templates (template (and templates
(or (yas/prompt-for-template templates (or (yas/prompt-for-template templates
"Choose a snippet template to edit: ") "Choose a snippet template to edit: ")
@ -4149,7 +4151,8 @@ that the rest of `yas/post-command-handler' runs.")
;;; Fancy docs: ;;; Fancy docs:
(put 'yas/expand 'function-documentation '(yas/expand-from-trigger-key-doc)) (put 'yas/expand 'function-documentation
'(yas/expand-from-trigger-key-doc))
(defun yas/expand-from-trigger-key-doc () (defun yas/expand-from-trigger-key-doc ()
"A doc synthethizer for `yas/expand-from-trigger-key-doc'." "A doc synthethizer for `yas/expand-from-trigger-key-doc'."
(let ((fallback-description (let ((fallback-description