# HG changeset patch # User Alan Mackenzie # Date 1169320975 0 # Node ID bbe81c239799a5d95fc5ab62c51b2f05bf52de64 # Parent e7dd0749900f4256ce295fafed4e9ae686ef97a9 Add new functions, c-go-list-forward, c-go-list-backward. diff -r e7dd0749900f -r bbe81c239799 lisp/progmodes/cc-defs.el --- a/lisp/progmodes/cc-defs.el Sat Jan 20 19:21:30 2007 +0000 +++ b/lisp/progmodes/cc-defs.el Sat Jan 20 19:22:55 2007 +0000 @@ -580,6 +580,24 @@ ;; 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.