f90 indentation fix.
[bpt/emacs.git] / lisp / progmodes / cperl-mode.el
index 3bc9b46..ad3b777 100644 (file)
@@ -1,8 +1,6 @@
 ;;; cperl-mode.el --- Perl code editing commands for Emacs
 
-;; Copyright (C) 1985, 1986, 1987, 1991, 1992, 1993, 1994, 1995, 1996,
-;;   1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-;;   2008, 2009, 2010, 2011  Free Software Foundation, Inc.
+;; Copyright (C) 1985-1987, 1991-2011  Free Software Foundation, Inc.
 
 ;; Author: Ilya Zakharevich
 ;;     Bob Olson
@@ -615,7 +613,7 @@ One should tune up `cperl-close-paren-offset' as well."
 (defcustom cperl-syntaxify-by-font-lock
   (and cperl-can-font-lock
        (boundp 'parse-sexp-lookup-properties))
-  "*Non-nil means that CPerl uses `font-lock's routines for syntaxification."
+  "*Non-nil means that CPerl uses the `font-lock' routines for syntaxification."
   :type '(choice (const message) boolean)
   :group 'cperl-speed)
 
@@ -1524,7 +1522,7 @@ the last)."
 (defvar compilation-error-regexp-alist)
 
 ;;;###autoload
-(defun cperl-mode ()
+(define-derived-mode cperl-mode prog-mode "CPerl"
   "Major mode for editing Perl code.
 Expression and list commands understand all C brackets.
 Tab indents for Perl code.
@@ -1697,9 +1695,6 @@ with no args.
 DO NOT FORGET to read micro-docs (available from `Perl' menu)
 or as help on variables `cperl-tips', `cperl-problems',
 `cperl-praise', `cperl-speed'."
-  (interactive)
-  (kill-all-local-variables)
-  (use-local-map cperl-mode-map)
   (if (cperl-val 'cperl-electric-linefeed)
       (progn
        (local-set-key "\C-J" 'cperl-linefeed)
@@ -1712,8 +1707,6 @@ or as help on variables `cperl-tips', `cperl-problems',
        (cperl-define-key "\C-hf" 'cperl-info-on-current-command [(control h) f])
        (cperl-define-key "\C-c\C-hf" 'cperl-info-on-command
                          [(control c) (control h) f])))
-  (setq major-mode cperl-use-major-mode)
-  (setq mode-name "CPerl")
   (let ((prev-a-c abbrevs-changed))
     (define-abbrev-table 'cperl-mode-abbrev-table '(
                ("if" "if" cperl-electric-keyword 0)
@@ -2771,7 +2764,7 @@ Will not look before LIM."
                  (goto-char (cperl-beginning-of-property p look-prop))
                  (beginning-of-line)
                  (setq pre-indent-point (point)))))
-         (goto-char pre-indent-point)  ; Orig line skipping preceeding pod/etc
+         (goto-char pre-indent-point)  ; Orig line skipping preceding pod/etc
          (let* ((case-fold-search nil)
                 (s-s (cperl-get-state (car parse-data) (nth 1 parse-data)))
                 (start (or (nth 2 parse-data) ; last complete sexp terminated
@@ -2798,8 +2791,8 @@ Will not look before LIM."
                          (cperl-1+ char-after-pos) 'indentable)
                         p (1+ (cperl-beginning-of-property
                                (point) 'indentable))
-                        is-block       ; misused for: preceeding line in REx
-                        (save-excursion ; Find preceeding line
+                        is-block       ; misused for: preceding line in REx
+                        (save-excursion ; Find preceding line
                           (cperl-backward-to-noncomment p)
                           (beginning-of-line)
                           (if (<= (point) p)
@@ -2815,10 +2808,10 @@ Will not look before LIM."
                         prop (parse-partial-sexp p char-after-pos))
                   (cond ((not delim)   ; End the REx, ignore is-block
                          (vector 'indentable 'terminator p is-block))
-                        (is-block      ; Indent w.r.t. preceeding line
+                        (is-block      ; Indent w.r.t. preceding line
                          (vector 'indentable 'cont-line char-after-pos
                                  is-block char-after p))
-                        (t             ; No preceeding line...
+                        (t             ; No preceding line...
                          (vector 'indentable 'first-line p))))
                  ((get-text-property char-after-pos 'REx-part2)
                   (vector 'REx-part2 (point)))
@@ -2899,7 +2892,7 @@ Will not look before LIM."
                         (cperl-backward-to-start-of-continued-exp containing-sexp))
                     (beginning-of-line)
                     (cperl-backward-to-noncomment containing-sexp))
-                  ;; Now we get non-label preceeding the indent point
+                  ;; Now we get non-label preceding the indent point
                   (if (not (or (eq (1- (point)) containing-sexp)
                                (memq (preceding-char)
                                      (append (if is-block " ;{" " ,;{") '(nil)))
@@ -4837,7 +4830,7 @@ the sections using `cperl-pod-head-face', `cperl-pod-face',
 ;;; Moreover, one takes positive approach (looks for else,grep etc)
 ;;; another negative (looks for bless,tr etc)
 (defun cperl-after-block-p (lim &optional pre-block)
-  "Return true if the preceeding } (if PRE-BLOCK, following {) delimits a block.
+  "Return true if the preceding } (if PRE-BLOCK, following {) delimits a block.
 Would not look before LIM.  Assumes that LIM is a good place to begin a
 statement.  The kind of block we treat here is one after which a new
 statement would start; thus the block in ${func()} does not count."
@@ -4866,7 +4859,7 @@ statement would start; thus the block in ${func()} does not count."
                               (progn
                                 (forward-sexp -1)
                                 (looking-at "sub[ \t\n\f#]"))))))
-               ;; What preceeds is not word...  XXXX Last statement in sub???
+               ;; What precedes is not word...  XXXX Last statement in sub???
                (cperl-after-expr-p lim))))
       (error nil))))
 
@@ -8596,10 +8589,10 @@ the appropriate statement modifier."
             (pargs (cdr (car flist))))
         (setq command
               (concat command " | " pcom " "
-                      (mapconcat '(lambda (phrase)
-                                    (if (not (stringp phrase))
-                                        (error "Malformed Man-filter-list"))
-                                    phrase)
+                      (mapconcat (lambda (phrase)
+                                   (if (not (stringp phrase))
+                                       (error "Malformed Man-filter-list"))
+                                   phrase)
                                  pargs " ")))
         (setq flist (cdr flist))))
     command))
@@ -8973,18 +8966,6 @@ do extra unwind via `cperl-unwind-to-safe'."
     (substring v (match-beginning 1) (match-end 1)))
   "Version of IZ-supported CPerl package this file is based on.")
 
-(defun cperl-mode-unload-function ()
-  "Unload the Cperl mode library."
-  (let ((new-mode (if (eq (symbol-function 'perl-mode) 'cperl-mode)
-                     'fundamental-mode
-                   'perl-mode)))
-    (dolist (buf (buffer-list))
-      (with-current-buffer buf
-       (when (eq major-mode 'cperl-mode)
-         (funcall new-mode)))))
-  ;; continue standard unloading
-  nil)
-
 (provide 'cperl-mode)
 
 ;;; cperl-mode.el ends here