From: Anders B. <agb...@gm...> - 2012-09-04 07:35:17
|
Hi First off. Thanks a lot for all the great work you guys have done with cc-mode. It's a great mode. I just had a question. I recently upgraded my emacs to 24.1 which also came with a newer cc-mode. I was kinda excited that it seemed to have learned about inline functions but quickly came to the conclusion that I wanted separate functions for what used to be c-(beginning|end)-of-defun and c-mark-function. Essentially I'd like to be able to either jump to the beginning of the class or the beginning of the function even if I am inside an inline member function. Similarly I want to be able to mark the whole class regardless of current position within the class. I was able to hack something together for the latter case but it didn't feel right at all and I have to assume that this kind of thing could break at any minor release. E.g. (defun mark-non-inline-function-or-class() (interactive) (let ((cur (car (c-point-syntax))) (old (point)) (classpos nil)) (if (eq (car cur) 'inclass) (setq classpos (car (cdr cur))) (progn (goto-char (- (car (cdr cur)) 1)) (setq cur (car (c-point-syntax))) (if (eq (car cur) 'inclass) (setq classpos (car (cdr cur)))))) (if classpos (progn (goto-char (+ classpos 1)) (mark-defun)) (progn (goto-char old) (mark-defun)) ) ) ) Is there a supported way to do this? If not, any chance there will be one in the future? regards Anders |