From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Intelligent stacking of messages in the echo area Date: Sun, 22 Dec 2019 00:07:52 +0200 Organization: LINKOV.NET Message-ID: <87sgldfi9j.fsf@mail.linkov.net> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="50986"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) Cc: "emacs-devel@gnu.org" To: ndame Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 21 23:11:59 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 1iimyc-000D9Q-W1 for ged-emacs-devel@m.gmane.org; Sat, 21 Dec 2019 23:11:59 +0100 Original-Received: from localhost ([::1]:42482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iimyb-0001WM-RS for ged-emacs-devel@m.gmane.org; Sat, 21 Dec 2019 17:11:57 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52527) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iimwz-0008Bw-EO for emacs-devel@gnu.org; Sat, 21 Dec 2019 17:10:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iimwx-0007Nb-SR for emacs-devel@gnu.org; Sat, 21 Dec 2019 17:10:17 -0500 Original-Received: from bonobo.elm.relay.mailchannels.net ([23.83.212.22]:23096) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iimwx-0007Gw-DF for emacs-devel@gnu.org; Sat, 21 Dec 2019 17:10:15 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 01AA21A1784; Sat, 21 Dec 2019 22:10:14 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a1.g.dreamhost.com (100-96-6-5.trex.outbound.svc.cluster.local [100.96.6.5]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 814B91A1328; Sat, 21 Dec 2019 22:10:13 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a1.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Sat, 21 Dec 2019 22:10:13 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Invention-Befitting: 13f62ce70548b489_1576966213802_2510911902 X-MC-Loop-Signature: 1576966213802:3764941028 X-MC-Ingress-Time: 1576966213801 Original-Received: from pdx1-sub0-mail-a1.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a1.g.dreamhost.com (Postfix) with ESMTP id 43A987F61B; Sat, 21 Dec 2019 14:10:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=h+0z4aTPgNu1YS4O8eeuDjjX1hA=; b= rv2dzh4gOIQcHwY8pkGLkjePtzX2sFcMTXPGxCPw7mnjMTJx6YB6wOsg0S0e9RQU MZ9RRh3pns7EF2GPGKLWsVwOx/VJlCOS79BQ9zSyKssUtyfrb1VF3winkA62vbRa b8y5pgP+7TuvsnOyWcSFJyPVjLyO1rs+QIW1Mk+6uk0= Original-Received: from mail.jurta.org (m91-129-107-186.cust.tele2.ee [91.129.107.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a1.g.dreamhost.com (Postfix) with ESMTPSA id 45F557F617; Sat, 21 Dec 2019 14:10:05 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a1 In-Reply-To: (ndame's message of "Sat, 31 Aug 2019 07:35:44 +0200 (CEST)") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrvdduhedgudehfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufhofhffjgfkfgggtgesmhdtreertdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdejrddukeeinecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtjedrudekiedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegvmhgrtghsuhhsvghrsehfrhgvvghmrghilhdrhhhunecuvehluhhsthgvrhfuihiivgeptd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 23.83.212.22 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:243551 Archived-At: --=-=-= Content-Type: text/plain > If two or more packages use the echo area for informational messages > then often they fight each other, overwriting each other's messages. > > For example, in lisp mode eldoc is automatically enabled in my emacs > 26.2 If I also turn on a paren mode which shows in the message area > the matching part of a paren outside of the screen then eldoc often > overwrites this message with its own documentation message. > > Maybe the echo area could be smarter and stack messages on top of each > other if they come from diferent sources and they are close to each > other in time. > > So in case of the above example, if a message comes from eldoc and > parens at the same time in quick succession then the echo area could > show both of them in two lines. > > And if the same source is sending multiple messsages or there is > enough delay between two messages from different sources (e.g. 1-2 > seconds) then it would work as today using only a single line. Please try to eval the following code in the current master. It allows messages produced in quick succession to be stacked in the echo area. So for example when both show-paren-mode and eldoc want to show their messages at the same time, the echo area shows both of them in two lines, e.g.: No matching parenthesis found defun: (NAME ARGLIST &optional DOCSTRING DECL &rest BODY) Caveat: it works best only when resize-mini-windows is at its default value 'grow-only'. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=messages-stack.el Content-Transfer-Encoding: quoted-printable (defcustom messages-stack-timeout 2 "Number of seconds between messages before clearing the stack." :type 'number :group 'minibuffer :version "27.1") (defcustom messages-stack-max 8 "Max size of the message stack." :type 'number :group 'minibuffer :version "27.1") (defvar messages-stack-separator "\n") (defvar messages-stack nil) (defun set-stacked-message (message) (let ((last-message (car messages-stack))) (unless (and last-message (equal message (aref last-message 1))) (when (and last-message (> (float-time) (+ (aref last-message 0) messages-stack-timeout))) (setq messages-stack nil)) (push (vector (float-time) message) messages-stack) (when (> (length messages-stack) messages-stack-max) (setf (nthcdr messages-stack-max messages-stack) nil))) (mapconcat (lambda (m) (aref m 1)) (reverse messages-stack) messages-stack-separator))) (setq set-message-function 'set-stacked-message) --=-=-=--