Variable: with-editor-mode

with-editor-mode is a buffer-local variable defined in with-editor.el.

Documentation

Non-nil if With-Editor mode is enabled.

Use the command with-editor-mode(var)/with-editor-mode(fun) to change this variable.

Source Code

;; Defined in ~/.emacs.d/elpa/with-editor-20260301.1317/with-editor.el
(define-minor-mode with-editor-mode
  "Edit a file as the $EDITOR of an external process."
  :lighter with-editor-mode-lighter
  ;; Protect the user from enabling or disabling the mode interactively.
  ;; Manually enabling the mode is dangerous because canceling the buffer
  ;; deletes the visited file.  The mode must not be disabled manually,
  ;; either `with-editor-finish' or `with-editor-cancel' must be used.
  :interactive nil                    ; >= 28.1
  (when (called-interactively-p 'any) ; <  28.1
    (setq with-editor-mode (not with-editor-mode))
    (user-error "With-Editor mode is not intended for interactive use"))
  ;; The buffer must also not be killed using regular kill commands.
  (add-hook 'kill-buffer-query-functions
            #'with-editor-kill-buffer-noop nil t)
  ;; `server-execute' displays a message which is not
  ;; correct when using this mode.
  (when with-editor-show-usage
    (with-editor-usage-message)))