;;; 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
(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)))
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)
;; movement.
(set (make-local-variable 'parens-require-spaces) nil)
- (set (make-local-variable 'require-final-newline) t)
+ (set (make-local-variable 'require-final-newline) mode-require-final-newline)
(set (make-local-variable 'comment-start) "# ")
(set (make-local-variable 'comment-start-skip)
"\\(\\(?:^\\|[^\\\\\n]\\)\\(?:\\\\\\\\\\)*\\)#+[ \t]*")
(setq imenu-generic-expression cfengine-imenu-expression)
(set (make-local-variable 'beginning-of-defun-function)
#'cfengine-beginning-of-defun)
- (set (make-local-variable 'end-of-defun-function) #'cfengine-end-of-defun))
+ (set (make-local-variable 'end-of-defun-function) #'cfengine-end-of-defun)
+ ;; Like Lisp mode. Without this, we lose with, say,
+ ;; `backward-up-list' when there's an unbalanced quote in a
+ ;; preceding comment.
+ (set (make-local-variable 'parse-sexp-ignore-comments) t))
(provide 'cfengine)
+;;; arch-tag: 6b931be2-1505-4124-afa6-9675971e26d4
;;; cfengine.el ends here