changeset 55239:1af59a842b93

(cfengine-beginning-of-defun, cfengine-end-of-defun): Ensure progress through buffer.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 29 Apr 2004 19:48:22 +0000
parents 373bc9e19710
children 780b94f913fe
files lisp/progmodes/cfengine.el
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/cfengine.el	Thu Apr 29 19:09:20 2004 +0000
+++ b/lisp/progmodes/cfengine.el	Thu Apr 29 19:48:22 2004 +0000
@@ -1,6 +1,6 @@
 ;;; cfengine.el --- mode for editing Cfengine files
 
-;; Copyright (C) 2003 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004  Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
 ;; Keywords: languages
@@ -102,7 +102,8 @@
 (defun cfengine-beginning-of-defun ()
   "`beginning-of-defun' function for Cfengine mode.
 Treats actions as defuns."
-  (end-of-line)
+  (unless (<= (current-column) (current-indentation))
+    (end-of-line))
   (if (re-search-backward "^[[:alpha:]]+: *$" nil t)
       (beginning-of-line)
     (goto-char (point-min)))
@@ -113,7 +114,7 @@
 Treats actions as defuns."
   (end-of-line)
   (if (re-search-forward "^[[:alpha:]]+: *$" nil t)
-      (progn (forward-line -1) (end-of-line))
+      (beginning-of-line)
     (goto-char (point-max)))
   t)