diff options
| -rw-r--r-- | lisp/progmodes/cc-mode.el | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 435d5291322..40e5a3107a8 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el | |||
| @@ -391,17 +391,18 @@ it finds in `c-file-offsets'. | |||
| 391 | 391 | ||
| 392 | Note that the style variables are always made local to the buffer." | 392 | Note that the style variables are always made local to the buffer." |
| 393 | ;; apply file styles and offsets | 393 | ;; apply file styles and offsets |
| 394 | (if (or c-file-style c-file-offsets) | 394 | (when c-buffer-is-cc-mode |
| 395 | (c-make-styles-buffer-local t)) | 395 | (if (or c-file-style c-file-offsets) |
| 396 | (and c-file-style | 396 | (c-make-styles-buffer-local t)) |
| 397 | (c-set-style c-file-style)) | 397 | (and c-file-style |
| 398 | (and c-file-offsets | 398 | (c-set-style c-file-style)) |
| 399 | (mapcar | 399 | (and c-file-offsets |
| 400 | (lambda (langentry) | 400 | (mapcar |
| 401 | (let ((langelem (car langentry)) | 401 | (lambda (langentry) |
| 402 | (offset (cdr langentry))) | 402 | (let ((langelem (car langentry)) |
| 403 | (c-set-offset langelem offset))) | 403 | (offset (cdr langentry))) |
| 404 | c-file-offsets))) | 404 | (c-set-offset langelem offset))) |
| 405 | c-file-offsets)))) | ||
| 405 | 406 | ||
| 406 | (add-hook 'hack-local-variables-hook 'c-postprocess-file-styles) | 407 | (add-hook 'hack-local-variables-hook 'c-postprocess-file-styles) |
| 407 | 408 | ||