From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Spiers Subject: Re: Easily re-indent the #+OPTIONS lines Date: Thu, 17 Jan 2008 17:51:27 +0000 Message-ID: <20080117175127.GO18716@atlantic.linksys.moosehall> References: <87ejchqu0l.fsf@bzg.ath.cx> <87prw0akek.fsf@shellarchive.co.uk> Reply-To: Adam Spiers Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JFYto-00054w-Rz for emacs-orgmode@gnu.org; Thu, 17 Jan 2008 12:51:32 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JFYtm-00050Z-Lh for emacs-orgmode@gnu.org; Thu, 17 Jan 2008 12:51:31 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JFYtm-00050E-EO for emacs-orgmode@gnu.org; Thu, 17 Jan 2008 12:51:30 -0500 Received: from mail.beimborn.com ([70.84.38.100]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JFYtm-0006T8-5D for emacs-orgmode@gnu.org; Thu, 17 Jan 2008 12:51:30 -0500 Received: from mail.beimborn.com (localhost.localdomain [127.0.0.1]) by mail.beimborn.com (8.12.11.20060308/8.12.8) with ESMTP id m0HHpSqn011086 for ; Thu, 17 Jan 2008 11:51:28 -0600 Received: from localhost (localhost [[UNIX: localhost]]) by mail.beimborn.com (8.12.11.20060308/8.12.11/Submit) id m0HHpR9W011079 for emacs-orgmode@gnu.org; Thu, 17 Jan 2008 17:51:27 GMT Content-Disposition: inline In-Reply-To: <87prw0akek.fsf@shellarchive.co.uk> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org On Thu, Jan 17, 2008 at 09:09:07AM +0000, Phil Jackson wrote: > Bastien 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.