no need to lookup local keymap: if there's one, yas/expand shouldn't be executed.

This commit is contained in:
Zhang Chiyuan 2008-03-07 10:45:36 +00:00
parent 926766ce80
commit 6d19b3eb12

View File

@ -626,17 +626,13 @@ hierarchy."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun yas/default-trigger-fallback () (defun yas/default-trigger-fallback ()
"Default fallback when a snippet expansion failed. "Default fallback when a snippet expansion failed.
The default behavior is first lookup if there's binding for <tab> It looks key binding for TAB. If found, execute it. If not found.
in local keymap. If found, execute it. If not found, then look up Run `indent-for-tab-command'."
binding for TAB. If still not found, run `indent-for-tab-command'."
(interactive) (interactive)
(let ((command (local-key-binding (kbd "<tab>")))) (let ((command (key-binding (kbd "TAB"))))
(if command (if command
(call-interactively command) (call-interactively command)
(setq command (key-binding (kbd "TAB"))) (call-interactively 'indent-for-tab-command))))
(if command
(call-interactively command)
(call-interactively 'indent-for-tab-command)))))
(defun yas/about () (defun yas/about ()
(interactive) (interactive)