I restructured (pun intended) the emacs support
commit62faf43164e8327e33180486b3951bc156e581e1
authorblais <blais@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>
Tue, 29 Mar 2005 23:33:48 +0000 (29 23:33 +0000)
committerblais <blais@929543f6-e4f2-0310-98a6-ba3bd3dd1d04>
Tue, 29 Mar 2005 23:33:48 +0000 (29 23:33 +0000)
treefad6984dd2db6867f39682a5e065d4d6dba8388c
parentcfbd0aee6648e515ef6cd3bd3ec5db34a2d052d6
I restructured (pun intended) the emacs support
for restructuredtext.   Basically, I replaced
the function that can create a box title (it was
recent) by a generic function that does everything
that you would want to do around a section title.
I tried to make the ultimate underlining function
on a single binding. (This code was started on
the way back from PyCon with Mr. docutils himself
sitting next to me driving while I was coding.)

Invocation of this function multiple times will do
more of what you like.  It's a bit hard to explain,
full details are in the LISP code, but really, the best
thing is to bind it and try it out in your documents.

This makes it much easier to create/update
section titles.  Let me know of any ideas
on how this could be improved.

;; You should bind the versatile sectioning command to some key in the text-mode
;; hook. Something like this::
;;
;;   (defun user-rst-mode-hook ()
;;     (local-set-key [(control ?=)] 'rest-adjust-section-title)
;;     )
;;   (add-hook 'text-mode-hook 'user-rst-mode-hook)
;;

Enjoy! (I think you will.)

git-svn-id: https://docutils.svn.sourceforge.net/svnroot/docutils/trunk/docutils@3146 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
tools/editors/emacs/restructuredtext.el