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#69983: Use category for display-buffer-alist Date: Fri, 05 Apr 2024 19:47:50 +0300 Organization: LINKOV.NET Message-ID: <86h6gf69jd.fsf@mail.linkov.net> References: <86h6gv7e0z.fsf@mail.linkov.net> <3e7b8e64-0a5f-4888-a443-9c69a5fffd98@gmx.at> <86wmpdu0fa.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27279"; 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: 69983@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 05 18:53:19 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 1rsmoY-0006oZ-PU for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Apr 2024 18:53:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rsmoI-0003pL-Hr; Fri, 05 Apr 2024 12:53:02 -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 1rsmoH-0003or-B1 for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2024 12:53: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 1rsmoD-0000F1-UT for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2024 12:52:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rsmoJ-0006gs-Et for bug-gnu-emacs@gnu.org; Fri, 05 Apr 2024 12:53:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Apr 2024 16:53:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69983 X-GNU-PR-Package: emacs Original-Received: via spool by 69983-submit@debbugs.gnu.org id=B69983.171233597925667 (code B ref 69983); Fri, 05 Apr 2024 16:53:03 +0000 Original-Received: (at 69983) by debbugs.gnu.org; 5 Apr 2024 16:52:59 +0000 Original-Received: from localhost ([127.0.0.1]:37419 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsmoF-0006fv-0r for submit@debbugs.gnu.org; Fri, 05 Apr 2024 12:52:59 -0400 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]:32983) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rsmoC-0006f3-S5 for 69983@debbugs.gnu.org; Fri, 05 Apr 2024 12:52:58 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id B277B20002; Fri, 5 Apr 2024 16:52:43 +0000 (UTC) In-Reply-To: <86wmpdu0fa.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 04 Apr 2024 09:16:17 +0300") 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:282715 Archived-At: >>> 'display-comint-buffer-action' and 'display-tex-shell-buffer-action' >>> are out of place in window.el, and they are redundant per se. >>> >>> What these variables are trying to achieve is already possible >>> to do by using a 'category' in 'display-buffer-alist'. >>> >>> Or we need to keep backward-compatibility? Then the first step >>> to deprecate there variables would be something like this: >> >> Please proceed as carefully as possible, here might be dragons. > > Ok, here is a complete patch: So now pushed. Here is a new patch that adds the category 'warning' to 'display-warning', as well as adds the default display action that is like the action in 'debug' that displays the "*Backtrace*" buffer. One problem is that I can't find an alist item to limit the window height, i.e. can't find window-max-height that would be like window-min-height, but to set a max height. Could you suggest such an alist item? diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el index 6c62a56e99c..2a9f5e5d9f9 100644 --- a/lisp/emacs-lisp/warnings.el +++ b/lisp/emacs-lisp/warnings.el @@ -358,7 +358,12 @@ display-warning (or (< (warning-numeric-level level) (warning-numeric-level warning-minimum-level)) (warning-suppress-p type warning-suppress-types) - (let ((window (display-buffer buffer))) + (let ((window (display-buffer + buffer + '(display-buffer--maybe-at-bottom + (window-min-height . 10) + (window-height . fit-window-to-buffer) + (category . warning))))) (when (and (markerp warning-series) (eq (marker-buffer warning-series) buffer)) (set-window-start window warning-series))