Skip to content

Commit 792e1d1

Browse files
committed
Add err-code arg to :cq ex command
1 parent 2bd0cea commit 792e1d1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

evil-commands.el

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3474,15 +3474,15 @@ is closed."
34743474
(set-process-query-on-exit-flag process nil))
34753475
(kill-emacs)))))
34763476

3477-
(evil-define-command evil-quit-all-with-error-code (&optional _force)
3477+
(evil-define-command evil-quit-all-with-error-code (&optional err-code _force)
34783478
"Exit Emacs without saving, returning an non-zero error code.
34793479
The FORCE argument is only there for compatibility and is ignored.
34803480
This function fails with an error if Emacs is run in server mode."
34813481
:repeat nil
3482-
(interactive "<!>")
3482+
(interactive "<N><!>")
34833483
(if (bound-and-true-p server-buffer-clients)
3484-
(user-error "Cannot exit client process with error code.")
3485-
(kill-emacs 1)))
3484+
(user-error "Cannot exit client process with error code")
3485+
(kill-emacs (or err-code 1))))
34863486

34873487
(evil-define-command evil-save-and-quit ()
34883488
"Save all buffers and exit Emacs."

0 commit comments

Comments
 (0)