Function: with-editor-cancel

with-editor-cancel is an interactive and byte-compiled function defined in with-editor.el.

Signature

(with-editor-cancel FORCE)

Documentation

Cancel the current edit session.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/with-editor-20260301.1317/with-editor.el
(defun with-editor-cancel (force)
  "Cancel the current edit session."
  (interactive "P")
  (when (run-hook-with-args-until-failure
         'with-editor-cancel-query-functions force)
    (let ((message with-editor-cancel-message))
      (when (functionp message)
        (setq message (funcall message)))
      (let ((post-cancel-hook with-editor-post-cancel-hook)
            (with-editor-cancel-alist nil)
            (dir default-directory))
        (run-hooks 'with-editor-pre-cancel-hook)
        (with-editor-return t)
        (accept-process-output nil 0.1)
        (with-temp-buffer
          (setq default-directory dir)
          (setq-local with-editor-post-cancel-hook post-cancel-hook)
          (run-hooks 'with-editor-post-cancel-hook)))
      (message (or message "Canceled by user")))))