aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Dalziel <tom_dl@hotmail.com>2024-01-02 17:59:54 +0100
committerTom Dalziel <tom_dl@hotmail.com>2024-01-02 17:59:54 +0100
commit792e1d11f26b9dd7aa047d66671f38192cdace03 (patch)
tree73a96b63cd26cb7ac24c2c97abfc761449d6becc
parent2bd0cea01a5feceb376242b29830370954a45f55 (diff)
Add err-code arg to :cq ex command
-rw-r--r--evil-commands.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/evil-commands.el b/evil-commands.el
index 6bd90af..21a2527 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 "<N><!>")
(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."