]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/cc-mode.el
Merge from emacs--rel--22
[gnu-emacs] / lisp / progmodes / cc-mode.el
index d2abb3732fb249dc3170084e3cd6ef52b910a7a4..0ae038578b7083b8291e2f838af4c0bc924957d9 100644 (file)
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -26,9 +26,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with this program; see the file COPYING.  If not, write to
-;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
 
 ;;; Code:
 
+;; For Emacs < 22.2.
+(eval-and-compile
+  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
+
 (eval-when-compile
   (let ((load-path
         (if (and (boundp 'byte-compile-dest-file)
@@ -190,7 +192,8 @@ control).  See \"cc-mode.el\" for more info."
            (run-hooks 'c-initialization-hook)
            ;; Fix obsolete variables.
            (if (boundp 'c-comment-continuation-stars)
-               (setq c-block-comment-prefix c-comment-continuation-stars))
+               (setq c-block-comment-prefix
+                     (symbol-value 'c-comment-continuation-stars)))
            (add-hook 'change-major-mode-hook 'c-leave-cc-mode-mode)
            (setq c-initialization-ok t))
        ;; Will try initialization hooks again if they failed.
@@ -269,7 +272,9 @@ control).  See \"cc-mode.el\" for more info."
                             'c-indent-new-comment-line
                             c-mode-base-map global-map)
   (substitute-key-definition 'indent-for-tab-command
-                            'c-indent-command
+                            ;; XXX Is this the right thing to do
+                            ;; here?
+                            'c-indent-line-or-region
                             c-mode-base-map global-map)
   (when (fboundp 'comment-indent-new-line)
     ;; indent-new-comment-line has changed name to
@@ -716,7 +721,7 @@ Note that the style variables are always made local to the buffer."
       (c-set-style c-file-style))
 
     (and c-file-offsets
-        (mapcar
+        (mapc
          (lambda (langentry)
            (let ((langelem (car langentry))
                  (offset (cdr langentry)))
@@ -1474,6 +1479,10 @@ Key bindings:
 (easy-menu-define c-awk-menu awk-mode-map "AWK Mode Commands"
                  (cons "AWK" (c-lang-const c-mode-menu awk)))
 
+;; (require 'cc-awk) brings these in.
+(defvar awk-mode-syntax-table)
+(declare-function c-awk-unstick-NL-prop "cc-awk" ())
+
 (defun awk-mode ()
   "Major mode for editing AWK code.
 To submit a problem report, enter `\\[c-submit-bug-report]' from an
@@ -1578,15 +1587,15 @@ Key bindings:
                     adaptive-fill-mode
                     adaptive-fill-regexp)
                   nil)))
-       (mapcar (lambda (var) (unless (boundp var)
-                               (setq vars (delq var vars))))
-               '(signal-error-on-buffer-boundary
-                 filladapt-mode
-                 defun-prompt-regexp
-                 font-lock-mode
-                 font-lock-maximum-decoration
-                 parse-sexp-lookup-properties
-                 lookup-syntax-properties))
+       (mapc (lambda (var) (unless (boundp var)
+                             (setq vars (delq var vars))))
+             '(signal-error-on-buffer-boundary
+               filladapt-mode
+               defun-prompt-regexp
+               font-lock-mode
+               font-lock-maximum-decoration
+               parse-sexp-lookup-properties
+               lookup-syntax-properties))
        vars)
       (lambda ()
        (run-hooks 'c-prepare-bug-report-hooks)
@@ -1596,5 +1605,5 @@ Key bindings:
 \f
 (cc-provide 'cc-mode)
 
-;;; arch-tag: 7825e5c4-fd09-439f-a04d-4c13208ba3d7
+;; arch-tag: 7825e5c4-fd09-439f-a04d-4c13208ba3d7
 ;;; cc-mode.el ends here