From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#68235: 29.1.90; Switching tabs stops following process output in selected window Date: Tue, 23 Jan 2024 10:30:49 +0100 Message-ID: <82ad12e6-babf-4be1-bab1-b7c8bb25e2a4@gmx.at> References: <86v885je23.fsf@mail.linkov.net> <868r4ymn7x.fsf@mail.linkov.net> <86h6jlqh2i.fsf@mail.linkov.net> <5e438b04-6fb7-4114-a5a8-61db9809b297@gmx.at> <86cyu7m4kc.fsf@mail.linkov.net> <2f80855c-3bf9-4973-a484-059cdef3b8c7@gmx.at> <669371d8-7c65-4c5f-99a9-0d8298808d23@gmx.at> <86cyu5cc0p.fsf@mail.linkov.net> <868r4reoh3.fsf@mail.linkov.net> <0634c46f-db93-4492-be69-5ac6ca0102a8@gmx.at> <865xzuvdgu.fsf@mail.linkov.net> <86a5p5qv61.fsf@mail.linkov.net> <86edeg2ige.fsf@mail.linkov.net> <21dcf921-acc4-4f94-b383-8ad6d0a57c59@gmx.at> <86v87qpow0.fsf@mail.linkov.net> <4bc98faf-5ebe-4c22-8c9f-04755785fde5@gmx.at> <86jzo16dcy.fsf@mail.linkov.net> Reply-To: martin rudalics Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16486"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: daniel.c.mccarthy@gmail.com, Eli Zaretskii , 68235@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 23 10:32:33 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 1rSD8y-00041e-Ib for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 23 Jan 2024 10:32:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSD8S-0001m1-Ey; Tue, 23 Jan 2024 04:32:00 -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 1rSD8P-0001l4-VB for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 04:31: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 1rSD8P-00047D-MO for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 04:31:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rSD8T-0002Zz-Om for bug-gnu-emacs@gnu.org; Tue, 23 Jan 2024 04:32:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 23 Jan 2024 09:32:01 +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.17060022669830 (code B ref 68235); Tue, 23 Jan 2024 09:32:01 +0000 Original-Received: (at 68235) by debbugs.gnu.org; 23 Jan 2024 09:31:06 +0000 Original-Received: from localhost ([127.0.0.1]:42208 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSD7a-0002YU-0T for submit@debbugs.gnu.org; Tue, 23 Jan 2024 04:31:06 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:57737) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSD7W-0002Xx-ES for 68235@debbugs.gnu.org; Tue, 23 Jan 2024 04:31:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.at; s=s31663417; t=1706002250; x=1706607050; i=rudalics@gmx.at; bh=fO0xFxKVOwWgt/7H3vyFA3+MSElRuXLvwL3btEG4s98=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From: In-Reply-To; b=R/f3pMn0A0MlOEHCAEC+X0CvYcMx4K1XJPvFKqE2HAas6lcwMPgkQAebpx/EAA9B tfjeeejg1YnTchIW9zWIXUbUqt4jnVOtKuCzWi2VPPrN7ewzUMTwmg1ojCk8uIOxH 9JeIN8IbtJx/uXoYUqtzPDjEe1IKDVAR/liTPXtV9PQEVh0BZSPKs9sWvM+QHv0Ye AbKOqwF9I+QZ1ngLCV0xqmc4tFG+CiCKxiJbRE1mtmpVSYmyTpnOefMoLt0KCyYxQ YRUSJ4ar8pZbvHzsbeo5OGeQKTlq7DqSZEIXk3eMj4Dk4u9MRAiAaUxsu7d+K85ew oU1oayqIfHEiskNW+w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [192.168.31.113] ([46.125.249.64]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mqs4Z-1qoFg33333-00msjN; Tue, 23 Jan 2024 10:30:50 +0100 Content-Language: en-US In-Reply-To: <86jzo16dcy.fsf@mail.linkov.net> X-Provags-ID: V03:K1:L4QX47JvGXwI+XoDBANvVF3JlBFswwN/WGr3z3xWbnHxHe6uKvt IRf6tO+Oce3wiCdWUBGNzckZn423C4fu1nyyh6Vho0lzUPyf3C0xziOqbm+9Hq/ud/7LNKE 0ltApkw0xIexGTXTTOO8pwEESsU8Ofz6tr5GjhR4TFpYLRxDUytZ7zOoYrPAzrtq62sJI4p TEAFMTtJNbzGyiJnQPYCQ== UI-OutboundReport: notjunk:1;M01:P0:cqfQhk5LKzQ=;/9zzj7uwvBEyTjrde8z6GGbTMOV oqXdqxdWeqd9uyiY30YoKs1O3S6vMKrQ/cw/t9jVljS4P+YtLoUeh4U+Tq0jxhjaXoQuwKXg+ tafFIWQH8WqPqnJO4BNrDJGnoeKLbRJNI30oaMN5jlLJ4UoJCA5BFj8eTsXth2GZMEyMxcVhE gFAFI54e7EY0DGFmAEiwsR16VsVeG9FGFJB33G31f0jsch3QsVCBi/fqHFpu7wAMCzVtehZYw Ytjmzi/F0/WtbS/MgW18JAmtrvHEcQymvEpQtNztks5LbHTVkD4pRdxrJW5dXlQestqFg/P5/ uVGhzUmp86WgQ8a4Y36Cbr0l7NTWy25tT2O0P4A53T4JdKIwttCUd5DjfKmKrr4VkqNvzgS2e +sTHWtIzt/XuhqTBtL4eKGmMUQpkwYEHv70pmnsCE2+uISJBG2uaSGolYAMpblmZJzSeKhfs7 17viYU8B3SoDdZrxJfmiKV31R9y5kSo5tNsBDDLY7X0Ijd6RMFJU5O5p+fXQWA6BxT01uF/+H iXldbGZs+GzjTkDHhbyKyvUflg9gO17II4mHZWfgxRtFCEuyKJvcJWH2TcxZcwL9xmigfDXXh NBL79TxTqQNypFwqlSoL8X/zmGOEgMnrLbY+N7F03U9u5vReT9tahq82Me2KfLI61oybL46P+ 6GizU80fRkhh0of3dRidE6Jr+LA5CS+FWNvvqhzyvppEmlfkwu+PG3LCHJKc1WKPO+afuvruq MRi6OtlLMORoMdXW6vk1VDKjPoIQ4Q38wzPhXDy4MS1AssD0JDle8vCqwbGLqxcgrW1MrNeW 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:278726 Archived-At: > 1. 'post-set-window-configuration-functions' is called even > after 'delete-other-windows' and 'kill-buffer', albeit with > windows=nil, so no problems. I don't understand what you mean here. Do you mean that it gets called because for some reason 'set-window-configuration' gets called after 'delete-other-windows' and 'kill-buffer'? > 2. It seems there is no way to get the name of the killed buffer > from '(nth 1 quad)'? No way. 'buffer-name' with a killed buffer as argument has to return nil - too many functions may rely on that. > Here is what I tried: > > (defun foo (frame windows) > (while windows > (let* ((quad (car windows)) > (window (car quad)) > (buffer (generate-new-buffer > (format " *Old buffer %s*" (nth 1 quad))))) > (with-current-buffer buffer > (insert (format "Restore the original buffer named %s:\n" > (nth 1 quad))) > (insert-button > "[Restore]" > 'action > (lambda (_button) > (set-window-buffer window (find-file-noselect > (buffer-file-name (nth 1 quad)))) > (set-window-point window (nth 3 quad)) > (set-window-start window (nth 2 quad) t))) > (set-window-buffer window buffer))) > (setq windows (cdr windows)))) > > It inserts to the transient buffer this text without the real buffer name: > > Restore the original buffer named #: > [Restore] I'd say Restore buffer from ... and use the file name here. > But the button really restores the original buffer. Because many functions with a buffer as argument like 'buffer-file-name' don't check whether that buffer is live. You can find such functions by looking for "decode_buffer (buffer)" in buffer.c. 'buffer-name' fails because the name of the buffer _is_ reset to nil when the buffer is killed. We could add a new field to the buffer structure and a function say 'buffer-last-name' which would return the last name a buffer had before it was renamed: nil for a new buffer, the old name before the last 'rename-buffer' and the last buffer name for a dead buffer. And always think about what to propose when a new buffer with the same name has been created meanwhile. > 3. It seems the buffer-local value of 'revert-buffer-function' > is not preserved in the killed buffer? 'kill-buffer' calls reset_buffer_local_variables which scans the local variables alist of the buffer and resets all values to their default values. Giving the variable either a 'permanent-local' property or binding the default value to the buffer local value around 'kill-buffer' could work around that but I'd rather try to save this (and other buffer local values) in a separate alist for buffers stored in a configuration. martin