branch: externals/a68-mode
commit 9a12321caa64f7ea6d34d03ec3c12ad834bc62b6
Author: Jose E. Marchesi <jose.march...@oracle.com>
Commit: Jose E. Marchesi <jose.march...@oracle.com>

    Group beginning-of-defun functions together
---
 a68-mode.el | 53 ++++++++++++++++++++++++++++-------------------------
 1 file changed, 28 insertions(+), 25 deletions(-)

diff --git a/a68-mode.el b/a68-mode.el
index 2cff64086e..5156833780 100644
--- a/a68-mode.el
+++ b/a68-mode.el
@@ -299,6 +299,34 @@
                                      'syntax-multiline t)))))
      (point) end)))
 
+;;;; Functions to move up and down a procedure.
+
+(defun a68-beginning-of-defun-upper (&optional count)
+  "Algol 68 specific `beginning-of-defun-function' for UPPER stropping."
+  (let ((count (or count 1))
+        (case-fold-search nil)
+        res)
+    (while (> count 0)
+      (goto-char (save-excursion
+                   (while (and (re-search-backward (rx bow (or "PROC" "OP") 
eow) nil t)
+                               (a68-within-string-or-comment)))
+                   (setq res (point))))
+      (setq count (1- count )))
+    res))
+
+(defun a68-beginning-of-defun-supper (&optional count)
+  "Algol 68 specific `beginning-of-defun-function' for SUPPER stropping."
+  (let ((count (or count 1))
+        (case-fold-search nil)
+        res)
+    (while (> count 0)
+      (goto-char (save-excursion
+                   (while (and (re-search-backward (rx bow (or "proc" "op") 
eow) nil t)
+                               (a68-within-string-or-comment)))
+                   (setq res (point))))
+      (setq count (1- count )))
+    res))
+
 ;;;; UPPER stropping
 
 (defvar a68--smie-grammar-upper
@@ -394,18 +422,6 @@
           (smie-rule-prev-p "ELSE")
           (smie-rule-parent)))))
 
-(defun a68-beginning-of-defun-upper (&optional count)
-  "Algol 68 specific `beginning-of-defun-function'."
-  (let ((count (or count 1))
-        (case-fold-search nil)
-        res)
-    (while (> count 0)
-      (goto-char (save-excursion
-                   (while (and (re-search-backward (rx bow (or "PROC" "OP") 
eow) nil t)
-                               (a68-within-string-or-comment)))
-                   (setq res (point))))
-      (setq count (1- count )))
-    res))
 
 ;;;; SUPPER stropping.
 
@@ -502,19 +518,6 @@
           (smie-rule-prev-p "else")
           (smie-rule-parent)))))
 
-(defun a68-beginning-of-defun-supper (&optional count)
-  "Algol 68 specific `beginning-of-defun-function'."
-  (let ((count (or count 1))
-        (case-fold-search nil)
-        res)
-    (while (> count 0)
-      (goto-char (save-excursion
-                   (while (and (re-search-backward (rx bow (or "proc" "op") 
eow) nil t)
-                               (a68-within-string-or-comment)))
-                   (setq res (point))))
-      (setq count (1- count )))
-    res))
-
 ;;;; Stropping utilities and commands.
 
 (defun a68-supperize-buffer ()

Reply via email to