rpav / cmake-build.el

CMake building with multiple targets, run configurations, and interactive menu
GNU General Public License v3.0
14 stars 4 forks source link

cmake-build-never-split set to nil results in nil buffer window in cmake-build--compile #10

Closed laurynas-biveinis closed 4 years ago

laurynas-biveinis commented 4 years ago

My frame geometry is two vertical windows. I set cmake-build-never-split to nil thinking that it will give me M-x compile behaviour. But what happens instead in cmake-build--compile is that split does not happen but the defun assumes the existence of the compilation window, which was never created. Then (let ((w (get-buffer-window buffer-name t)) results in w set to nil, which is invalid arg value for with-selected-window, throwing a Lisp error somewhere in it.

For me the easiest workaround to get fully-M-x-compile-like behaviour and never split windows appears to run (run-compile) without any window/buffer manipulation at all. Obviously this would need hiding behind some customisation:

      ;; compile saves buffers; rely on this now
      (let* ((compilation-buffer-name-function #'cmake-build--build-buffer-name))
        (cl-flet ((run-compile () (compile (concat "time " command) t)))
          (run-compile))
rpav commented 4 years ago

I assume you mean set cmake-build-never-split to non-nil? Should be fixed now though.