Skip to content

Commit

Permalink
Add err-code arg to :cq ex command
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdl89 committed Jan 2, 2024
1 parent 2bd0cea commit 792e1d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions evil-commands.el
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 792e1d1

Please sign in to comment.