From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.devel Subject: Redirecting messages (was: Proposed new core library: alert.el) Date: Fri, 6 Nov 2015 09:23:49 +0000 Message-ID: Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1446801854 31931 80.91.229.3 (6 Nov 2015 09:24:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Nov 2015 09:24:14 +0000 (UTC) Cc: Oleh To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 06 10:24:10 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZudFi-0001WK-Oc for ged-emacs-devel@m.gmane.org; Fri, 06 Nov 2015 10:24:10 +0100 Original-Received: from localhost ([::1]:37541 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZudFi-0004ND-4G for ged-emacs-devel@m.gmane.org; Fri, 06 Nov 2015 04:24:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZudFP-0004Mw-N1 for emacs-devel@gnu.org; Fri, 06 Nov 2015 04:23:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZudFO-0003HS-QC for emacs-devel@gnu.org; Fri, 06 Nov 2015 04:23:51 -0500 Original-Received: from mail-lf0-x22b.google.com ([2a00:1450:4010:c07::22b]:35910) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZudFO-0003HO-Io for emacs-devel@gnu.org; Fri, 06 Nov 2015 04:23:50 -0500 Original-Received: by lfs39 with SMTP id 39so39359243lfs.3 for ; Fri, 06 Nov 2015 01:23:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:date:message-id:subject:from:to:cc :content-type; bh=fZatNpYXyv4uuOB/LEBe/GsNZFi+ew4AxZjLAHofYvA=; b=Qx3jdX4PJoP+RieC/75xexfb7ji9c2sqWUOJsPaLJrb3olSaJUdZlK6shsgSpwC0Nb U0snt4zmDcZHA2NA4kS420m4rlbig/bX/aPb2yJTfmAbebAIXpaTan3W9nLKtIuDhrns IiTOy9iAOjoErK8ajyv81xb3M7/P1uFgA7TMkiQFCRffYLZwrTAAtYyxHZHkrpttJ9XD rIy44FU8wH1Ztgs+Aul9kqBSzyFKBWxJF5PiJ1fHKOuDJEez4DdJLeZxrzwQMCQbxV2T u4mjOIDB1A659VLH2+0FRxouxOmJF6NMF2Bp/kIcvqsqd2EYI12/K48BJ6ZAK1sbYpS5 fH8A== X-Received: by 10.25.85.193 with SMTP id j184mr3689825lfb.2.1446801829852; Fri, 06 Nov 2015 01:23:49 -0800 (PST) Original-Received: by 10.112.63.70 with HTTP; Fri, 6 Nov 2015 01:23:49 -0800 (PST) X-Google-Sender-Auth: XUru_u3vxOBTUS3bg0YLnCoZhyE X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c07::22b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:193378 Archived-At: On 5 Nov 2015 7:48 pm, "Ted Zlatanov" wrote: > > Agreed. But if alert.el doesn't support it now, it should have a way to > replace `message' so rather than asking every package to change, the > user just customizes one thing globally. I don't think users will want to turn every single message into a desktop notification. The `message' function has always been a very non-intrusive approach, so it's used in very spammy ways sometimes. That said, a way of redirecting messages via some arbitrary function is something that would be nice to have, and it's been mentioned lately here. I think Stefan was pushing for this a bit, specially when Oleh implemented the new inhibit-messages variable. The right approach IMO is to 1. move the current message function to `message-echo-area' 2. define a variable called `message-function', whose default value is #'message-echo-area 3. redefine the `message' function to just call the value of `message-function' and then log the string to the *Messages* buffer I think this logging shouldn't be moved to a separate thing (like the echo-area) because there's already a variable called `message-log-max' to disable it, and because I think most uses of changing `message-function' will want to preserve the logging. One option is to say that the value returned by `message-function' will be logged to the `*Messages*' buffer, so the function can always return nil if it doesn't want logging. If we do this we should remove the inhibit-messages variable, since it's equivalent to binding message-function to #'ignore.