Mercurial > emacs
comparison lisp/progmodes/cplus-md.el @ 14853:e263cca8d928
(indent-c++-exp): Use calculate-c-indent-after-brace.
(c++-mode): Require c-mode.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 21 Mar 1996 14:16:06 +0000 |
parents | 25ecb6e5fffc |
children | 3b9f64eb097b |
comparison
equal
deleted
inserted
replaced
14852:b65bb6d88e90 | 14853:e263cca8d928 |
---|---|
318 | 318 |
319 Turning on C++ mode calls the value of the variable `c++-mode-hook' with | 319 Turning on C++ mode calls the value of the variable `c++-mode-hook' with |
320 no args if that value is non-nil." | 320 no args if that value is non-nil." |
321 (interactive) | 321 (interactive) |
322 (kill-all-local-variables) | 322 (kill-all-local-variables) |
323 ;; This code depends on the old C mode. | |
324 (require 'c-mode) | |
323 (use-local-map c++-mode-map) | 325 (use-local-map c++-mode-map) |
324 (set-syntax-table c++-mode-syntax-table) | 326 (set-syntax-table c++-mode-syntax-table) |
325 (setq major-mode 'c++-mode | 327 (setq major-mode 'c++-mode |
326 mode-name "C++" | 328 mode-name "C++" |
327 comment-column 32 | 329 comment-column 32 |
799 ;; Compute the standard indent for this level. | 801 ;; Compute the standard indent for this level. |
800 (let (val) | 802 (let (val) |
801 (if (= (char-after (car contain-stack)) ?{) | 803 (if (= (char-after (car contain-stack)) ?{) |
802 (save-excursion | 804 (save-excursion |
803 (goto-char (car contain-stack)) | 805 (goto-char (car contain-stack)) |
804 (setq val (+ c-indent-level (current-column)))) | 806 (setq val (calculate-c-indent-after-brace))) |
805 (setq val (calculate-c++-indent | 807 (setq val (calculate-c++-indent |
806 (if (car indent-stack) | 808 (if (car indent-stack) |
807 (- (car indent-stack)))))) | 809 (- (car indent-stack)))))) |
808 (setcar indent-stack val))) | 810 (setcar indent-stack val))) |
809 ;; Adjust line indentation according to its predecessor. | 811 ;; Adjust line indentation according to its predecessor. |