diff options
| author | Richard M. Stallman | 1997-08-09 18:31:43 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-08-09 18:31:43 +0000 |
| commit | aac90c529d36d784c6c55e58731af2d68b3ce652 (patch) | |
| tree | 53d3fe8d5a68ee1fc63b7350c4b461648ada228b | |
| parent | 5cc969699017214f4fb5efc486143faf193b25e5 (diff) | |
| download | emacs-aac90c529d36d784c6c55e58731af2d68b3ce652.tar.gz emacs-aac90c529d36d784c6c55e58731af2d68b3ce652.zip | |
(idl-mode): Support for CORBA's IDL language.
(c-initialize-cc-mode): Move the calling of
c-make-styles-buffer-local into c-initialize-builtin-style.
(c-initialize-cc-mode): Run the c-initialization-hook, but only once
per Emacs session.
| -rw-r--r-- | lisp/progmodes/cc-mode.el | 91 |
1 files changed, 66 insertions, 25 deletions
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index fddc5aeb9ab..2474b68857a 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | ;; 1985 Richard M. Stallman | 7 | ;; 1985 Richard M. Stallman |
| 8 | ;; Maintainer: cc-mode-help@python.org | 8 | ;; Maintainer: cc-mode-help@python.org |
| 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 | ;; Version: 5.13 | 10 | ;; Version: 5.14 |
| 11 | ;; Keywords: c languages oop | 11 | ;; Keywords: c languages oop |
| 12 | 12 | ||
| 13 | ;; NOTE: Read the commentary below for the right way to submit bug reports! | 13 | ;; NOTE: Read the commentary below for the right way to submit bug reports! |
| @@ -33,15 +33,15 @@ | |||
| 33 | ;;; Commentary: | 33 | ;;; Commentary: |
| 34 | 34 | ||
| 35 | ;; This package provides GNU Emacs major modes for editing C, C++, | 35 | ;; This package provides GNU Emacs major modes for editing C, C++, |
| 36 | ;; Objective-C, and Java code. As of the latest Emacs and XEmacs | 36 | ;; Objective-C, Java and IDL code. As of the latest Emacs and XEmacs |
| 37 | ;; releases, it is the default package for editing these languages. | 37 | ;; releases, it is the default package for editing these languages. |
| 38 | ;; This package is called "CC Mode", and should be spelled exactly | 38 | ;; This package is called "CC Mode", and should be spelled exactly |
| 39 | ;; this way. It supports K&R and ANSI C, ANSI C++, Objective-C, and | 39 | ;; this way. It supports K&R and ANSI C, ANSI C++, Objective-C, Java, |
| 40 | ;; Java, with a consistent indentation model across all modes. This | 40 | ;; and CORBA's IDL with a consistent indentation model across all |
| 41 | ;; indentation model is intuitive and very flexible, so that almost | 41 | ;; modes. This indentation model is intuitive and very flexible, so |
| 42 | ;; any desired style of indentation can be supported. Installation, | 42 | ;; that almost any desired style of indentation can be supported. |
| 43 | ;; usage, and programming details are contained in an accompanying | 43 | ;; Installation, usage, and programming details are contained in an |
| 44 | ;; texinfo manual. | 44 | ;; accompanying texinfo manual. |
| 45 | 45 | ||
| 46 | ;; CC Mode's immediate ancestors were, c++-mode.el, cplus-md.el, and | 46 | ;; CC Mode's immediate ancestors were, c++-mode.el, cplus-md.el, and |
| 47 | ;; cplus-md1.el.. | 47 | ;; cplus-md1.el.. |
| @@ -61,14 +61,6 @@ | |||
| 61 | ;; cc-mode-help@python.org. Please do not send bugs or questions to | 61 | ;; cc-mode-help@python.org. Please do not send bugs or questions to |
| 62 | ;; my personal account. | 62 | ;; my personal account. |
| 63 | 63 | ||
| 64 | ;; YOU CAN IGNORE ALL BYTE-COMPILER WARNINGS. They are the result of | ||
| 65 | ;; the cross-Emacsen support. GNU Emacs 19 (from the FSF), GNU XEmacs | ||
| 66 | ;; 19 (formerly Lucid Emacs), and GNU Emacs 18 all do things | ||
| 67 | ;; differently and there's no way to shut the byte-compiler up at the | ||
| 68 | ;; necessary granularity. Let me say this again: YOU CAN IGNORE ALL | ||
| 69 | ;; BYTE-COMPILER WARNINGS (you'd be surprised at how many people don't | ||
| 70 | ;; follow this advice :-). | ||
| 71 | |||
| 72 | ;; Many, many thanks go out to all the folks on the beta test list. | 64 | ;; Many, many thanks go out to all the folks on the beta test list. |
| 73 | ;; Without their patience, testing, insight, code contributions, and | 65 | ;; Without their patience, testing, insight, code contributions, and |
| 74 | ;; encouragement CC Mode would be a far inferior package. | 66 | ;; encouragement CC Mode would be a far inferior package. |
| @@ -97,16 +89,24 @@ | |||
| 97 | ;; (require 'cc-mode) | 89 | ;; (require 'cc-mode) |
| 98 | ;; (c-initialize-cc-mode) | 90 | ;; (c-initialize-cc-mode) |
| 99 | 91 | ||
| 92 | ;;;###autoload | ||
| 100 | (defun c-initialize-cc-mode () | 93 | (defun c-initialize-cc-mode () |
| 101 | ;; make sure all necessary components of CC Mode are loaded in. | 94 | ;; make sure all necessary components of CC Mode are loaded in. |
| 102 | (require 'cc-vars) | 95 | (let ((initprop 'cc-mode-is-initialized)) |
| 103 | (require 'cc-engine) | 96 | (require 'cc-vars) |
| 104 | (require 'cc-langs) | 97 | (require 'cc-engine) |
| 105 | (require 'cc-menus) | 98 | (require 'cc-langs) |
| 106 | (require 'cc-align) | 99 | (require 'cc-menus) |
| 107 | (require 'cc-styles) | 100 | (require 'cc-align) |
| 108 | (require 'cc-cmds)) | 101 | (require 'cc-styles) |
| 109 | 102 | (require 'cc-cmds) | |
| 103 | ;; run the initialization hook, but only once | ||
| 104 | (or (get 'c-initialize-cc-mode initprop) | ||
| 105 | (progn | ||
| 106 | (c-initialize-builtin-style) | ||
| 107 | (run-hooks 'c-initialization-hook) | ||
| 108 | (put 'c-initialize-cc-mode initprop t))) | ||
| 109 | )) | ||
| 110 | 110 | ||
| 111 | 111 | ||
| 112 | ;;;###autoload | 112 | ;;;###autoload |
| @@ -277,8 +277,49 @@ Key bindings: | |||
| 277 | (c-update-modeline)) | 277 | (c-update-modeline)) |
| 278 | 278 | ||
| 279 | 279 | ||
| 280 | ;;;###autoload | ||
| 281 | (defun idl-mode () | ||
| 282 | "Major mode for editing CORBA's IDL code. | ||
| 283 | To submit a problem report, enter `\\[c-submit-bug-report]' from an | ||
| 284 | idl-mode buffer. This automatically sets up a mail buffer with | ||
| 285 | version information already added. You just need to add a description | ||
| 286 | of the problem, including a reproducible test case, and send the | ||
| 287 | message. | ||
| 288 | |||
| 289 | To see what version of CC Mode you are running, enter `\\[c-version]'. | ||
| 290 | |||
| 291 | The hook variable `idl-mode-hook' is run with no args, if that | ||
| 292 | variable is bound and has a non-nil value. Also the hook | ||
| 293 | `c-mode-common-hook' is run first. | ||
| 294 | |||
| 295 | Key bindings: | ||
| 296 | \\{idl-mode-map}" | ||
| 297 | (interactive) | ||
| 298 | (c-initialize-cc-mode) | ||
| 299 | (kill-all-local-variables) | ||
| 300 | (set-syntax-table idl-mode-syntax-table) | ||
| 301 | (setq major-mode 'idl-mode | ||
| 302 | mode-name "IDL" | ||
| 303 | local-abbrev-table idl-mode-abbrev-table) | ||
| 304 | (use-local-map idl-mode-map) | ||
| 305 | (c-common-init) | ||
| 306 | (setq comment-start "// " | ||
| 307 | comment-end "" | ||
| 308 | comment-multi-line nil | ||
| 309 | c-conditional-key c-C++-conditional-key | ||
| 310 | c-comment-start-regexp c-C++-comment-start-regexp | ||
| 311 | c-class-key c-C++-class-key | ||
| 312 | c-access-key c-C++-access-key | ||
| 313 | c-double-slash-is-comments-p t | ||
| 314 | c-recognize-knr-p nil) | ||
| 315 | ;; imenu-generic-expression cc-imenu-c++-generic-expression) | ||
| 316 | (run-hooks 'c-mode-common-hook) | ||
| 317 | (run-hooks 'idl-mode-hook) | ||
| 318 | (c-update-modeline)) | ||
| 319 | |||
| 320 | |||
| 280 | ;; defuns for submitting bug reports | 321 | ;; defuns for submitting bug reports |
| 281 | (defconst c-version "5.13" | 322 | (defconst c-version "5.14" |
| 282 | "CC Mode version number.") | 323 | "CC Mode version number.") |
| 283 | 324 | ||
| 284 | (defconst c-mode-help-address | 325 | (defconst c-mode-help-address |