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?K=C3=A9vin?= Le Gouguec Newsgroups: gmane.emacs.bugs Subject: bug#71779: 30.0.60; tab-bar-select-restore-windows: docstring vs default value Date: Wed, 26 Jun 2024 08:44:10 +0200 Message-ID: <87msn819vp.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11854"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Juri Linkov To: 71779@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 26 08:45:34 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 1sMMPO-0002yN-Q8 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 26 Jun 2024 08:45:34 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMMOu-0000Np-Hh; Wed, 26 Jun 2024 02:45:04 -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 1sMMOr-0000N6-L0 for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 02:45:01 -0400 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 1sMMOr-0002kb-2g for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 02:45:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sMMOs-0003Q5-MD; Wed, 26 Jun 2024 02:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?K=C3=A9vin?= Le Gouguec Original-Sender: "Debbugs-submit" Resent-CC: juri@linkov.net, bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Jun 2024 06:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 71779 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: Juri Linkov Original-Received: via spool by submit@debbugs.gnu.org id=B.171938426513080 (code B ref -1); Wed, 26 Jun 2024 06:45:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Jun 2024 06:44:25 +0000 Original-Received: from localhost ([127.0.0.1]:37996 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMMOH-0003Ot-Ax for submit@debbugs.gnu.org; Wed, 26 Jun 2024 02:44:25 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:39492) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMMOF-0003Oj-7n for submit@debbugs.gnu.org; Wed, 26 Jun 2024 02:44:24 -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 1sMMOC-0000HD-E2 for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 02:44:20 -0400 Original-Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMMOA-0002f7-NQ for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 02:44:20 -0400 Original-Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-52cdfb69724so4294694e87.1 for ; Tue, 25 Jun 2024 23:44:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719384256; x=1719989056; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=U5VBzXC7q1o8COP8xT5LSLPJfozhN01RGY13SZfg7JA=; b=D7ev9XUFdTEcgJOqnGm7z+Tep/730E8lnbhIQkZnFWVJkQz5R1npslCbWy13GPsUFl u68ZM/J2gyPCJ4OkmKQgzZoKI4v+q875AatOVQKKnfnQ+bIZ/R5QgsB+oJLj8DYs3OSt fF/WQ5j9/tvxvrloy+nXo/LaRkfF5jM6ARqAtAs2fu5vs8uHsZPA/zf0yKHn2h5TDLlz PPCYp8bxpNjPm+aaYeOwzuxIF0pxNAqiKHaMcXAckAcctiu47LcrsPH3d74mhmkNSxP7 vzlKgecL27yLJZaBU+SaJ13mrAOHGOznNsil4zPx5ZLY1htX2q0NoIan/lIK9JH+KR14 JsGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719384256; x=1719989056; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=U5VBzXC7q1o8COP8xT5LSLPJfozhN01RGY13SZfg7JA=; b=Jr6CpEVlIizJXLlAK+umsd3r5QGW2BVeBxvXae0PBT3ZdOhR5q9wpQkVCYqfTncInT NZ4lgnOfvpiuTWz8xlQ3nWSn38p1RbmbSaRXJ+bui95UAdAHD1zeH1dzw4/F3Gbnv86V Xsl6yIVjtH03RdehafgqLw2+ymA0HvS+lY7SqWANToFnfK9yQtrn8+rDQA/aCn+SAAtA 5J3owPkBG+nok1tmB4lNLKWEhqH2XA9Rf272cEs5aeBcWkOrliMYbU98amn50yhHnOwI R1h+CMFbfJpRYGVQT0NVzugvZ++q3h/q9QSxEzHqatl+lQaZI4UXxb1qTMiT5VNds/ht JaSw== X-Gm-Message-State: AOJu0Yy0kmx+vJPyVKK58QeGGbG1MJYpSeXf/owRp23kSquqJMfXGUEI JbxrT2l0kqoeZfh9s4ogbVIhVUATeMf8QTbzFH+hE7RVWuNe6B6qYtCioA== X-Google-Smtp-Source: AGHT+IHZcPFCEbNijQjlX1T2tQNy/6IN2Lc7Gex90MImN7eh6nkX5QxxbFkQPxb3sUr3ebxRrNJsEQ== X-Received: by 2002:ac2:485b:0:b0:52c:c1aa:dd52 with SMTP id 2adb3069b0e04-52ce183b739mr5506867e87.30.1719384251858; Tue, 25 Jun 2024 23:44:11 -0700 (PDT) Original-Received: from hirondell (80-15-30-180.ftth.fr.orangecustomers.net. [80.15.30.180]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-424c84248afsm12972335e9.31.2024.06.25.23.44.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jun 2024 23:44:11 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::130; envelope-from=kevin.legouguec@gmail.com; helo=mail-lf1-x130.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: 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:287918 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Heya! Intrigued by tab-bar-select-restore-windows's docstring: > Function called when selecting a tab to handle windows whose buffer was k= illed. > When a tab-bar tab displays a window whose buffer was killed since > this tab was last selected, this function determines what to do with > that window. By default, either a random buffer is displayed instead of ^^^^^^^^^^ > the killed buffer, or the window gets deleted. However, with the help > of =E2=80=98window-restore-killed-buffer-windows=E2=80=99 it=E2=80=99s po= ssible to handle such > situations better by displaying an information about the killed buffer. Over here, 'emacs -Q' suggests that _by default_, this option is set to the eponymous symbol 'tab-bar-select-restore-windows'. So the default behaviour that I observe, when coming back to a tab that used to show a killed buffer, is a special-mode buffer named " *Old buffer foo*" saying "This window displayed the buffer =E2=80=98foo=E2=80=99." Based on the NEWS entry, I guess the effective default behaviour is the one intended? In which case, I'm attaching a suggested rewording of the docstring, based on understanding gleaned from cross-referencing the NEWS entry, the docstrings for set-window-configuration, window-restore-killed-buffer-windows, the corresponding manual entries, and the source for set-window-configuration. I am not 100% sure I succeeded in capturing the state of things, so feel free to dismiss the patch; my main goal was to make it easier for Past Me to get an answer to the question: "How do I get the previous behaviour back"? (Rationale FWIW: IME killing buffers is deliberate, so the placeholder buffer feels redundant, i.e. it brings no information; if I am displeased with whatever random buffer was picked to show in that window, I can just switch to another buffer or delete the window) --=-=-= Content-Type: text/x-diff Content-Disposition: inline diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 3401b796cac..58d2ef650a1 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -1456,10 +1456,18 @@ tab-bar-select-restore-windows "Function called when selecting a tab to handle windows whose buffer was killed. When a tab-bar tab displays a window whose buffer was killed since this tab was last selected, this function determines what to do with -that window. By default, either a random buffer is displayed instead of -the killed buffer, or the window gets deleted. However, with the help -of `window-restore-killed-buffer-windows' it's possible to handle such -situations better by displaying an information about the killed buffer." +that window. By default, a placeholder buffer is displayed in that +window to give the user information about the killed buffer; this +option can also be set to: + + * nil: no special handling; `set-window-configuration' will + decide what to do with the window, e.g. make it display + another buffer; + + * a function: display another buffer in that window, and pass that + buffer to the function. See + `window-restore-killed-buffer-windows' for the calling + convention." :type '(choice (const :tag "No special handling" nil) (const :tag "Show placeholder buffers" tab-bar-select-restore-windows) --=-=-=--