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: Tue, 24 Dec 2019 00:47:48 +0200 Organization: LINKOV.NET Message-ID: <87pngepti3.fsf@mail.linkov.net> References: <87sgldfi9j.fsf@mail.linkov.net> <878sn3g0o7.fsf@gmail.com> 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="56931"; 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: ndame , "emacs-devel@gnu.org" To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 24 00:17:14 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 1ijWwq-000EcW-6r for ged-emacs-devel@m.gmane.org; Tue, 24 Dec 2019 00:17:12 +0100 Original-Received: from localhost ([::1]:34164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ijWwn-0003hm-TI for ged-emacs-devel@m.gmane.org; Mon, 23 Dec 2019 18:17:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48714) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ijWwg-0003fY-Cr for emacs-devel@gnu.org; Mon, 23 Dec 2019 18:17:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ijWwf-0006y4-Ew for emacs-devel@gnu.org; Mon, 23 Dec 2019 18:17:02 -0500 Original-Received: from bisque.elm.relay.mailchannels.net ([23.83.212.18]:54234) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ijWwf-0006wv-5B for emacs-devel@gnu.org; Mon, 23 Dec 2019 18:17:01 -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 D1703580D38; Mon, 23 Dec 2019 23:16:59 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a35.g.dreamhost.com (100-96-85-12.trex.outbound.svc.cluster.local [100.96.85.12]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 4EF6F581010; Mon, 23 Dec 2019 23:16:59 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a35.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); Mon, 23 Dec 2019 23:16:59 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Skirt-Madly: 4b1a22b932d5e056_1577143019602_841173732 X-MC-Loop-Signature: 1577143019602:4243527452 X-MC-Ingress-Time: 1577143019601 Original-Received: from pdx1-sub0-mail-a35.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a35.g.dreamhost.com (Postfix) with ESMTP id 18F1E7F086; Mon, 23 Dec 2019 15:16:54 -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=50TkpjI6y355DfvDVWnKgDj6Yic=; b= kXYkRMxbyDx/P8jUScPhG2w8a/7VuYe6ths1aQu4WDkCVie1UWZorH1FXxaRtPgp z52lnk38GGKUNKUJ2DiIgMPiZOaDZj0/lV+sWFpXzSlzwnFSICKJPaqAzkf0wN2X j+8YcD/3YnFDrhiL6Yzv5WZq3vPoD/UdaT2VufGfLUc= 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-a35.g.dreamhost.com (Postfix) with ESMTPSA id 71260A37F6; Mon, 23 Dec 2019 15:16:50 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a35 In-Reply-To: <878sn3g0o7.fsf@gmail.com> (Ihor Radchenko's message of "Mon, 23 Dec 2019 11:50:48 +0800") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrvddvuddgtdejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuohhfffgjkfgfgggtsehmtderredtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtjedrudekieenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutdejrddukeeipdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohephigrnhhtrghrledvsehgmhgrihhlrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 23.83.212.18 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:243597 Archived-At: --=-=-= Content-Type: text/plain > A slightly improved version of the code, which prevents stacking > potentially "spammy" messages (like from eldoc or > org-display-outline-path). The messages are detected by looking at > messages-log-max variable, which is typically set to nil by such > functions. Good heuristics. Another heuristics that could be added is to filter out transient messages ending with ellipsis - added here to a new variable like Eli asked to do: --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline; filename=multi-message.el Content-Transfer-Encoding: quoted-printable (defcustom multi-message-timeout 2 "Number of seconds between messages before clearing the accumulated list." :type 'number :group 'minibuffer :version "28.1") (defcustom multi-message-max 8 "Max size of the list of accumulated messages." :type 'number :group 'minibuffer :version "28.1") (defcustom multi-message-transient "\\.\\.\\.\\'" "Regexp to filter out transient messages that should not be stacked." :type 'regexp :group 'minibuffer :version "28.1") (defvar multi-message-separator "\n") (defvar multi-message-list nil) (defun set-multi-message (message) "Return recent messages as one string to display in the echo area. Note that this feature works best only when `resize-mini-windows' is at its default value `grow-only'." (let ((last-message (car multi-message-list))) (unless (and last-message (equal message (aref last-message 1))) (when last-message (cond ((> (float-time) (+ (aref last-message 0) multi-message-timeout)) (setq multi-message-list nil)) ((or ;; `message-log-max' was nil, potential clutter. (aref last-message 2) (string-match-p multi-message-transient (aref last-message 1))) (setq multi-message-list (cdr multi-message-list))))) (push (vector (float-time) message (not message-log-max)) multi-messa= ge-list) (when (> (length multi-message-list) multi-message-max) (setf (nthcdr multi-message-max multi-message-list) nil))) (mapconcat (lambda (m) (aref m 1)) (reverse multi-message-list) multi-message-separator))) (setq set-message-function 'set-multi-message) --=-=-=--