Commits

Fuco  committed 02d14db

Fix TAB in org-mode: fold on headers, otherwise do the usual thing

  • Participants
  • Parent commits a2eb097

Comments (0)

Files changed (1)

File files/tabs.el

+
 ;;; Tab management
 
 ;; If there is a tab, make it the size of 8 spaces
                                   (unless (or (consp prefix)
                                               mark-active)
                                     (looking-at "\\_>"))))
-    (cond ((minibufferp)
-           (minibuffer-complete))
-          ((smart-tab-must-expand prefix)
-           (if smart-tab-using-hippie-expand
-               (hippie-expand prefix)
-             (dabbrev-expand prefix)))
-          ((smart-indent)))))
+    (cond
+     ((and (eq major-mode 'org-mode)
+           (org-cycle)))
+     ((cond
+       ((minibufferp)
+        (minibuffer-complete))
+       ((smart-tab-must-expand prefix)
+        (if smart-tab-using-hippie-expand
+            (hippie-expand prefix)
+          (dabbrev-expand prefix)))
+       ((smart-indent)))))))
 
 (defun smart-indent ()
   "Indents region if mark is active, or current line otherwise."
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (bind-key "TAB" 'smart-tab)
+(bind-key "TAB" 'smart-tab org-mode-map)