From 792e1d11f26b9dd7aa047d66671f38192cdace03 Mon Sep 17 00:00:00 2001 From: Tom Dalziel Date: Tue, 2 Jan 2024 17:59:54 +0100 Subject: [PATCH] Add err-code arg to :cq ex command --- evil-commands.el | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/evil-commands.el b/evil-commands.el index 6bd90af0..21a2527c 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -3474,15 +3474,15 @@ is closed." (set-process-query-on-exit-flag process nil)) (kill-emacs))))) -(evil-define-command evil-quit-all-with-error-code (&optional _force) +(evil-define-command evil-quit-all-with-error-code (&optional err-code _force) "Exit Emacs without saving, returning an non-zero error code. The FORCE argument is only there for compatibility and is ignored. This function fails with an error if Emacs is run in server mode." :repeat nil - (interactive "") + (interactive "") (if (bound-and-true-p server-buffer-clients) - (user-error "Cannot exit client process with error code.") - (kill-emacs 1))) + (user-error "Cannot exit client process with error code") + (kill-emacs (or err-code 1)))) (evil-define-command evil-save-and-quit () "Save all buffers and exit Emacs."