I have issues with the use of `current-indentation'.

This value will always return false if you have a rather long line and
break it or like myself and put the `throws' clause on a separate line.

public doSomeThingThat()
   throws somePoo { <-- 4
....
} <-- 2

This is even more trouble if you have to maintain a code base that was
initially written by a different user that used a funky indention scheme
that moved closing braces in a space or two.

Another interesting unexpected behavior; the close brace is not inserted
if there is any amount of whitespace between point and the open brace.  

Here is a better (at least the way I think about) way of doing almost
the same thing.  Without worrying about indention levels, coding styles,
or the myriad other pitfalls the previous way has.

(defun my-jde-brace-hack ()
  (interactive)
  (save-excursion
    (newline)
    (insert "}")
    (indent-according-to-mode)))

(defadvice c-electric-brace (after my-jde-brace-hack activate)
(my-jde-brace-hack))

The `c-electric-brace' should be what ever this returns:
(lookup-key jde-mode-map [(})])

-- 
Bryan Shell                       CivicNet (www.civicnet.net)
Applications Developer                                

**********************************************************************
CONFIDENTIALITY NOTICE:
This E-mail and any attachments are confidential.  If you are not the 
intended recipient, you do not have permission to disclose, copy, 
distribute, or open any attachments.  If you have received this E-mail
in error, please notify us immediately by returning it to the sender 
and delete this copy from your system.  

Thank you.
accessIndiana, MyLocal.IN.gov, CivicNet
**********************************************************************

Reply via email to