From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#68235: 29.1.90; Switching tabs stops following process output in selected window Date: Sat, 06 Jan 2024 19:36:25 +0200 Organization: LINKOV.NET Message-ID: <867ckmxto2.fsf@mail.linkov.net> References: <83frzdy6if.fsf@gnu.org> <86edexnmv8.fsf@mail.linkov.net> <83mstlvvkj.fsf@gnu.org> <34a872a9-07b2-4671-837f-f8d98b37420d@gmx.at> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2642"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: daniel.c.mccarthy@gmail.com, Eli Zaretskii , 68235@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 06 18:43:35 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rMAhq-0000ZY-Uq for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Jan 2024 18:43:34 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMAhK-0001Wd-9m; Sat, 06 Jan 2024 12:43:02 -0500 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 1rMAhG-0001WJ-1I for bug-gnu-emacs@gnu.org; Sat, 06 Jan 2024 12:42:58 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rMAhF-0005z2-Mn for bug-gnu-emacs@gnu.org; Sat, 06 Jan 2024 12:42:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rMAhK-0000M2-Kg for bug-gnu-emacs@gnu.org; Sat, 06 Jan 2024 12:43:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Jan 2024 17:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68235 X-GNU-PR-Package: emacs Original-Received: via spool by 68235-submit@debbugs.gnu.org id=B68235.17045629741322 (code B ref 68235); Sat, 06 Jan 2024 17:43:02 +0000 Original-Received: (at 68235) by debbugs.gnu.org; 6 Jan 2024 17:42:54 +0000 Original-Received: from localhost ([127.0.0.1]:60255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMAhB-0000LG-Te for submit@debbugs.gnu.org; Sat, 06 Jan 2024 12:42:54 -0500 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]:32859) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMAhA-0000Kq-B5 for 68235@debbugs.gnu.org; Sat, 06 Jan 2024 12:42:52 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 9CD3D20002; Sat, 6 Jan 2024 17:42:40 +0000 (UTC) In-Reply-To: <34a872a9-07b2-4671-837f-f8d98b37420d@gmx.at> (martin rudalics's message of "Fri, 5 Jan 2024 10:24:06 +0100") X-GND-Sasl: juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:277473 Archived-At: >>> Everything works nicely, and point follows the output, >>> when this code is removed from 'tab-bar-select-tab': >>> >>> ;; set-window-configuration does not restore the value of >>> ;; point in the current buffer, so restore it separately. >>> (when (and (markerp wc-point) >>> (marker-buffer wc-point) >>> ;; FIXME: After dired-revert, marker relocates to 1. >>> ;; window-configuration restores point to global point >>> ;; in this dired buffer, not to its window point, >>> ;; but this is slightly better than 1. >>> ;; Maybe better to save dired-filename in each window? >>> (not (eq 1 (marker-position wc-point)))) >>> (goto-char wc-point)) >> >> Maybe we should make exceptions in buffers like *completions*? >> >> In general, restoring point is a good idea. >> >>> The problem is that I still can't figure out in what cases point should be >>> restored manually. >> >> When the buffer was shown in another window, I think. Martin might >> have a definite answer. > > I think the snippet above should be executed iff the buffer's > 'window-point-insertion-type' is nil. window-point-insertion-type is nil by default, but I'd definitely want point to follow the output, that means not using the snippet above. OTOH, this snippet can't be removed because it supports tab-local point. For example, open the same buffer in two tabs and move point to another place. Like with window-point, the position of point in tabs should be preserved as well. So probably we need to add special-casing for comint buffers to follow the output. But could you explain why such special-casing is not needed for non-selected windows? How set-window-configuration does the right thing for points in non-selected windows to follow the output? Maybe it's possible to do the same with point in the selected window?