#7 Increased freedom of cursor placement and use of indentation

closed
5
2003-03-06
2003-01-26
Anonymous
No

pb@instadia.net

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.

Sincerely,
Philip Bergen, Copenhagen.

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

----------------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

Discussion

  • Ryan T. Sammartino

    Logged In: YES
    user_id=152677

    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