From 9c8f4a53d7463c6e65961faba03877085efd65fe Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Wed, 3 Apr 2013 17:40:10 +0200 Subject: [PATCH] org-src.el (org-src-native-tab-command-maybe): Check that we are in a source code block * org-src.el (org-src-native-tab-command-maybe): Check that we are in a source code block. Consider this content: #+HEADERS: :var data1=1 #+BEGIN_SRC emacs-lisp :var data2=2 (message "data1:%S, data2:%S" data1 data2) #+END_SRC Before the fix, hitting TAB on #+HEADERS would throw an error. --- lisp/org-src.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/org-src.el b/lisp/org-src.el index 73e075186..e59021d68 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -877,9 +877,9 @@ issued in the language major mode buffer." (defun org-src-native-tab-command-maybe () "Perform language-specific TAB action. -Alter code block according to effect of TAB in the language major -mode." +Alter code block according to what TAB does in the language major mode." (and org-src-tab-acts-natively + (org-in-src-block-p) (not (equal this-command 'org-shifttab)) (let ((org-src-strip-leading-and-trailing-blank-lines nil)) (org-babel-do-key-sequence-in-edit-buffer (kbd "TAB"))))) -- 2.11.4.GIT