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, 19 Apr 2024 19:17:14 +0300 Organization: LINKOV.NET Message-ID: <86r0f1zaed.fsf@mail.linkov.net> References: <86h6gv7e0z.fsf@mail.linkov.net> <867ch7gfa4.fsf@mail.linkov.net> <86bk6iwftq.fsf@gnu.org> <86il0pd8da.fsf@mail.linkov.net> <864jc9wk5r.fsf@gnu.org> <861q7dgla3.fsf@mail.linkov.net> <86il0pulum.fsf@gnu.org> <86cyqwjtpr.fsf@mail.linkov.net> <86y19ktkj2.fsf@gnu.org> <86h6g7m773.fsf@mail.linkov.net> <86sezrrrgh.fsf@gnu.org> <86il0m7ceo.fsf@mail.linkov.net> <86a5lysah3.fsf@gnu.org> <86o7ad2j84.fsf@mail.linkov.net> <86mspxnkyt.fsf@gnu.org> <86bk6c5ke3.fsf@mail.linkov.net> <864jbyeo9y.fsf@gnu.org> <86jzkusidd.fsf@mail.linkov.net> <86h6fyd06g.fsf@gnu.org> <861q71rhtk.fsf@mail.linkov.net> <86ttjxq31i.fsf@mail.linkov.net> 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="36856"; 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: rudalics@gmx.at, 69983@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 19 18:22:06 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 1rxr01-0009Qq-IB for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 19 Apr 2024 18:22:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxqzn-0007tP-UL; Fri, 19 Apr 2024 12:21:51 -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 1rxqzl-0007sz-S0 for bug-gnu-emacs@gnu.org; Fri, 19 Apr 2024 12:21:49 -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 1rxqzl-0004j0-Gr for bug-gnu-emacs@gnu.org; Fri, 19 Apr 2024 12:21:49 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rxqzz-0004bR-Ef for bug-gnu-emacs@gnu.org; Fri, 19 Apr 2024 12:22: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, 19 Apr 2024 16:22: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.171354368417453 (code B ref 69983); Fri, 19 Apr 2024 16:22:03 +0000 Original-Received: (at 69983) by debbugs.gnu.org; 19 Apr 2024 16:21:24 +0000 Original-Received: from localhost ([127.0.0.1]:59015 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxqzL-0004XR-QT for submit@debbugs.gnu.org; Fri, 19 Apr 2024 12:21:24 -0400 Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]:51647) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxqzI-0004W0-HV for 69983@debbugs.gnu.org; Fri, 19 Apr 2024 12:21:21 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 5997EC0007; Fri, 19 Apr 2024 16:20:59 +0000 (UTC) In-Reply-To: <86ttjxq31i.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 19 Apr 2024 09:28:41 +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:283690 Archived-At: --=-=-= Content-Type: text/plain > Sorry, actually you are right, let's add a new option. > Will do this soon. The reason why a new option is needed is because display-warning doesn't move point to the bottom line with the last message. So when the warning buffer will be displayed at the bottom of the screen in a narrow window, but the window always stays displaying the top of the warning buffer, the users will miss the last unseen message. To solve this problem, a new option 'warning-display-at-bottom' (whose name has the same prefix as all other options in the same file) will scroll the bottom window, so the last message will always be visible to the user. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=warning-display-at-bottom.patch diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el index 8b43c6a8726..672c9ed4618 100644 --- a/lisp/emacs-lisp/warnings.el +++ b/lisp/emacs-lisp/warnings.el @@ -120,6 +120,14 @@ warning-suppress-types See also `warning-suppress-log-types'." :type '(repeat (repeat symbol)) :version "22.1") + +(defcustom warning-display-at-bottom t + "Display the warning buffer at the bottom of the screen. +The output window will be scrolled to the bottom of the buffer +to show the last warning message." + :type 'boolean + :version "30.1") + ;; The autoload cookie is so that programs can bind this variable ;; safely, testing the existing value, before they call one of the @@ -362,10 +370,20 @@ 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 + (when warning-display-at-bottom + '(display-buffer--maybe-at-bottom + (window-height . (lambda (window) + (fit-window-to-buffer window 10))) + (category . warning)))))) (when (and (markerp warning-series) (eq (marker-buffer warning-series) buffer)) (set-window-start window warning-series)) + (when warning-display-at-bottom + (with-selected-window window + (set-window-point window (point-max)) + (recenter -1))) (sit-for 0))))))))) ;; Use \\ so that help-enable-autoload can do its thing. --=-=-=--