diff options
| author | Richard M. Stallman | 1998-02-17 07:10:11 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-02-17 07:10:11 +0000 |
| commit | bb7830ef8a3b5239260b32049f0cb9d829718583 (patch) | |
| tree | 13ef06c48bbc3687f461d1e47f76c94811aa1f77 | |
| parent | e1c458ae0833358eafc4067ddfca1a96652104ef (diff) | |
| download | emacs-bb7830ef8a3b5239260b32049f0cb9d829718583.tar.gz emacs-bb7830ef8a3b5239260b32049f0cb9d829718583.zip | |
(c-postprocess-file-styles): If a file style or file offsets are set,
make the variables local to the buffer (via make-local-variable).
(c-java-method-key): Variable deleted.
(c-C-extra-toplevel-key)
(c-C++-extra-toplevel-key, c-extra-toplevel-key): New variables
which parameterize the search for additional top-level enclosing
constructs.
(c-mode-base-map): c-mark-function moved back to M-C-h.
| -rw-r--r-- | lisp/progmodes/cc-langs.el | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 1d39c1a1fee..ec9308b3cc3 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; cc-langs.el --- specific language support for CC Mode | 1 | ;;; cc-langs.el --- specific language support for CC Mode |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985,87,92,93,94,95,96,97 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1985,87,92,93,94,95,96,97,98 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Authors: 1992-1997 Barry A. Warsaw | 5 | ;; Authors: 1992-1997 Barry A. Warsaw |
| 6 | ;; 1987 Dave Detlefs and Stewart Clamen | 6 | ;; 1987 Dave Detlefs and Stewart Clamen |
| @@ -55,6 +55,8 @@ | |||
| 55 | ;; keywords introducing class definitions. language specific | 55 | ;; keywords introducing class definitions. language specific |
| 56 | (defconst c-C-class-key "\\(struct\\|union\\)") | 56 | (defconst c-C-class-key "\\(struct\\|union\\)") |
| 57 | (defconst c-C++-class-key "\\(class\\|struct\\|union\\)") | 57 | (defconst c-C++-class-key "\\(class\\|struct\\|union\\)") |
| 58 | (defconst c-C-extra-toplevel-key "\\(extern\\)[^_]") | ||
| 59 | (defconst c-C++-extra-toplevel-key "\\(extern\\|namespace\\)[^_]") | ||
| 58 | 60 | ||
| 59 | (defconst c-ObjC-class-key | 61 | (defconst c-ObjC-class-key |
| 60 | (concat | 62 | (concat |
| @@ -76,6 +78,9 @@ | |||
| 76 | (defvar c-class-key c-C-class-key) | 78 | (defvar c-class-key c-C-class-key) |
| 77 | (make-variable-buffer-local 'c-class-key) | 79 | (make-variable-buffer-local 'c-class-key) |
| 78 | 80 | ||
| 81 | (defvar c-extra-toplevel-key c-C-extra-toplevel-key) | ||
| 82 | (make-variable-buffer-local 'c-extra-toplevel-key) | ||
| 83 | |||
| 79 | 84 | ||
| 80 | ;; regexp describing access protection clauses. language specific | 85 | ;; regexp describing access protection clauses. language specific |
| 81 | (defvar c-access-key nil) | 86 | (defvar c-access-key nil) |
| @@ -115,13 +120,6 @@ | |||
| 115 | ;; since it is considered the end of //-comments. | 120 | ;; since it is considered the end of //-comments. |
| 116 | "[ \t\n]*" c-symbol-key)) | 121 | "[ \t\n]*" c-symbol-key)) |
| 117 | 122 | ||
| 118 | (defconst c-Java-method-key | ||
| 119 | (concat | ||
| 120 | "^\\s *[+-]\\s *" | ||
| 121 | "\\(([^)]*)\\)?" ; return type | ||
| 122 | ;; \\s- in java syntax table does not include \n | ||
| 123 | ;; since it is considered the end of //-comments. | ||
| 124 | "[ \t\n]*" c-symbol-key)) | ||
| 125 | 123 | ||
| 126 | 124 | ||
| 127 | ;; comment starter definitions for various languages. language specific | 125 | ;; comment starter definitions for various languages. language specific |
| @@ -255,8 +253,12 @@ For use with the variable `java-mode-hook'." | |||
| 255 | Currently, this function simply applies any style and offset settings | 253 | Currently, this function simply applies any style and offset settings |
| 256 | found in the file's Local Variable list. It first applies any style | 254 | found in the file's Local Variable list. It first applies any style |
| 257 | setting found in `c-file-style', then it applies any offset settings | 255 | setting found in `c-file-style', then it applies any offset settings |
| 258 | it finds in `c-file-offsets'." | 256 | it finds in `c-file-offsets'. |
| 257 | |||
| 258 | Note that the style variables are always made local to the buffer." | ||
| 259 | ;; apply file styles and offsets | 259 | ;; apply file styles and offsets |
| 260 | (if (or c-file-style c-file-offsets) | ||
| 261 | (c-make-styles-buffer-local t)) | ||
| 260 | (and c-file-style | 262 | (and c-file-style |
| 261 | (c-set-style c-file-style)) | 263 | (c-set-style c-file-style)) |
| 262 | (and c-file-offsets | 264 | (and c-file-offsets |
| @@ -335,15 +337,15 @@ it finds in `c-file-offsets'." | |||
| 335 | (define-key c-mode-base-map ";" 'c-electric-semi&comma) | 337 | (define-key c-mode-base-map ";" 'c-electric-semi&comma) |
| 336 | (define-key c-mode-base-map "#" 'c-electric-pound) | 338 | (define-key c-mode-base-map "#" 'c-electric-pound) |
| 337 | (define-key c-mode-base-map ":" 'c-electric-colon) | 339 | (define-key c-mode-base-map ":" 'c-electric-colon) |
| 338 | ;; Lucid Emacs 19.9 defined these two, the second of which was | 340 | ;; Separate M-BS from C-M-h. The former should remain |
| 339 | ;; commented out... | 341 | ;; backward-kill-word. |
| 340 | ;; (define-key c-mode-base-map "\e{" 'c-insert-braces) | 342 | (define-key c-mode-base-map [(control meta h)] 'c-mark-function) |
| 341 | ;; Commented out electric square brackets because nobody likes them. | ||
| 342 | ;; (define-key c-mode-base-map "[" 'c-insert-brackets) | ||
| 343 | (define-key c-mode-base-map "\C-c\C-m" 'c-mark-function) | ||
| 344 | (define-key c-mode-base-map "\e\C-q" 'c-indent-exp) | 343 | (define-key c-mode-base-map "\e\C-q" 'c-indent-exp) |
| 345 | (define-key c-mode-base-map "\ea" 'c-beginning-of-statement) | 344 | (define-key c-mode-base-map "\ea" 'c-beginning-of-statement) |
| 346 | (define-key c-mode-base-map "\ee" 'c-end-of-statement) | 345 | (define-key c-mode-base-map "\ee" 'c-end-of-statement) |
| 346 | ;; RMS says don't make these the default. | ||
| 347 | ;; (define-key c-mode-base-map "\e\C-a" 'c-beginning-of-defun) | ||
| 348 | ;; (define-key c-mode-base-map "\e\C-e" 'c-end-of-defun) | ||
| 347 | (define-key c-mode-base-map "\C-c\C-n" 'c-forward-conditional) | 349 | (define-key c-mode-base-map "\C-c\C-n" 'c-forward-conditional) |
| 348 | (define-key c-mode-base-map "\C-c\C-p" 'c-backward-conditional) | 350 | (define-key c-mode-base-map "\C-c\C-p" 'c-backward-conditional) |
| 349 | (define-key c-mode-base-map "\C-c\C-u" 'c-up-conditional) | 351 | (define-key c-mode-base-map "\C-c\C-u" 'c-up-conditional) |