Commit 6661c5bb authored by Nick Roberts's avatar Nick Roberts
Browse files

(cc-create-define-alist): Check that file

exists. Initialise cc-define-alist.
(c-mode): Add cc-create-define-alist locally to after-save-hook.
parent 80b61a0f
......@@ -649,9 +649,10 @@ Note that the style variables are always made local to the buffer."
(with-current-buffer standard-output
(call-process cc-mode-cpp-program
file t nil "-dM"))))
(if (file-exists-p file) file nil) t nil "-dM"))))
(define-list (split-string output "\n" t))
(setq cc-define-alist nil)
(dolist (define define-list)
(setq name (nth 1 (split-string define "[( ]")))
(push (cons name define) cc-define-alist))))
......@@ -686,6 +687,7 @@ Key bindings:
(easy-menu-add c-c-menu)
(cc-imenu-init cc-imenu-c-generic-expression)
(add-hook 'after-save-hook 'cc-create-define-alist nil t)
(run-mode-hooks 'c-mode-common-hook 'c-mode-hook)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment