 
 
 ;;; Commentary:
-;; 
+;;
 ;; This library tries to indent java annotations
 ;; (http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html)
 ;; like the code examples listed in the webpage.


Indents as
@RequestForEnhancement(
    id	     = 2868724,
...

instead of
@RequestForEnhancement(
                       id	     = 2868724,
...

Argument LANGELEM The language element being indented."
    (if (c-only-java-annotations-p langelem)
      c-basic-offset))

(provide 'java-mode-indent-annotations)

LANGELEM to the beginning of this line one sexp at a time.  If
during this traversal, this function only sees whitespaces
followed by either a '@' or a '(' then it returns t."
  (declare-function c-point "cc-defs.el")
  (save-excursion
    (condition-case err ;; return nil if  any errors are thrown by
        ;; forward-sexp
        (let* ((lim (1- (c-point 'bol)))
               (throws (catch 'notAnno
                         (goto-char (cdr langelem))
                         (while (< (point) lim)
                           (if (not (looking-at "\\(\\s \\|\n\\)*\\(@\\|(\\)"))
                               (throw 'notAnno t))
                           (forward-sexp 1)))))
          (if (not throws)
              t)))))

