From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: "Final" version of tty child frames Date: Tue, 22 Oct 2024 06:46:15 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32800"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 22 06:47:16 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t36nb-0008R2-05 for ged-emacs-devel@m.gmane-mx.org; Tue, 22 Oct 2024 06:47:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t36mk-0000vm-Px; Tue, 22 Oct 2024 00:46:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t36mj-0000va-F3 for emacs-devel@gnu.org; Tue, 22 Oct 2024 00:46:21 -0400 Original-Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t36mi-000810-0I for emacs-devel@gnu.org; Tue, 22 Oct 2024 00:46:21 -0400 Original-Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4315f24a6bbso43573615e9.1 for ; Mon, 21 Oct 2024 21:46:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729572378; x=1730177178; darn=gnu.org; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=jaTr56tJWLn1wEdUUi8E6iq/S2KHvsUo5qZO9JlXlWo=; b=QwCkHF87mPQd5t3OnGiBE/6DEpfOixqM98Amukt01EcMJfSnq048KjznlrObSglR4f uGJpXa25Pm+JtVnvQ/UHmc2e8Co+pf7wK28ke3Qa7QhE2sBCpvQ0QgM1gV5wEtjakA2t zI2jy8dn7HRfrgNLlJREF7G+u9uoCaP1ArbeIHQlZ7Y2oAFllgf3Qo5WKWgSkRRaMSIH UwovGnDnuSQpHTRu+npUPR9EziIj72mHiLl8VJTpeDphqrmUCONZvE34mChXSjKZ5mIx SRzprKQiSkEfGxH5xQX8MZhoRRE3ZItfxaQynIndZjP0yXr8zEB9FDZKeGIaTFiqhFoD 6gKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729572378; x=1730177178; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jaTr56tJWLn1wEdUUi8E6iq/S2KHvsUo5qZO9JlXlWo=; b=Cl339j355HzVX8Rpq4K2p/GUdImOGzOys9klvsKnziIRRIGR+xE4J1sm22KgluHtIu LxGH6MTbgSXbBJ67s9Dmb6PymZHIm/rl1/G3+CP0D9WW9vT9SxcIBBG3OjRC+elSmY/1 Vxd387aH972tRXuZ46eV5YWKesY+KhKYcaVl2kCrRjPWLb1tmnzFL+EbhBrLyUQ8Oo4r o4Mlcsx/IDPzuwMh39QpBL4nLb4Av+DW3p8Dm+PlF/jzM9o63LqMykCMjHkvVemTmxcG 4eqLXz5FmstdbQME1Ktypco1tv+aw2zyeeO7RlA0/fTlwqwzOeHh6BkaUJRkxMPWOpJC 3u/g== X-Gm-Message-State: AOJu0YxvI+SbXIqM3OrB2kkFhllDTv57cf6xegSAaTo/2pYD7oIy/ZXZ oVdJitoBL+OnEqXRnn/uono+io157lGSJ5PZZXH9wwobz7ssX8IavIoyz6Nx X-Google-Smtp-Source: AGHT+IHFNj6OMsxuY9eLpDmXIuF+5RoqTP/El/elW9jVqv4fcCfaD4lrW5ncb44UtPJBlyCJSk1/Tg== X-Received: by 2002:a5d:694a:0:b0:37d:4956:b0b4 with SMTP id ffacd0b85a97d-37eb48c1e60mr8423026f8f.59.1729572377698; Mon, 21 Oct 2024 21:46:17 -0700 (PDT) Original-Received: from pro2 (p4fe3ac5a.dip0.t-ipconnect.de. [79.227.172.90]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37ee0a477d9sm5704131f8f.26.2024.10.21.21.46.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2024 21:46:17 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=gerd.moellmann@gmail.com; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:324715 Archived-At: I have (re-)created the scratch/tty-child-frames branch today, which contains the code for child frames on ttys, based on a recent master. I'm a happy user of this for a while now with corfu, vertico + vertico-posframe + consult, transient + transient-posframe, which-key + which-key-posframe. And my current todo list is now empty, so here it is. To use it, redefine these two functions: #+begin_src emacs-lisp (defun posframe-workable-p () "Test posframe workable status." (and (>= emacs-major-version 26) (not (or noninteractive emacs-basic-display (or (featurep 'tty-child-frames) (not (display-graphic-p))) (eq (frame-parameter (selected-frame) 'minibuffer) 'only))))))) (cl-defgeneric corfu--popup-support-p () "Return non-nil if child frames are supported." (or (display-graphic-p) (featurep 'tty-child-frames))) #+end_src To make things look nicer you might also want to #+begin_src emacs-lisp (push '(tty-non-selected-cursor . t) vertico-posframe-parameters) (push '(undecorated . nil) vertico-posframe-parameters)) (push '(undecorated . nil) transient-posframe-parameters)) #+end_src The 'undecorated' frame parameter lets Emacs draw a border around the child frame (default is no border). The tty-non-selected-cursor parameter makes redisplay put the terminal cursor in a non-selected frame which I find nice for things like consult-buffer. Which is why I added it :-). What's there fits my personal needs entirely. I am not interested in full support of child frames as they exist on window systems because I don't see child frames being used except for things like posframe and corfu and similar. And, TBH, I don't find the tty frame code fun to work with. Other things not contained: - Support for anything but termcap frames. I bet I broke MSDOS. - Mouse support except with xterm-mouse-mode (no GPM). - Drawing borders like it is normally done (internal border and so on). Tried that once, git reset --hard, won't happen. - Tooltips. I think tooltips could relatively easily be implemented with child frames by copying or extracting the non-native tooltip code from x-show-tip or some such. From my POV, that would be best done by refactoring the tooltip code across window systems which I can't do. - Documentation. Would only make sense to write if this goes into GNU, which might or might not happen, depending on, from my side, how much work that is. Disclaimer: As I mentioned already in other contexts, I don't want to be the maintainer of anything, for personal reasons. Have fun!