changeset 75313:bbe81c239799

Add new functions, c-go-list-forward, c-go-list-backward.
author Alan Mackenzie <acm@muc.de>
date Sat, 20 Jan 2007 19:22:55 +0000
parents e7dd0749900f
children 6d97677620db
files lisp/progmodes/cc-defs.el
diffstat 1 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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.