From 69df357ae836105f1dbaa0afe8df6cdee0d74030 Mon Sep 17 00:00:00 2001
From: capitaomorte
(add-hook 'org-mode-hook
- #'(lambda ()
- (setq yas/fallback-behavior
- `(apply ,(lookup-key org-mode-map [tab])))
- (local-set-key [tab] 'yas/expand)))
+ (let ((original-command (lookup-key org-mode-map [tab])))
+ `(lambda ()
+ (setq yas/fallback-behavior
+ '(apply ,original-command))
+ (local-set-key [tab] 'yas/expand))))
replace org-mode-hook and org-mode-map with the major mode -hook you are dealing with (C-h m to see what major mode you are -in).
+hook you are dealing with (Use C-h m to see what major mode you +are in).As an alternative, you can also try
(defun yas/advise-indent-function (function-symbol)
(eval `(defadvice ,function-symbol (around yas/try-expand-first activate)
@@ -110,10 +111,12 @@ in).
To advise the modes indentation function bound to TAB, (in this case ruby-indent-line) to first try to run yas/expand.
-If The output of C-h k RET <tab> tells you that <tab> is +
If the output of C-h k RET <tab> tells you that <tab> is indeed bound to yas/expand but YASnippet still doesn't work, check your configuration and you may also ask for help on the discussion -group.
+group. See this +particular thread for +quite some solutions and alternatives.Don't forget to attach the information on what command is bound to TAB as well as the mode information (Can be obtained by C-h m).
diff --git a/doc/faq.rst b/doc/faq.rst index ab799ea..ad1fa72 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -47,14 +47,15 @@ code to work around: .. sourcecode:: lisp (add-hook 'org-mode-hook - #'(lambda () - (setq yas/fallback-behavior - `(apply ,(lookup-key org-mode-map [tab]))) - (local-set-key [tab] 'yas/expand))) + (let ((original-command (lookup-key org-mode-map [tab]))) + `(lambda () + (setq yas/fallback-behavior + '(apply ,original-command)) + (local-set-key [tab] 'yas/expand)))) replace ``org-mode-hook`` and ``org-mode-map`` with the major mode -hook you are dealing with (``C-h m`` to see what major mode you are -in). +hook you are dealing with (Use ``C-h m`` to see what major mode you +are in). As an alternative, you can also try @@ -75,10 +76,13 @@ As an alternative, you can also try To *advise* the modes indentation function bound to TAB, (in this case ``ruby-indent-line``) to first try to run ``yas/expand``. -If The output of ``C-h k RET