Fixed that bug

This commit is contained in:
Benson Chu 2022-12-30 17:27:19 -06:00
parent c7896a58b8
commit 1ba69a10a6
2 changed files with 10 additions and 5 deletions

View file

@ -127,7 +127,6 @@
(make-variable-buffer-local 'compilation-error-regexp-alist)
(setq compilation-error-regexp-alist nil))
;; TODO: This doesn't ACTUALLY survive a call to #'recompile
(make-variable-buffer-local 'compilation-finish-functions)
(add-to-list 'compilation-finish-functions
#'ll/c-file-sentinel)))))

View file

@ -37,10 +37,16 @@ commands of Compilation major mode are available. See
(compilation--unsetup)))
(defun my/enable-comp-keys-if-separate-mode (orig &rest args)
(aprog1 (apply orig args)
(when (cadr args)
(with-current-buffer it
(compilation-minor-mode)))))
(let ((hook compilation-finish-functions))
(aprog1 (apply orig args)
(when (cadr args)
(with-current-buffer it
(compilation-minor-mode))
(setq-local compilation-finish-functions
(seq-uniq
(append compilation-finish-functions
hook)))))))
(advice-add #'compilation-start
:around