diff options
| -rw-r--r-- | lisp/progmodes/cc-mode.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 920b253d4b7..fd31ac54183 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el | |||
| @@ -649,9 +649,10 @@ Note that the style variables are always made local to the buffer." | |||
| 649 | (with-output-to-string | 649 | (with-output-to-string |
| 650 | (with-current-buffer standard-output | 650 | (with-current-buffer standard-output |
| 651 | (call-process cc-mode-cpp-program | 651 | (call-process cc-mode-cpp-program |
| 652 | file t nil "-dM")))) | 652 | (if (file-exists-p file) file nil) t nil "-dM")))) |
| 653 | (define-list (split-string output "\n" t)) | 653 | (define-list (split-string output "\n" t)) |
| 654 | (name)) | 654 | (name)) |
| 655 | (setq cc-define-alist nil) | ||
| 655 | (dolist (define define-list) | 656 | (dolist (define define-list) |
| 656 | (setq name (nth 1 (split-string define "[( ]"))) | 657 | (setq name (nth 1 (split-string define "[( ]"))) |
| 657 | (push (cons name define) cc-define-alist)))) | 658 | (push (cons name define) cc-define-alist)))) |
| @@ -686,6 +687,7 @@ Key bindings: | |||
| 686 | (easy-menu-add c-c-menu) | 687 | (easy-menu-add c-c-menu) |
| 687 | (cc-imenu-init cc-imenu-c-generic-expression) | 688 | (cc-imenu-init cc-imenu-c-generic-expression) |
| 688 | (cc-create-define-alist) | 689 | (cc-create-define-alist) |
| 690 | (add-hook 'after-save-hook 'cc-create-define-alist nil t) | ||
| 689 | (run-mode-hooks 'c-mode-common-hook 'c-mode-hook) | 691 | (run-mode-hooks 'c-mode-common-hook 'c-mode-hook) |
| 690 | (c-update-modeline)) | 692 | (c-update-modeline)) |
| 691 | 693 | ||