c-c c-a does seem to work (though it gives me above-and-below bars,
which wasn't what I was using but appears to be fine.)  But I was
actually looking for something more electric - since
describe-text-properties shows

There are text properties here:
  face                 (rst-level-1-face)
  font-lock-multiline  t
  fontified            t

an insert hook could notice that and automatically do the title
adjustment, live.  Halfway through writing this, I found enough rope
(this is incomplete, you need to evaluate it in the buffer that you're
editing, but it only needs a little more cleanup to fit in for
real...) :

; compute this from rst-level-face-max? see rst-define-level-faces
(setq rst-faces (list rst-level-1-face
                      rst-level-2-face
                      rst-level-3-face
                      rst-level-4-face
                      rst-level-5-face
                      rst-level-6-face))


(defun rst-title-change (start end oldlen)
  "hook to auto-change title if we're looking at one"
  ;; check all faces
  (dolist (face-here (or (get-char-property start 'face)
(get-char-property (1- start) 'face)))
    (if (member face-here rst-faces)
        (rst-adjust))))

; run this in rst-mode-hook
(add-hook 'after-change-functions 'rst-title-change nil t)


On Thu, Nov 27, 2008 at 8:02 AM, Doug Hellmann <[EMAIL PROTECTED]> wrote:
>
>
> On Nov 26, 2008, at 7:28 PM, Mark Eichin wrote:
>
>> Speaking of the emacs mode - anyone extended it to automatically
>> adjust title-===-mark lengths?
>>
> The version I downloaded does that already.  I don't have it in front
> of me, but I think the key-binding is C-c, C-a for "adjust title".  It
> only seems to work with the underline portion of the title.
>
>
> >
>



-- 
_Mark_ <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to