emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Preview of tty chlid frames in scratch/tty-child-frames


From: Gerd Möllmann
Subject: Preview of tty chlid frames in scratch/tty-child-frames
Date: Sat, 05 Oct 2024 19:10:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Was testing how much work it would be to get my changes to master, and
it wasn't, so I thought I could as well make that available as a
preview. With all caveats, i.e. lots of things still to do, lots of
FIXME/tty, no documentation, few comments, only built on macOS, blah
blah.

This is how I convince Posframe and Corfu to run on ttys plus some color
stuff, since frames on ttys have no borders, at least so far, and I
don't know if I dare changing that.

(defun my-posframe-face (face)
  (when (featurep 'tty-child-frames)
    (set-face-attribute face nil
                        :background "gray15"
                        :foreground "white")))

(use-package posframe :straight t
  :init
  (when (featurep 'tty-child-frames)
    (defun posframe-workable-p ()
      "Test posframe workable status."
      (and (>= emacs-major-version 26)
           (not (or noninteractive
                    emacs-basic-display
                    ;;(not (display-graphic-p))
                    (eq (frame-parameter (selected-frame) 'minibuffer) 
'only)))))))

(use-package transient-posframe :straight t
  :after transient
  :custom (transient-posframe-min-height 5)
  :config
  (my-posframe-face 'transient-posframe)
  (transient-posframe-mode))

(use-package vertico-posframe :straight t
  :custom
  (vertico-posframe-mode t)
  (vertico-posframe-parameters nil)
  :config
  (setq vertico-posframe-parameters '((no-special-glyphs . t)))
  (my-posframe-face 'vertico-posframe))

(use-package corfu :straight t
  :config
  (when (featurep 'tty-child-frames)
    (cl-defgeneric corfu--popup-support-p ()
      "Return non-nil if child frames are supported."
      t))
  (global-corfu-mode 1))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]