1

Have anybody extended comment-dwim to automagically insert a multi-line comment like

/** ...
 */
void foo
{
}

if the cursor is currently in front of a function/variable definition/declaration?

I realize that the challenge here is context detection; could a call to end-of-defun() followed by a call to beginning-of-defun() be used here?

1
  • It's presumably no less work for Emacs, but if you want to test the very beginning of the defun, you could test (eq (point) (car (bounds-of-thing-at-point 'defun))). Perhaps preceded by (while (comment-forward 1)), and all wrapped in a save-excursion I imagine.
    – phils
    Commented Nov 13, 2017 at 0:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.