From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: Proposed new core library: alert.el Date: Sat, 07 Nov 2015 07:28:39 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87si4ixabs.fsf@lifelogs.com> References: <87io5g2po3.fsf@lifelogs.com> <87y4ec19gm.fsf@lifelogs.com> <83a8qrsatb.fsf@gnu.org> <87bnb716um.fsf@lifelogs.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1446899357 27773 80.91.229.3 (7 Nov 2015 12:29:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 Nov 2015 12:29:17 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 07 13:29: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 1Zv2c3-0002VT-J6 for ged-emacs-devel@m.gmane.org; Sat, 07 Nov 2015 13:28:55 +0100 Original-Received: from localhost ([::1]:43476 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zv2bx-0008Ox-R2 for ged-emacs-devel@m.gmane.org; Sat, 07 Nov 2015 07:28:49 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zv2bt-0008Or-UP for emacs-devel@gnu.org; Sat, 07 Nov 2015 07:28:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zv2bq-0004Jv-NW for emacs-devel@gnu.org; Sat, 07 Nov 2015 07:28:45 -0500 Original-Received: from mail-vk0-x233.google.com ([2607:f8b0:400c:c05::233]:33903) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zv2bq-0004Jr-Hs for emacs-devel@gnu.org; Sat, 07 Nov 2015 07:28:42 -0500 Original-Received: by vkgs66 with SMTP id s66so31342511vkg.1 for ; Sat, 07 Nov 2015 04:28:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lifelogs.com; s=google; h=from:to:subject:organization:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=qXaYG9+vI3dNCBtxCkoaIqwMQv6jltPojKCWcTOppqI=; b=LM7LBSYMMIoFdG+zfN+9o+g7vUp2ULj6ZNW0Irz2Nh7qa1ZdVMeMo/WwnFw4Stp+P+ 6WKbD4AQLN74Te2iQO4t1Vca/6YBgj4KjCUddzGrImEdGdkbJPijl4Bp8LlDXNXVWQ4j PRBY09vQtY8Auww4qIG198XwnKnTIc8GYNPZk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:organization:references:date :in-reply-to:message-id:user-agent:mime-version:content-type; bh=qXaYG9+vI3dNCBtxCkoaIqwMQv6jltPojKCWcTOppqI=; b=kj2Z52i/+7Ch95U9ZYkeLSIISE3ROfJoU5hh5gPUkh3Ao27+9lb5b5uq7mu1mP0oYQ FJajI2ZrIVU37zCBpcqC+ij9ux4OyV4X2JgO2tRDMfE6djON4J16ZUUHYaywvf1yh5sh BrlMm4OymN8vrQPyEx2HhtLgwBnvL4/lOR45jvu/9B7KCTiDq/pAzjgDZbwXyxy1rJoF nbmnfTZpeDXYbugH4ALWClZH3FXeXHaSXl4pFyZTez7Uqs+90ZiTfqvlWiE7wdmlyOJM ICa2SJMO7kYEIvqeq8oM1kG3B4ImInxvoO/eJb9ZcAZ2AlZJVlE7mKcUqhGwOb1UHOvl lDLw== X-Gm-Message-State: ALoCoQnr9oTMnjcdgwzY6Wiv/8ywq3pCe8GLjVjrMltRbsyQrnCkmB7RkxhpH1eiWA1hzRH9rf61 X-Received: by 10.31.157.75 with SMTP id g72mr19627977vke.153.1446899321462; Sat, 07 Nov 2015 04:28:41 -0800 (PST) Original-Received: from flea ([98.229.60.157]) by smtp.gmail.com with ESMTPSA id x200sm4017616vkd.17.2015.11.07.04.28.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Nov 2015 04:28:40 -0800 (PST) X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" In-Reply-To: (John Wiegley's message of "Fri, 06 Nov 2015 20:04:49 -0500") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400c:c05::233 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:193516 Archived-At: On Fri, 06 Nov 2015 20:04:49 -0500 "John Wiegley" wrote: >>>>>> Ted Zlatanov writes: >> Yes, this is simply a `message' call. I think the only thing missing is >> metadata and I would draw inspiration from syslog: level, facility, and >> tags. Then the *handler* should decide what to do with the message based on >> the metadata. >> I'm not sure how to provide the metadata, and it should be ignored by the >> default (current) message handler. Maybe it could be string properties >> applied to the first parameter? I *need* to know this before writing code. JW> Ted, I must have missed where this discussion about metadata came up. alert.el JW> already has a facility for passing and consuming metadata. Would there be a JW> need to consider another scheme also? OK, let me explain. Looking at alert.el. The severity is good, same as syslog. There is no facility or tags in alert.el (although I think :type and :category sort of map to those syslog terms). Most importantly, alert.el takes a plist, which is not compatible with `message'. To make it a standard interface, it should just take a string (with possibly some other parameters for `format'), hence my proposal to take the plist entries and pass them as string properties to the one required parameter. From alert.el, the work required would be to provide a `alert-message-handler' function which takes that string and converts it to the plist format. So (message "mystring-with-properties" x y z) where the string has properties :severity 'foo :facility 'bar would get eventually translated to an alert call that extracted the properties from "mystring-with-properties" to yield (alert "mystring-with-properties" :severity 'foo :type 'bar) I think the alternative would be to allow `message' to take a plist, which I don't think is as good, and would still require translation from `message' generic properties I hope that explains it. Ted