#7 Increased freedom of cursor placement and use of indentation



Hi! Great stuff!
-Sorry about the empty post, my last submission
disappeared and I didn't want to try again lest I could
see it work. :o.

I borrow some from doxygen.el which lacks doxymacs
functionality but is way more elegant in use.

If you end the function-comment with a newline and
start by going to the beginning of the line it will
allow the user to insert comment after having typed
function definition.

I tried to get indentation to work too, but I do not
know *lisp and must have made an error. If you can fix
it (I think start is void), it will use local
indentation rules on the just inserted comment.

Philip Bergen, Copenhagen.

------------My version:
(defconst doxymacs-JavaDoc-function-comment-template
(let ((start (point)))
(let ((next-func (doxymacs-find-next-func)))
(if next-func
"/**" '> 'n
" \todo DOCS" 'p '> 'n
(doxymacs-parm-tempo-element (cdr (assoc 'args
(unless (string-match
(regexp-quote (cdr (assoc 'return next-func)))
'(l " @return " (p "Returns: ") > n))
"*/" '> 'n '>)
(error "Can't find next function declaration.")
(let ((end (point)))
(indent-region start end nil))))
"Default JavaDoc-style template for function

----------------Where I borrowed some:
;;; doxygen.el --- support for doxygen style comments

;; Copyright (C) 2000 Basis Technology, Corp.

;; Author: Tom Emerson <tree@basistech.com>
;; Keywords: languages comments doxygen
;; Version: 1.1


  • Ryan T. Sammartino

    Logged In: YES

    I'm afraid I'm not 100% clear on what you are asking for.

    You are asking for the default function comment to:
    - move to the beginning of the current line;
    - insert doxygen comments;
    - add an extra newline.

    This can all be done with your own customised template. All
    the default templates operate under the assumption that user
    knows where he wants his comments to appear better than I
    do, so they work exactly where the current point is.

    As for why your template doesn't indent properly, cc-mode
    doesn't indent comment lines that begin at column 0, so
    you'll need to add 1 space before the /** to get it to indent.

    Please follow up with a clarification.

  • Ryan T. Sammartino

    • status: open --> closed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks