From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#36343: 26.2; [PATCH] `view-echo-area-messages': set `window-point' to `point-max' Date: Sun, 23 Jun 2019 09:29:42 -0700 (PDT) Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="79968"; mail-complaints-to="usenet@blaine.gmane.org" To: 36343@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jun 23 18:32:03 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1hf5PN-000Kcx-MZ for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Jun 2019 18:32:01 +0200 Original-Received: from localhost ([::1]:45638 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hf5PM-0001iz-Ec for geb-bug-gnu-emacs@m.gmane.org; Sun, 23 Jun 2019 12:32:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55410) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hf5Oa-0001il-60 for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2019 12:31:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hf5OY-0006vt-Dc for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2019 12:31:11 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40621) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hf5OQ-0006gc-IV for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2019 12:31:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hf5OQ-0002TC-BY for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2019 12:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Jun 2019 16:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36343 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15613074099361 (code B ref -1); Sun, 23 Jun 2019 16:31:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Jun 2019 16:30:09 +0000 Original-Received: from localhost ([127.0.0.1]:54165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hf5NW-0002Qr-Vp for submit@debbugs.gnu.org; Sun, 23 Jun 2019 12:30:09 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:49591) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hf5NS-0002Qc-BD for submit@debbugs.gnu.org; Sun, 23 Jun 2019 12:30:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55236) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hf5NQ-0001UN-K2 for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2019 12:30:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hf5NL-0003dP-5o for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2019 12:29:58 -0400 Original-Received: from userp2120.oracle.com ([156.151.31.85]:51834) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hf5NG-0003IK-Sf for bug-gnu-emacs@gnu.org; Sun, 23 Jun 2019 12:29:52 -0400 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5NGOHdd108053 for ; Sun, 23 Jun 2019 16:29:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=AwBxThAUebfBonCFT5v5McY2FXPwMMlgz/9ZskYA9wM=; b=34y6DeuHhx7R6vT0Nhvpl1kKPtJgqcCjXNuPthR/a6h5QDuoYgJGyoGFAddB9uRmHTHz SsFwGetaKE4B2n8Q46MozsvaZtVN9wrgBBhQ7EXrT7Cb5pTGBHA5bUuYspSw9YBXRqWB VtWg7eYqhFP1WKlBzkPzffBPcH/YgcyEmRaOcw5k9WrTKORe77IIoZ9mqV33njP6QJHw PosSCmaAcKKOPM6g0xoiyMXom3I9h63SnffSQQ2F1St/IDFEyyepZZksJRGUnv/y0uj1 mfooo2XXj/0cXFWH+fagfTL/J4mbsxZeOZMq3LV8Zu1RxC4d7BvHtBqZ3p03PJ1jb5Bo bA== Original-Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 2t9cyq2xjt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sun, 23 Jun 2019 16:29:45 +0000 Original-Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5NGSjVj158538 for ; Sun, 23 Jun 2019 16:29:44 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 2t9p6t89p8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sun, 23 Jun 2019 16:29:44 +0000 Original-Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x5NGThCc005204 for ; Sun, 23 Jun 2019 16:29:43 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4861.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9297 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906230143 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9297 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906230143 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:161124 Archived-At: `C-h f view-echo-area-messages' says this: View the log of recent echo-area messages: the '*Messages*' buffer. The number of messages retained in that buffer is specified by the variable 'message-log-max'. It does that. But one might expect "view the log of recent" to mean make the most recent msgs logged visible. That doesn't happen if `*Messages*' is already displayed in a window other than the selected one. This definition fixes that. It just sets `window-point'. Hopefully you don't need an explicit *.patch to apply this fix. (defun view-echo-area-messages () "View the log of recent echo-area messages: the `*Messages*' buffer. The number of messages retained in that buffer is specified by the variable `message-log-max'." (interactive) (with-current-buffer (messages-buffer) (goto-char (point-max)) (let ((win (display-buffer (current-buffer)))) (set-window-point win (point)) win))) This definition doesn't do anything special to make all parts of the buffer visible - it doesn't `widen' or show any text that might be hidden. It just makes sure that the most recent msgs that are aleady visible are on-screen. I think that's probably what we want. --- If you really think the current behavior is what users expect, and you think it should be kept as the default behavior, then please consider at least letting a prefix arg set the window point to `point-max': (defun view-echo-area-messages (arg) "View the log of recent echo-area messages: the `*Messages*' buffer. The number of messages retained in that buffer is specified by the variable `message-log-max'. With a prefix arg move `window-point' to `point-max'." (interactive "P") (with-current-buffer (messages-buffer) (goto-char (point-max)) (let ((win (display-buffer (current-buffer)))) (when arg (set-window-point win (point))) win))) The code above (both versions) returns the window, like the current code. Dunno whether that's important, but at least that behavior is preserved, just in case something depends on it. --- Note: You might also want to consider giving users the ability (i.e. option) to ensure that `message' itself always moves `window-point' to `point-max' in any window that is already displaying `*Messages*'. Just a suggestion - not part of this bug report. See, for example, https://stackoverflow.com/q/4682033/729907. In GNU Emacs 26.2 (build 1, x86_64-w64-mingw32) of 2019-04-13 Repository revision: fd1b34bfba8f3f6298df47c8e10b61530426f749 Windowing system distributor `Microsoft Corp.', version 10.0.17134 Configured using: `configure --without-dbus --host=3Dx86_64-w64-mingw32 --without-compress-install 'CFLAGS=3D-O2 -static -g3''