From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: warnings and window-point Date: Fri, 22 Nov 2019 02:01:24 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000011fa3b0597e4f6aa" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="258851"; mail-complaints-to="usenet@blaine.gmane.org" To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 22 02:02:47 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iXxLS-0015Ci-Im for ged-emacs-devel@m.gmane.org; Fri, 22 Nov 2019 02:02:47 +0100 Original-Received: from localhost ([::1]:46782 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXxLQ-0008EH-RY for ged-emacs-devel@m.gmane.org; Thu, 21 Nov 2019 20:02:44 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43133) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iXxKm-0008E0-JY for emacs-devel@gnu.org; Thu, 21 Nov 2019 20:02:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iXxKl-0003O7-4f for emacs-devel@gnu.org; Thu, 21 Nov 2019 20:02:04 -0500 Original-Received: from mail-qv1-xf35.google.com ([2607:f8b0:4864:20::f35]:32802) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iXxKk-0003Nv-UV for emacs-devel@gnu.org; Thu, 21 Nov 2019 20:02:03 -0500 Original-Received: by mail-qv1-xf35.google.com with SMTP id x14so2255903qvu.0 for ; Thu, 21 Nov 2019 17:02:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=wLao57xpZTriz3nnp6dIkEGPiruKlyvKhg+e5HX/Cfw=; b=X56rICGvHLhdnSrrvFO3kHwm2GGOTS4lDCllTIpfSFtbLGPiKWyU0CEF/sh0xehaDy Jxc3u0q5EChzMSp5/j7PWl/G2nGBuaNR4Tv4PW1ywL1NUk6en0U/UH7o4NnQ2znK6/Hj Fn/6c5Kip4a5CDOlUphBlaM18Kq0gkyxw6hQW7s2D1y/4GIdCbCvBwCTJtKnv0COICnr vhL3XXrLEspyiHYk1XQnDZnq6hTY5Yr2RGuFa09Exph7amZvi0zugqxUizO0o5hxkYPY d97pqq2A/gpCgH5D8UG4GfrJv/oa6mKZFN17anN8tTpTgwUI4a8/CMcrktJazltgaw59 /kIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=wLao57xpZTriz3nnp6dIkEGPiruKlyvKhg+e5HX/Cfw=; b=ju5MgOxiP/q+fuJQchRbrhHHPVZfWEiRFaXsOvzguKs5Bw2JPD9gpTi+1HnOubAPgS E3/+D5fXpbhdW3zhYrB9wfoHPZ7sOgPaY79Fy3HybUdNsSCHmw2YVaoDc5FupdtQrO7c PDbtSX4JcXJhWQym6d5HicGzZgDQUIALKrXryYyWAxyWvq9JvwN++RYGmUUkVgYanHrm 3HItK5GMpsY44L3oSCl2Ta22yKyH5PxBnlZYS4fwH/V1d3LXJSVAq1XnXdezm5IuE4qd ggeS0NjALWipYK+1gW+94QmXwOEcDLLIhS/kQARpm2Oka0eg9nyHq3/gDBgQ6aHnZxmi QKdg== X-Gm-Message-State: APjAAAXCggQd3cf2V8J3gELnS/SxyKcw3v6yD6JBjC4It9yLdJV8g4c+ XBCHK8r291m211uLycycfkhZHVxVZoxl9QEJE83aD3c3 X-Google-Smtp-Source: APXvYqyavkVpPp+XBSgeGPHwo6Fi+mdPUlK1SEmfQ2f7Z1jcr0PrONbDbTFzAxihgmaBtbOTjYWD8ZVj4xnaGdDP3DE= X-Received: by 2002:ad4:42a8:: with SMTP id e8mr3252329qvr.217.1574384520262; Thu, 21 Nov 2019 17:02:00 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::f35 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:242597 Archived-At: --00000000000011fa3b0597e4f6aa Content-Type: text/plain; charset="UTF-8" Not sure if that's a bug or a feature, because it's been so since the beginning (it already happens in 22.1, where warnings.el was introduced). But it is definitely weird. Warnings are added at the end of the *Warnings* buffer, and the buffer is displayed, but the window-point does not move. So if you write a lot of warnings, like (dotimes (i 40) (lwarn 'emacs :warning "i = %d" i)) only the beginning of the buffer is shown, and the window-point is stuck at the beginning of the *second* warning in the buffer. Basically, if you have the *Warnings* buffer open in some window, but you don't scroll it, once the window is full, you're unaware that new warnings are appearing. Perhaps the idea is to keep past warnings visible until the user scrolls the buffer themself, but if warning-series is set, display-warning calls set-window-start and sets the origin of the window at the first warning of the series (and weirdly, the window-point is not reset to the first visible position in the window). (dotimes (i 100) (when (= i 50) (setq warning-series t)) (lwarn 'emacs :warning "i = %d" i)) What I would've expected is something like this: diff --git i/lisp/emacs-lisp/warnings.el w/lisp/emacs-lisp/warnings.el index e5c1d9cec4..c9d7aff529 100644 --- i/lisp/emacs-lisp/warnings.el +++ w/lisp/emacs-lisp/warnings.el @@ -316,7 +316,8 @@ display-warning (warning-suppress-p type warning-suppress-types) (let ((window (display-buffer buffer))) - (when (and (markerp warning-series) - (eq (marker-buffer warning-series) buffer)) - (set-window-start window warning-series)) + (if (and (markerp warning-series) + (eq (marker-buffer warning-series) buffer)) + (set-window-start window warning-series) + (set-window-point window end)) (sit-for 0))))))))) --00000000000011fa3b0597e4f6aa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Not sure if that's a bug or a feature, because it'= s been so since the beginning (it already happens in 22.1, where warnings.e= l was introduced). But it is definitely weird.

Warnings = are added at the end of the *Warnings* buffer, and the buffer is displayed,= but the window-point does not move. So if you write a lot of warnings, lik= e

(dotimes (i 40) (lwarn 'emacs :warning "= ;i =3D %d" i))

only the beginning of the buff= er is shown, and the window-point is stuck at the beginning of the *second*= warning in the buffer. Basically, if you have the *Warnings* buffer=C2=A0o= pen in some window, but you don't scroll it, once the window is full, y= ou're unaware that new warnings are appearing.

Perhaps the idea is to keep past warnings visible until the user scrolls t= he buffer themself, but if warning-series is set, display-warning calls set= -window-start and sets the origin of the window at the first warning of the= series (and weirdly, the window-point is not reset to the first visible po= sition in the window).

(dotimes (i 100)
=C2=A0 = (when (=3D i 50) (setq warning-series t))
=C2=A0 (lwarn 'emacs :warn= ing "i =3D %d" i))

What I would'= ve expected is something like this:

diff --git i/lisp/emacs-lisp/war= nings.el w/lisp/emacs-lisp/warnings.el
index e5c1d9cec4..c9d7aff529 1006= 44
--- i/lisp/emacs-lisp/warnings.el
+++ w/lisp/emacs-lisp/warnings.e= l
@@ -316,7 +316,8 @@ display-warning
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(warning-suppress-p type warni= ng-suppress-types)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(let ((window (display-buffer buffer)))
- =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(when= (and (markerp warning-series)
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (= eq (marker-buffer warning-series) buffer))
- =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(set-window-start w= indow warning-series))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(if (and (markerp warning-series)
+ =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 (eq (marker-buffer warning-series) buffer))
= + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(set-window-start window warning-series)
+ =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(s= et-window-point window end))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(sit-for 0)))))))))
=C2=A0=0C

--00000000000011fa3b0597e4f6aa--