Recently I'm using this function which is given bellow, to compile
and run
C++ program. Everything works fine with this function.
I just want to delete pop-up window (generated by this function) after compilation and running procedure is finished.
And want the window to give me a message asking :
press
<return>
key to delete current window and go-back.
I'm new to Emacs and have zero knowledge of elisp. So it would be very kind of you guys if you let me know how to done this work.
(defun compile-and-run()
(interactive)
(save-buffer)
(compile (concat "g++ " (file-name-nondirectory (buffer-file-name)) " -o "
(file-name-sans-extension (file-name-nondirectory (buffer-file-name))) " && ./"
(file-name-sans-extension (file-name-nondirectory (buffer-file-name)))) t )
(other-window 1)
(goto-char (point-max)))
(define-key c++-mode-map [f5] #'compile-and-run)
*compilation*
bufferq
is bound toquit-window
, which by default will close the window and bury the buffer. See thequit-window
docs to see how to kill the bufferquit-window
doesn't work on*compilation*
, I think that's because I run the program in*compilation*
buffer.