For example, this allows one to add ;; Local Variables: ;; eval: (orgstruct-mode 1) ;; org-outline-regexp: ";;; \\*+" ;; org-heading-regexp: "^;;; \\(\\*+\\)\\(.+\\)$" ;; End: to an (e)lisp file. It will make , S-, M-, C-c C-n, C-c C-f, C-c C-u etc. DTRT in terms of orgstruct-mode in that file's buffer. The patch itself is simple. In a nutshell: - Make org-heading-regexp and org-outline-regexp safe local variables. - Change orgstruct-setup to grab the key bindings of all related commands from org-mode-map and outline-mode-map. - Fix some bugs. I also changed org-(forward\|backward)-heading-same-level to DTRT. These functions did non operate on the same level - now they do. This change should not cause any bugs in agenda generation because Org does not use these functions non-interactively. Unfortunately there are many places where Org uses hard-coded regular expressions for headline detection and manipulation. Fortunately all basic outline-related commands except org-demote and org-promote seem to work fine. It would be great if this patch was applied to master. It should not break anything and it should bring Org nearer to achieving world domation, that is to supersede outline-(minor-)mode in all vanilla Emacsen. Also, S- in any prog mode - how cool is that? ;) Christopher