]> git.eshelyaron.com Git - emacs.git/commitdiff
(cfengine-beginning-of-defun, cfengine-end-of-defun):
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 29 Apr 2004 19:48:22 +0000 (19:48 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 29 Apr 2004 19:48:22 +0000 (19:48 +0000)
Ensure progress through buffer.

lisp/progmodes/cfengine.el

index 62633fe294006ce4e471e003a4a5bb1c447ff951..16064586ee9f750b028c90bdc7251eaead30a0e8 100644 (file)
@@ -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 @@ This includes those for cfservd as well as cfagent."))
 (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."
 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)