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: Fri, 31 Jan 2020 00:35:25 +0200 Organization: LINKOV.NET Message-ID: <87o8ukzjkq.fsf@mail.linkov.net> References: <87sgldfi9j.fsf@mail.linkov.net> <878sn3g0o7.fsf@gmail.com> <87pngepti3.fsf@mail.linkov.net> <878slrcibk.fsf@mail.linkov.net> <87pnf1navp.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="33146"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel@gnu.org, Eric S Fraga To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jan 31 00:03:26 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 1ixIqK-0008Ym-Ea for ged-emacs-devel@m.gmane-mx.org; Fri, 31 Jan 2020 00:03:24 +0100 Original-Received: from localhost ([::1]:40626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixIqJ-0001Cu-A0 for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Jan 2020 18:03:23 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33846) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixIpb-0008U9-6W for emacs-devel@gnu.org; Thu, 30 Jan 2020 18:02:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ixIpZ-0006wQ-Up for emacs-devel@gnu.org; Thu, 30 Jan 2020 18:02:38 -0500 Original-Received: from bumble.birch.relay.mailchannels.net ([23.83.209.25]:18756) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ixIpZ-0006sl-HX for emacs-devel@gnu.org; Thu, 30 Jan 2020 18:02:37 -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 A593C2C17DE; Thu, 30 Jan 2020 23:02:35 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a43.g.dreamhost.com (100-96-9-4.trex.outbound.svc.cluster.local [100.96.9.4]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id CA21C2C10E5; Thu, 30 Jan 2020 23:02:34 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a43.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); Thu, 30 Jan 2020 23:02:35 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Hook-Suffer: 5a925631500d0c08_1580425355117_3779747097 X-MC-Loop-Signature: 1580425355117:645441316 X-MC-Ingress-Time: 1580425355117 Original-Received: from pdx1-sub0-mail-a43.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a43.g.dreamhost.com (Postfix) with ESMTP id 7BF577F471; Thu, 30 Jan 2020 15:02:33 -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=BEpQ/l2g/EoS6Q2brZyNR0WjFhs=; b= yhxgDRBShhnSH0RaqAmE85BmDaCYWZLaD5jFYSImKhFjmPUg4dSEDj3rPUjPxvQY KVkZjeYbFeTii+2rNP2SvyWiV7a8sfJtkd9Xzh3H8B/tR1fimsyUs2Nwh7HN7j/+ +PmPrE7Ubnlsjqy7evVqIPuTAfzDAZ35FCzfH4/uSQk= 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-a43.g.dreamhost.com (Postfix) with ESMTPSA id A64617F470; Thu, 30 Jan 2020 15:02:30 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a43 In-Reply-To: (Stefan Monnier's message of "Wed, 29 Jan 2020 18:53:18 -0500") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedugedrfeelgddtudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddthedruddvieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddthedruddviedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehmohhnnhhivghrsehirhhordhumhhonhhtrhgvrghlrdgtrg X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 23.83.209.25 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:244780 Archived-At: >> 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. > > `(default-value sym)` should do the trick. Maybe I'm doing something wrong, but with the following patch it fails: Debugger entered--Lisp error: (void-variable v) (default-value v) (lambda nil (default-value v))() advice--add-function(:around ((lambda nil (default-value v)) lambda (gv--val) (set-default v gv--val)) set-multi-message--wrapper nil) (add-function :around (default-value sym) #'set-multi-message--wrapper) diff --git a/lisp/cus-start.el b/lisp/cus-start.el index e3dc6f03c4..ecfb2a63c1 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -646,6 +646,20 @@ minibuffer-prompt-properties--setter :format "%v") (other :tag "Unlimited" t)) "24.3") + (set-message-function + minibuffer (choice + (const :tag "No special handling" nil) + (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 (default-value 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")