summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <schulte.eric@gmail.com>2011-01-11 10:18:48 -0700
committerEric Schulte <schulte.eric@gmail.com>2011-01-11 10:18:48 -0700
commit59773dbef8064bc6c122faebbba90cd2a372f15a (patch)
treed102c69874fb25317b21aaa501ecce88426ef5dc
parentea847dcb5f194aa2d9d32dc2d70f21285e72d9f3 (diff)
downloadorg-mode-59773dbef8064bc6c122faebbba90cd2a372f15a.tar.gz
doc: additional information about resolving org-mode/yasnippet conflicts
Thanks to Jeff Horn for compiling this patch. * doc/org.texi (Conflicts): Adding additional information about resolving org/yasnippet conflicts
-rw-r--r--doc/org.texi20
1 files changed, 19 insertions, 1 deletions
diff --git a/doc/org.texi b/doc/org.texi
index e83909d..40dc5df 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -13423,7 +13423,7 @@ to have other replacement keys, look at the variable
@item @file{yasnippet.el}
@cindex @file{yasnippet.el}
-The way Org-mode binds the TAB key (binding to @code{[tab]} instead of
+The way Org mode binds the TAB key (binding to @code{[tab]} instead of
@code{"\t"}) overrules YASnippet's access to this key. The following code
fixed this problem:
@@ -13434,6 +13434,24 @@ fixed this problem:
(define-key yas/keymap [tab] 'yas/next-field-group)))
@end lisp
+The latest version of yasnippets doesn't play well with Org mode. If the
+above code does not fix the conflict, start by defining the following
+function:
+@lisp
+(defun yas/org-very-safe-expand ()
+ (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
+@end lisp
+
+Then, tell Org mode what to do with the new function:
+@lisp
+(add-hook 'org-mode-hook
+ (lambda ()
+ (make-variable-buffer-local 'yas/trigger-key)
+ (setq yas/trigger-key [tab])
+ (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
+ (define-key yas/keymap [tab] 'yas/next-field)))
+@end lisp
+
@item @file{windmove.el} by Hovav Shacham
@cindex @file{windmove.el}
This package also uses the @kbd{S-<cursor>} keys, so everything written