From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Intelligent stacking of messages in the echo area Date: Thu, 30 Jan 2020 00:41:46 +0200 Organization: LINKOV.NET Message-ID: <87pnf1navp.fsf@mail.linkov.net> References: <87sgldfi9j.fsf@mail.linkov.net> <878sn3g0o7.fsf@gmail.com> <87pngepti3.fsf@mail.linkov.net> <878slrcibk.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="130208"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.60 (x86_64-pc-linux-gnu) Cc: emacs-devel@gnu.org To: Eric S Fraga Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 30 00:45:13 2020 Return-path: Envelope-to: ged-emacs-devel@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 1iwx1F-000Xpk-Uc for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Jan 2020 00:45:13 +0100 Original-Received: from localhost ([::1]:53052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwx1E-0003TJ-UE for ged-emacs-devel@m.gmane-mx.org; Wed, 29 Jan 2020 18:45:12 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40482) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwx0P-0002Up-S4 for emacs-devel@gnu.org; Wed, 29 Jan 2020 18:44:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iwx0N-0003Fp-Sf for emacs-devel@gnu.org; Wed, 29 Jan 2020 18:44:21 -0500 Original-Received: from bisque.elm.relay.mailchannels.net ([23.83.212.18]:19488) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iwx0N-0003Cc-BC for emacs-devel@gnu.org; Wed, 29 Jan 2020 18:44:19 -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 B43258C1AF7; Wed, 29 Jan 2020 23:44:16 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a85.g.dreamhost.com (100-96-86-194.trex.outbound.svc.cluster.local [100.96.86.194]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 283238C1C8A; Wed, 29 Jan 2020 23:44:16 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a85.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); Wed, 29 Jan 2020 23:44:16 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Eyes-Name: 37f19d4a4658104b_1580341456402_3482841993 X-MC-Loop-Signature: 1580341456402:736001601 X-MC-Ingress-Time: 1580341456402 Original-Received: from pdx1-sub0-mail-a85.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a85.g.dreamhost.com (Postfix) with ESMTP id 6D0E57F07C; Wed, 29 Jan 2020 15:44:12 -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=Gx4pVMKjUXXtbh6s3tIOLITvlko=; b= xL0IneuMdiwdnuM+4pWDmuaZmJtYNIC3KLcS8SJ8VkIQUPdBP7sxLah2TuYRvvlX j18KZ03Of8r1fsw+g49sDWVqimfhZs/G3iy7c0G4KMsyXbKOuD8dp0lO2PJTmRS3 quG12fXRDKldJT+I9ny4r24zFVTw3iuNR/gaXgEEVIQ= Original-Received: from mail.jurta.org (m91-129-105-126.cust.tele2.ee [91.129.105.126]) (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-a85.g.dreamhost.com (Postfix) with ESMTPSA id AC4637F00E; Wed, 29 Jan 2020 15:44:09 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a85 In-Reply-To: <878slrcibk.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 29 Jan 2020 00:34:15 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedugedrfeejgdduudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddthedruddvieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddthedruddviedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopegvrdhfrhgrghgrsehutghlrdgrtgdruhhk 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:244756 Archived-At: > Now what remains to do is to combine multi-message feature with minibuffer-message, > so when the minibuffer is not active then multi-line messages are displayed > in the echo-area, otherwise multi-line messages are displayed at the end > of the minibuffer: > > (defun set-multi-message--wrapper (orig-fun message) > (let* ((multi-message (set-multi-message message))) > (or (funcall orig-fun multi-message) > multi-message))) > > (setq set-message-function 'set-minibuffer-message) > (add-function :around set-message-function #'set-multi-message--wrapper) Turning this into defcustom is a challenge. I tried to introduce a fictitious 'set-minibuffer-multi-message', but I see no way to use 'add-function' on a symbol in :set of defcustom. It seems something like (local 'SYMBOL) but for global scope is missing, e.g. like an non-existent '(global sym)' demonstrated below, but I'm not sure. diff --git a/lisp/cus-start.el b/lisp/cus-start.el index e3dc6f03c4..18067bfd07 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -646,6 +646,19 @@ minibuffer-prompt-properties--setter :format "%v") (other :tag "Unlimited" t)) "24.3") + (set-message-function + minibuffer (choice + (const :tag "Handle minibuffer" set-minibuffer-message) + (const :tag "Accumulate messages" set-multi-message) + (const :tag "Accumulate messages and handle minibuffer" set-minibuffer-multi-message) + (function :tag "Other function")) + "28.1" + :set (lambda (sym val) + (cond + ((eq val 'set-minibuffer-multi-message) + (set-default sym 'set-minibuffer-message) + (add-function :around (global sym) #'set-multi-message--wrapper)) + (t (set-default sym val))))) (unibyte-display-via-language-environment mule boolean) (blink-cursor-alist cursor alist "22.1") (overline-margin display integer "22.1")