Function: ghostel--minibuffer-exit-maybe-leave

ghostel--minibuffer-exit-maybe-leave is a natively compiled function defined in ghostel.el.

Signature

(ghostel--minibuffer-exit-maybe-leave)

Documentation

Run ghostel-maybe-leave-input after a minibuffer command, deferred.

Deferred so the originating window and point settle first (consult-lines marker-based point landing can lag minibuffer teardown). Only fires in the buffer the minibuffer was entered from: switching to a ghostel buffer via the minibuffer is an arrival, often with a stale restored point, not point leaving the input. See ghostel-point-leave-input-mode.

Source Code

;; Defined in /nix/store/1252krff0gb2kisjcpp45m50cpdskfrl-emacs-packages-deps/share/emacs/site-lisp/ghostel.el
(defun ghostel--minibuffer-exit-maybe-leave ()
  "Run `ghostel-maybe-leave-input' after a minibuffer command, deferred.
Deferred so the originating window and point settle first (`consult-line's
marker-based point landing can lag minibuffer teardown).  Only fires in the
buffer the minibuffer was entered from: switching to a ghostel buffer via
the minibuffer is an arrival, often with a stale restored point, not point
leaving the input.  See `ghostel-point-leave-input-mode'."
  (when-let* ((win (minibuffer-selected-window))
              (origin (window-buffer win))
              ((provided-mode-derived-p
                (buffer-local-value 'major-mode origin) 'ghostel-mode)))
    (run-at-time 0 nil
                 (lambda ()
                   (when (and (buffer-live-p origin)
                              (eq (window-buffer (selected-window)) origin))
                     (with-current-buffer origin
                       (ghostel-maybe-leave-input)))))))