emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Easily re-indent the #+OPTIONS lines


From: Adam Spiers
Subject: Re: [Orgmode] Easily re-indent the #+OPTIONS lines
Date: Thu, 17 Jan 2008 17:51:27 +0000
User-agent: Mutt/1.5.14 (2007-02-12)

On Thu, Jan 17, 2008 at 09:09:07AM +0000, Phil Jackson wrote:
> Bastien <address@hidden> writes:
> > I often fiddle around #+AUTHOR, #+TITLE, and other such lines.  But
> > having to re-align them so that it looks better is time-consuming.
> 
>  ,----
>  | (align-regexp (point-min) (point-max) "^#\\+[A-Z_]+:\\( +\\)" 1 5)
>  `----

`align-regexp' comes from align.el which also provides
`align-rules-list', a customizable variable which defines how the
DWIM `align' function behaves.  Therefore it would be even nicer if
org-mode automatically ensured that `align-rules-list' contained the
right settings for attaining this!  The following works for me when
included in `align-rules-list':

 '(org-in-buffer-settings
   (regexp . "^#\\+[A-Z_]+:\\(\\s-*\\)\\S-+")
   (modes '(org-mode)))

When I select the region and do M-x align, it does the right thing.

So the code could check whether there is an entry with this title
`org-in-buffer-settings' in the list, and if not, add it - thereby
allowing personal customization to override the automatically provided
default.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]