Hi,
I want this function to compile the contents of the current buffer(a C file) and show the output(a.out) if the compilation succeeded
(defun c-shell-compile ()
(interactive)
(save-buffer)
(if (equal (shell-command (concat "gcc " (buffer-file-name)))
"(Shell command succeeded with no output)")
(shell-command "./a.out")
;;Else show the errors
))
(add-hook 'c-mode-hook
(lambda () (local-set-key (kbd "\C-c\C-c") 'c-shell-compile)))
But it does not seem to be working, if the compilation succeeds it just says "(Shell command succeeded with no output)" without showing the output.
Answers or directions very much appreciated.