emacs-devel
[Top][All Lists]
Advanced

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

Re: "Final" version of tty child frames


From: martin rudalics
Subject: Re: "Final" version of tty child frames
Date: Sat, 11 Jan 2025 18:23:32 +0100
User-agent: Mozilla Thunderbird

> Thanks for that, Martin! Please apply!

Applied now.  There's one ugly issue we should resolve next.
With the following code


(defvar tty-child-frame nil)
(defvar tty-child-buffer (get-buffer-create "*tty-child-buffer*"))
(defvar tty-child-window nil)

(defun tty-make-child-frame ()
  (interactive)
  (setq tty-child-frame
        (make-frame
         `((parent-frame . ,(selected-frame))
           (left . 20)
           (top . 10)
           (width . 0.3)
           (height . 0.8)
           (border-width . 0)
           (background-color . "yellow")
           (tool-bar-lines . 0)
           (menu-bar-lines . 0)
           (minibuffer . nil)
           (no-special-glyphs . t)
           )))
  (setq tty-child-window (frame-root-window tty-child-frame))
  (set-window-buffer tty-child-window tty-child-buffer)
  (set-face-background 'internal-border "blue" tty-child-frame)
  (set-face-background 'child-frame-border "blue" tty-child-frame))

(defun tty-toggle-child-frame ()
  (interactive)
  (if (frame-live-p tty-child-frame)
      (if (frame-visible-p tty-child-frame)
          (make-frame-invisible tty-child-frame)
        (make-frame-visible tty-child-frame))
    (tty-make-child-frame)))

(defun tty-switch-to-child-frame ()
  (interactive)
  (if (frame-live-p tty-child-frame)
      (if (frame-visible-p tty-child-frame)
          (if (eq tty-child-frame (selected-frame))
              (select-frame-set-input-focus (frame-parent tty-child-frame))
            (select-frame-set-input-focus tty-child-frame))
        (make-frame-visible tty-child-frame)
        (select-frame-set-input-focus tty-child-frame))
    (tty-make-child-frame)
    (select-frame-set-input-focus tty-child-frame)))

(global-set-key [(control l)] 'tty-toggle-child-frame)
(global-set-key [(meta l)] 'tty-switch-to-child-frame)


and emacs -Q -nw do C-l followed by M-l and C-l.  That is, make a child
frame, switch to it and make it invisible.  This leaves the point (bar)
cursor in the middle of the normal, root frame in an area where there's
no text and you cannot really move it anywhere.  'xterm-mouse-mode' can
help me out but this might not be available everywhere.

Any ideas?

martin



reply via email to

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