diff options
author | Alan Mackenzie <acm@muc.de> | 2007-01-20 19:27:19 +0000 |
---|---|---|
committer | Alan Mackenzie <acm@muc.de> | 2007-01-20 19:27:19 +0000 |
commit | ecc71db8a41b729fb36eb1a8cb831a913a407797 (patch) | |
tree | 724783fdfb7d43890dad9a816e1fde69032debca | |
parent | fa85e852217be937dd58b0209a2d9359fd509782 (diff) | |
download | emacs-ecc71db8a41b729fb36eb1a8cb831a913a407797.tar.gz |
Add new functions, c-go-list-forward, c-go-list-backward.
-rw-r--r-- | lisp/ChangeLog | 5 | ||||
-rw-r--r-- | lisp/progmodes/cc-defs.el | 18 |
2 files changed, 23 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5fdbd6df100..35cd4348e4b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2007-01-20 Alan Mackenzie <acm@muc.de> + * progmodes/cc-engine.el (c-in-knr-argdecl): Reformulate to do + much more rigorous analysis of putative K&R regions. + +2007-01-20 Alan Mackenzie <acm@muc.de> + * progmodes/cc-defs.el (c-go-list-forward, c-go-list-backward): new functions. diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el index af48eb2e21c..8b5adfb997f 100644 --- a/lisp/progmodes/cc-defs.el +++ b/lisp/progmodes/cc-defs.el @@ -580,6 +580,24 @@ right side of it." ;; Wrappers for common scan-lists cases, mainly because it's almost ;; impossible to get a feel for how that function works. +(defmacro c-go-list-forward () + "Move backward across one balanced group of parentheses. + +Return POINT when we succeed, NIL when we fail. In the latter case, leave +point unmoved." + `(c-safe (let ((endpos (scan-lists (point) 1 0))) + (goto-char endpos) + endpos))) + +(defmacro c-go-list-backward () + "Move backward across one balanced group of parentheses. + +Return POINT when we succeed, NIL when we fail. In the latter case, leave +point unmoved." + `(c-safe (let ((endpos (scan-lists (point) -1 0))) + (goto-char endpos) + endpos))) + (defmacro c-up-list-forward (&optional pos limit) "Return the first position after the list sexp containing POS, or nil if no such position exists. The point is used if POS is left out. |