Function: ghostel--change-major-mode-guard

ghostel--change-major-mode-guard is a natively compiled function defined in ghostel.el.

Signature

(ghostel--change-major-mode-guard)

Documentation

Signal a user-error while the buffer's terminal process is live.

A mode change runs kill-all-local-variables, wiping the buffer-locals the native module and PTY depend on; once the process is dead the mode may change freely (ghostel-compile finalize relies on this).

Source Code

;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel.el
;;; Major mode

(defun ghostel--change-major-mode-guard ()
  "Signal a `user-error' while the buffer's terminal process is live.
A mode change runs `kill-all-local-variables', wiping the buffer-locals
the native module and PTY depend on; once the process is dead the mode
may change freely (`ghostel-compile' finalize relies on this)."
  (when (process-live-p ghostel--process)
    (user-error "Cannot change major mode in a live ghostel buffer"))
  (ghostel--top-pad-set 0))