rpav / cmake-build.el

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

"Compiling" hanging in the mode line even after compilation is long complete #11

Closed laurynas-biveinis closed 4 years ago

laurynas-biveinis commented 4 years ago

$SUBJECT. Once build starts, "Compiling" appears in the mode line. It does not disappear after build completes.

rpav commented 4 years ago

This sounds like a COMPILE bug? I don't see it, but I also have a very trimmed modeline. cmake-build does not otherwise manipulate the modeline.

laurynas-biveinis commented 4 years ago

Based on the source code reading it seems that there is a conflict between process sentinels: compile wants to attach compilation-sentinel:

;; Called when compilation process changes state.
(defun compilation-sentinel (proc msg)
  "Sentinel for compilation buffers."
  (if (memq (process-status proc) '(exit signal))
      (let ((buffer (process-buffer proc)))
    (if (null (buffer-name buffer))
        ;; buffer killed
        (set-process-buffer proc nil)
      (with-current-buffer buffer
        ;; Write something in the compilation buffer
        ;; and hack its mode line.
        (compilation-handle-exit (process-status proc)
                     (process-exit-status proc)
                     msg)
        ;; Since the buffer and mode line will show that the
        ;; process is dead, we can delete it now.  Otherwise it
        ;; will stay around until M-x list-processes.
        (delete-process proc)))
    (setq compilation-in-progress (delq proc compilation-in-progress)))))

whose last line resets the variable used in minor mode update, whereas cmake-build has own sentinels, and no composition of them.

(BWT cmake-build.el also does not grep for any delete-process call, is that a bug?)

rpav commented 4 years ago

Yeah I just didn't realize the first was necessary. The second shouldn't be an issue as async-shell-command seems to clean up processes on its own, and fixing this will fix compile processes.

laurynas-biveinis commented 4 years ago

Closing as fixed, thank you