I have this function implemented to basically compile and run the cpp file I am writing. Some files needs input (cin) so running this function will not stop and would continuously showing this message:
emacs Enter a positive, odd integer (-1 to exit program): Only digits are allowed!
Not sure what is wrong:
(defun run-it () "Run it on the current file." (interactive) (save-all-buffer) (let ((file-name (file-name-nondirectory buffer-file-name))) (shell-command (format (concat "g++ -std=c++11 " file-name " -o " file-name ".o; " "./" file-name ".o;"))) ))