[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] orgstruct-mode with custom headline prefix
From: |
Christopher Schmidt |
Subject: |
[O] orgstruct-mode with custom headline prefix |
Date: |
Mon, 28 Jan 2013 17:15:59 +0000 (GMT) |
Hi Org,
here is a patch for master that enables the use of a custom headline
prefix file locally in conjunction with orgstruct-mode.
2013-01-28 Christopher Schmidt <address@hidden>
* org.el (org-outline-regexp, org-heading-regexp): Make them safe
local variables.
(org-outline-regexp-bol): Remove variable, new function. All
users of org-outline-regexp-bol changed.
(org-cycle-global-status, org-cycle-subtree-status): Set state
property.
(org-heading-components): Use org-heading-regexp in
orgstruct-mode.
(orgstruct-mode): Simplify docstring.
(orgstruct-setup): Simplify implementation. Translate keys to
their most general equivalent.
(orgstruct-make-binding): Generate index on the fly, discard
alternative keys.
(org-get-local-variables): Honour state property.
(org-run-like-in-org-mode): Do not override variables with
non-default values.
(org-forward-heading-same-level): Use org-outline-regexp-bol. Do
not skip to parent heading.
(org-backward-heading-same-level): Use
org-forward-heading-same-level.
orgstruct.diff
Description: Text Data
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 <tab>, S-<tab>, M-<ret>, 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-<tab> in any prog mode - how cool is that? ;)
Christopher
- [O] orgstruct-mode with custom headline prefix,
Christopher Schmidt <=
- Re: [O] orgstruct-mode with custom headline prefix, Samuel Wales, 2013/01/28
- Re: [O] orgstruct-mode with custom headline prefix, Christopher Schmidt, 2013/01/31
- Re: [O] orgstruct-mode with custom headline prefix, Bastien, 2013/01/31
- Re: [O] orgstruct-mode with custom headline prefix, Christopher Schmidt, 2013/01/31
- Re: [O] orgstruct-mode with custom headline prefix, Bastien, 2013/01/31
- Re: [O] orgstruct-mode with custom headline prefix, Christopher Schmidt, 2013/01/31
- Re: [O] orgstruct-mode with custom headline prefix, Bastien, 2013/01/31
- Re: [O] orgstruct-mode with custom headline prefix, Christopher Schmidt, 2013/01/31
- Re: [O] orgstruct-mode with custom headline prefix, Christopher Schmidt, 2013/01/31
- Re: [O] orgstruct-mode with custom headline prefix, Thorsten Jolitz, 2013/01/31