diff options
| author | Richard M. Stallman | 1998-03-08 06:52:23 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-03-08 06:52:23 +0000 |
| commit | e5caa08e5423cb969fd4b6d558f022691566f4db (patch) | |
| tree | 98e5f710e3a7fe18f258fbfae5eb5ef7b19cdfcd | |
| parent | 717d3be71d714bb8cb355d6d1db69b2991bcf46a (diff) | |
| download | emacs-e5caa08e5423cb969fd4b6d558f022691566f4db.tar.gz emacs-e5caa08e5423cb969fd4b6d558f022691566f4db.zip | |
(c-initialize-cc-mode): Moved require's to top level.
(c-initialize-on-load): Variable removed.
| -rw-r--r-- | lisp/progmodes/cc-mode.el | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 09e4862dc15..e222ce1b033 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | ;; Created: a long, long, time ago. adapted from the original c-mode.el | 9 | ;; Created: a long, long, time ago. adapted from the original c-mode.el |
| 10 | ;; Keywords: c languages oop | 10 | ;; Keywords: c languages oop |
| 11 | 11 | ||
| 12 | (defconst c-version "5.20" | 12 | (defconst c-version "5.21" |
| 13 | "CC Mode version number.") | 13 | "CC Mode version number.") |
| 14 | 14 | ||
| 15 | ;; NOTE: Read the commentary below for the right way to submit bug reports! | 15 | ;; NOTE: Read the commentary below for the right way to submit bug reports! |
| @@ -79,6 +79,9 @@ | |||
| 79 | 79 | ||
| 80 | ;;; Code: | 80 | ;;; Code: |
| 81 | 81 | ||
| 82 | |||
| 83 | (require 'cc-defs) | ||
| 84 | |||
| 82 | ;; sigh. give in to the pressure, but make really sure all the | 85 | ;; sigh. give in to the pressure, but make really sure all the |
| 83 | ;; definitions we need are here | 86 | ;; definitions we need are here |
| 84 | (if (or (not (fboundp 'functionp)) | 87 | (if (or (not (fboundp 'functionp)) |
| @@ -88,9 +91,13 @@ | |||
| 88 | (not (fboundp 'unless))) | 91 | (not (fboundp 'unless))) |
| 89 | (require 'cc-mode-19)) | 92 | (require 'cc-mode-19)) |
| 90 | 93 | ||
| 91 | (eval-when-compile | 94 | (require 'cc-menus) |
| 92 | (require 'cc-menus)) | 95 | (require 'cc-vars) |
| 93 | (require 'cc-defs) | 96 | (require 'cc-engine) |
| 97 | (require 'cc-langs) | ||
| 98 | (require 'cc-align) | ||
| 99 | (require 'cc-styles) | ||
| 100 | (require 'cc-cmds) | ||
| 94 | 101 | ||
| 95 | (defvar c-buffer-is-cc-mode nil | 102 | (defvar c-buffer-is-cc-mode nil |
| 96 | "Non-nil for all buffers with a `major-mode' derived from CC Mode. | 103 | "Non-nil for all buffers with a `major-mode' derived from CC Mode. |
| @@ -101,9 +108,6 @@ other non-CC Mode mode that calls `c-initialize-cc-mode' | |||
| 101 | (make-variable-buffer-local 'c-buffer-is-cc-mode) | 108 | (make-variable-buffer-local 'c-buffer-is-cc-mode) |
| 102 | (put 'c-buffer-is-cc-mode 'permanent-local t) | 109 | (put 'c-buffer-is-cc-mode 'permanent-local t) |
| 103 | 110 | ||
| 104 | (defvar c-initialize-on-load t | ||
| 105 | "When non-nil, CC Mode initializes when the cc-mode.el file is loaded.") | ||
| 106 | |||
| 107 | 111 | ||
| 108 | 112 | ||
| 109 | ;; Other modes and packages which depend on CC Mode should do the | 113 | ;; Other modes and packages which depend on CC Mode should do the |
| @@ -116,15 +120,7 @@ other non-CC Mode mode that calls `c-initialize-cc-mode' | |||
| 116 | ;;;###autoload | 120 | ;;;###autoload |
| 117 | (defun c-initialize-cc-mode (&optional skip-styles) | 121 | (defun c-initialize-cc-mode (&optional skip-styles) |
| 118 | (setq c-buffer-is-cc-mode t) | 122 | (setq c-buffer-is-cc-mode t) |
| 119 | ;; make sure all necessary components of CC Mode are loaded in. | ||
| 120 | (let ((initprop 'cc-mode-is-initialized)) | 123 | (let ((initprop 'cc-mode-is-initialized)) |
| 121 | (require 'cc-vars) | ||
| 122 | (require 'cc-engine) | ||
| 123 | (require 'cc-langs) | ||
| 124 | (require 'cc-menus) | ||
| 125 | (require 'cc-align) | ||
| 126 | (require 'cc-styles) | ||
| 127 | (require 'cc-cmds) | ||
| 128 | ;; run the initialization hook, but only once | 124 | ;; run the initialization hook, but only once |
| 129 | (or (get 'c-initialize-cc-mode initprop) | 125 | (or (get 'c-initialize-cc-mode initprop) |
| 130 | (progn | 126 | (progn |
| @@ -416,19 +412,9 @@ Key bindings: | |||
| 416 | (format "c-emacs-features: %s\n" c-features) | 412 | (format "c-emacs-features: %s\n" c-features) |
| 417 | ))) | 413 | ))) |
| 418 | nil | 414 | nil |
| 419 | "Dear Barry," | 415 | "Dear Barry and Martin," |
| 420 | )))) | 416 | )))) |
| 421 | 417 | ||
| 422 | 418 | ||
| 423 | ;; Initialize everything. This is backwards compatible with older | ||
| 424 | ;; .emacs files that just did a (require 'cc-mode) and expected | ||
| 425 | ;; everything to work (e.g. for CC Mode 4). Maybe this should just | ||
| 426 | ;; happen by default, but previous versions of CC Mode 5 did not | ||
| 427 | ;; initialize by default. I'm really not sure what is the right thing | ||
| 428 | ;; to do. | ||
| 429 | (when c-initialize-on-load | ||
| 430 | (c-initialize-cc-mode)) | ||
| 431 | |||
| 432 | |||
| 433 | (provide 'cc-mode) | 419 | (provide 'cc-mode) |
| 434 | ;;; cc-mode.el ends here | 420 | ;;; cc-mode.el ends here |