From: Stefan Monnier Date: Thu, 29 Apr 2004 19:48:22 +0000 (+0000) Subject: (cfengine-beginning-of-defun, cfengine-end-of-defun): X-Git-Tag: ttn-vms-21-2-B4~6515 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7d5f942b02c4806e4d68c3764dbfd6d04c7c1624;p=emacs.git (cfengine-beginning-of-defun, cfengine-end-of-defun): Ensure progress through buffer. --- diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el index 62633fe2940..16064586ee9 100644 --- a/lisp/progmodes/cfengine.el +++ b/lisp/progmodes/cfengine.el @@ -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 ;; 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)