Function: ghostel--sync-tty-composition

ghostel--sync-tty-composition is a natively compiled function defined in ghostel.el.

Signature

(ghostel--sync-tty-composition WINDOW)

Documentation

Sync auto-composition-mode(var)/auto-composition-mode(fun) with WINDOW's frame for ghostel buffers.

On a TTY frame, set the buffer-local value to the frame's tty-type so composition is inhibited there (works around TTY column drift on VS-16 emoji clusters, see debbugs#81052). On a GUI frame, leave the value alone: it is either t (mode-init default; composition stays on) or a string from a prior TTY display (string never matches a GUI's nil tty-type, so composition still stays on for the GUI and the TTY display that needs it off keeps working in parallel).

Source Code

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

(defun ghostel--sync-tty-composition (window)
  "Sync `auto-composition-mode' with WINDOW's frame for ghostel buffers.
On a TTY frame, set the buffer-local value to the frame's `tty-type'
so composition is inhibited there (works around TTY column drift on
VS-16 emoji clusters, see debbugs#81052).
On a GUI frame, leave the value alone: it is either t (mode-init default;
composition stays on) or a string from a prior TTY display (string never
matches a GUI's nil `tty-type', so composition still stays on for the GUI
and the TTY display that needs it off keeps working in parallel)."
  (when (windowp window)
    (when-let* ((tt (tty-type (window-frame window))))
      (unless (equal auto-composition-mode tt)
        (setq-local auto-composition-mode tt)))))