From 0a7eaa8f6f672598abe622f5d7079e9a7e03d384 Mon Sep 17 00:00:00 2001 From: Daniel Pettersson Date: Tue, 10 Dec 2024 21:43:49 +0100 Subject: [PATCH] Fix dape-compile-hook --- dape.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dape.el b/dape.el index 323bd3d3..ec29cc4a 100644 --- a/dape.el +++ b/dape.el @@ -720,7 +720,8 @@ project's root. See `dape--default-cwd'." (defcustom dape-compile-hook nil "Called after dape compilation finishes. -The hook is run with one argument, the compilation buffer." +The hook is run with one argument, the compilation buffer when +compilation is successful." :type 'hook) (defcustom dape-minibuffer-hint-ignore-properties @@ -2748,9 +2749,10 @@ For more information see `dape-configs'." "Hook for `dape--compile-compilation-finish'. Using BUFFER and STR." (remove-hook 'compilation-finish-functions #'dape--compile-compilation-finish) - (cond ((equal "finished\n" str) (funcall dape--compile-after-fn)) - (t (dape--message "Compilation failed %s" (string-trim-right str)))) - (run-hook-with-args 'dape-compile-hook buffer)) + (if (equal "finished\n" str) + (progn (funcall dape--compile-after-fn) + (run-hook-with-args 'dape-compile-hook buffer)) + (dape--message "Compilation failed %s" (string-trim-right str)))) (defun dape--compile (config fn) "Start compilation for CONFIG then call FN."