<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -4,8 +4,8 @@
 ;; Author: Karl Landstrom &lt;karl.landstrom@brgeight.se&gt;
 ;; Author: Daniel Colascione &lt;dan.colascione@gmail.com&gt;
 ;; Maintainer: Daniel Colascione &lt;dan.colascione@gmail.com&gt;
-;; Version: 8
-;; Date: 2009-05-22
+;; Version: 9
+;; Date: 2009-07-25
 ;; Keywords: languages, oop, javascript
 
 ;; This file is free software; you can redistribute it and/or modify
@@ -507,7 +507,7 @@ messages.&quot;
   (let ((keymap (make-sparse-keymap)))
     (mapc (lambda (key)
             (define-key keymap key #'espresso-insert-and-indent))
-          '(&quot;+&quot; &quot;-&quot; &quot;/&quot; &quot;*&quot; &quot;{&quot; &quot;}&quot; &quot;(&quot; &quot;)&quot; &quot;:&quot; &quot;;&quot; &quot;,&quot;))
+          '(&quot;+&quot; &quot;-&quot; &quot;*&quot; &quot;{&quot; &quot;}&quot; &quot;(&quot; &quot;)&quot; &quot;:&quot; &quot;;&quot; &quot;,&quot;))
     (define-key keymap [(control ?c) (meta ?:)] #'espresso-js-eval)
     (define-key keymap [(control ?c) (control ?j)] #'espresso-set-js-context)
     (define-key keymap [(control meta ?x)] #'espresso-eval-defun)
@@ -910,22 +910,37 @@ pitem of the function we went to the beginning of.&quot;
     (when pstate
       (goto-char (espresso--pitem-h-begin (car pstate))))))
 
-(defun espresso--beginning-of-defun ()
+(defun espresso--beginning-of-defun (&amp;optional arg)
   &quot;Used as beginning-of-defun-function&quot;
 
-  ;; If we're just past the end of a function, the user probably wants
-  ;; to go to the beginning of *that* function
-  (when (eq (char-before) ?})
-    (backward-char))
+  (setq arg (or arg 1))
+  (while (and (not (eobp)) (&lt; arg 0))
+    (incf arg)
+    (when (and (not espresso-flat-functions)
+               (or (eq (espresso-syntactic-context) 'function)
+                   (espresso--function-prologue-beginning)))
+      (espresso--end-of-defun))
+
+    (if (espresso--re-search-forward
+         &quot;\\_&lt;function\\_&gt;&quot; nil t)
+        (goto-char (espresso--function-prologue-beginning))
+      (goto-char (point-max))))
+
+  (while (&gt; arg 0)
+    (decf arg)
+    ;; If we're just past the end of a function, the user probably wants
+    ;; to go to the beginning of *that* function
+    (when (eq (char-before) ?})
+      (backward-char))
 
-  (let ((prologue-begin (espresso--function-prologue-beginning)))
-    (cond ((and prologue-begin (&lt; prologue-begin (point)))
-           (goto-char prologue-begin))
+    (let ((prologue-begin (espresso--function-prologue-beginning)))
+      (cond ((and prologue-begin (&lt; prologue-begin (point)))
+             (goto-char prologue-begin))
 
-          (espresso-flat-functions
-           (espresso--beginning-of-defun-flat))
-          (t
-           (espresso--beginning-of-defun-nested)))))
+            (espresso-flat-functions
+             (espresso--beginning-of-defun-flat))
+            (t
+             (espresso--beginning-of-defun-nested))))))
 
 (defun espresso--flush-caches (&amp;optional beg ignored)
   &quot;Flush syntax cache info after position BEG. BEG defaults to
@@ -1213,6 +1228,7 @@ given item ends instead of parsing all the way to LIMIT.&quot;
 
 (defun espresso--end-of-defun-nested ()
   &quot;Internal helper for espresso--end-of-defun&quot;
+  (message &quot;test&quot;)
   (let* (pitem
          (this-end (save-excursion
                      (and (setq pitem (espresso--beginning-of-defun-nested))
@@ -1236,26 +1252,37 @@ given item ends instead of parsing all the way to LIMIT.&quot;
         ;; ... or eob.
         (goto-char (point-max))))))
 
-(defun espresso--end-of-defun ()
+(defun espresso--end-of-defun (&amp;optional arg)
   &quot;Used as end-of-defun-function&quot;
-  ;; look for function backward. if we're inside it, go to that
-  ;; function's end. otherwise, search for the next function's end and
-  ;; go there
-  (if espresso-flat-functions
-      (espresso--end-of-defun-flat)
-
-    ;; if we're doing nested functions, see whether we're in the
-    ;; prologue. If we are, go to the end of the function; otherwise,
-    ;; call espresso--end-of-defun-nested to do the real work
-    (let ((prologue-begin (espresso--function-prologue-beginning)))
-      (cond ((and prologue-begin (&lt;= prologue-begin (point)))
-             (goto-char prologue-begin)
-             (re-search-forward &quot;\\_&lt;function&quot;)
-             (goto-char (match-beginning 0))
-             (espresso--forward-function-decl)
-             (forward-list))
-
-            (t (espresso--end-of-defun-nested))))))
+  (setq arg (or arg 1))
+  (while (and (not (bobp)) (&lt; arg 0))
+    (let (orig-pos (point))
+      (incf arg)
+      (espresso--beginning-of-defun)
+      (espresso--beginning-of-defun)
+      (unless (bobp)
+        (espresso--end-of-defun))))
+
+  (while (&gt; arg 0)
+    (decf arg)
+    ;; look for function backward. if we're inside it, go to that
+    ;; function's end. otherwise, search for the next function's end and
+    ;; go there
+    (if espresso-flat-functions
+        (espresso--end-of-defun-flat)
+
+      ;; if we're doing nested functions, see whether we're in the
+      ;; prologue. If we are, go to the end of the function; otherwise,
+      ;; call espresso--end-of-defun-nested to do the real work
+      (let ((prologue-begin (espresso--function-prologue-beginning)))
+        (cond ((and prologue-begin (&lt;= prologue-begin (point)))
+               (goto-char prologue-begin)
+               (re-search-forward &quot;\\_&lt;function&quot;)
+               (goto-char (match-beginning 0))
+               (espresso--forward-function-decl)
+               (forward-list))
+
+              (t (espresso--end-of-defun-nested)))))))
 
 (defun espresso--beginning-of-macro (&amp;optional lim)
   (let ((here (point)))
@@ -1654,7 +1681,7 @@ interatively, also display a message with that context.&quot;
 ;; as the newline is escaped with \. Account for that in the regexp
 ;; below.
 (defconst espresso--regexp-literal
-  &quot;[=(,:]\\(?:\\s-\\|\n\\)*\\(/\\)[^/*]\\(?:.*?[^\\]\\)?\\(/\\)&quot;
+  &quot;[=(,:]\\(?:\\s-\\|\n\\)*\\(/\\)\\(?:\\\\/\\|[^/*]\\)\\(?:\\\\/\\|[^/]\\)*\\(/\\)&quot;
   &quot;Match a regular expression literal. Match groups 1 and 2 are
 the characters forming the beginning and end of the literal&quot;)
 </diff>
      <filename>elpa-to-submit/espresso.el</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f776b46d24450f0496bb00d84cfba8d1d6470732</id>
    </parent>
  </parents>
  <author>
    <name>David Goodlad</name>
    <email>david@goodlad.ca</email>
  </author>
  <url>http://github.com/nickpad/emacs-starter-kit/commit/4f32f47fb383eec57a5dc47e37d69d0597ce7f68</url>
  <id>4f32f47fb383eec57a5dc47e37d69d0597ce7f68</id>
  <committed-date>2009-09-08T14:02:13-07:00</committed-date>
  <authored-date>2009-09-08T14:02:13-07:00</authored-date>
  <message>Update to espresso v9</message>
  <tree>53fc0ebe66da5776ed93b27ba7c4c569c3b615c1</tree>
  <committer>
    <name>David Goodlad</name>
    <email>david@goodlad.ca</email>
  </committer>
</commit>
