all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: emacs-devel@gnu.org
Subject: Re: Proposed new core library: alert.el
Date: Fri, 06 Nov 2015 10:32:33 -0500	[thread overview]
Message-ID: <87bnb716um.fsf@lifelogs.com> (raw)
In-Reply-To: 83a8qrsatb.fsf@gnu.org

On Fri, 06 Nov 2015 12:04:48 +0200 Eli Zaretskii <eliz@gnu.org> wrote: 

EZ> I think it would make sense to provide an intermediate
EZ> platform-independent layer for displaying alerts

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.

So before I jump to implementation, this is the design I'm considering:

1) make a new `message-handler' buffer-local variable, default to nil, customizable
1.1) maybe buffer local is not necessary?  I'm not sure what's best.

2) users and packages can override `message-handler' as needed:
    (setq message-handler 'alert-message-handler)

3) in the C code, `editfns.c:Fmessage' will check for `message-handler'
and if it exists, simply call it with all the parameters and exit

4) the handlers do not have to preserve the `message' specific behavior,
as shown in its docstring, e.g. printing to STDERR in batch mode or
clearing an existing message when passed nil.

Once that piece is done, alert.el can be adjusted as needed; the
metadata passing is the major piece missing.  Sounds good?

On Thu, 05 Nov 2015 17:47:18 -0800 raman <raman@google.com> wrote: 

r> You could do this seamlessly by attaching an around advice to message
r> and having that call alert

We could, but won't :)

Ted




  reply	other threads:[~2015-11-06 15:32 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-05  2:05 Proposed new core library: alert.el John Wiegley
2015-11-05  9:14 ` Artur Malabarba
2015-11-05  9:21 ` Nicolas Petton
2015-11-05 11:39   ` Sven Axelsson
2015-11-05 16:09     ` Random832
2015-11-05 16:24 ` raman
2015-11-05 16:33 ` Vivek Dasmohapatra
2015-11-05 17:09   ` joakim
2015-11-05 17:09   ` Juanma Barranquero
2015-11-05 18:21   ` John Wiegley
2015-11-06 22:31     ` T.V Raman
2015-11-06 21:38   ` Richard Stallman
2015-11-07 13:20     ` Ted Zlatanov
2015-11-07 13:39       ` Artur Malabarba
2015-11-05 19:48 ` Ted Zlatanov
2015-11-05 20:03   ` John Wiegley
2015-11-05 20:23     ` Ted Zlatanov
2015-11-05 20:33       ` John Wiegley
2015-11-05 22:24         ` Bozhidar Batsov
2015-11-06 10:04         ` Eli Zaretskii
2015-11-06 15:32           ` Ted Zlatanov [this message]
2015-11-06 15:52             ` Eli Zaretskii
2015-11-06 16:01               ` Artur Malabarba
2015-11-06 16:20               ` Ted Zlatanov
2015-11-06 17:56                 ` Artur Malabarba
2015-11-06 18:10                   ` message-function (was: Proposed new core library: alert.el) Ted Zlatanov
2015-11-06 19:03                     ` Artur Malabarba
2015-11-07 13:31                       ` Artur Malabarba
2015-11-07 13:39                         ` message-function Ted Zlatanov
2015-11-06 21:20                 ` Proposed new core library: alert.el John Wiegley
2015-11-07 13:26                   ` Artur Malabarba
2015-11-07 10:40             ` Elias Mårtenson
     [not found]             ` <m2io5e6d39.fsf@newartisans.com>
2015-11-07 12:28               ` Ted Zlatanov
2015-11-07 13:09                 ` Artur Malabarba
2015-11-07 13:44                   ` Ted Zlatanov
2015-11-08 20:49                     ` Ted Zlatanov
2015-11-09  0:03                       ` Artur Malabarba
2015-11-09 21:50                 ` John Wiegley
2015-11-10 18:34                   ` Posting new feature proposals on the wiki? (was: Re: Proposed new core library: alert.el) Nicolas Petton
2015-11-10 18:40                     ` Posting new feature proposals on the wiki? John Wiegley
2015-11-11 16:14                     ` raman
2015-11-11 16:43                       ` John Wiegley
2015-11-11 17:35                         ` T.V Raman
2015-11-11 23:27                           ` Richard Stallman
2015-11-11 23:40                             ` T.V Raman
2015-11-12 11:16                               ` Artur Malabarba
2015-11-12 16:40                                 ` T.V Raman
2015-11-12 22:34                               ` Richard Stallman
2015-11-16 16:52                                 ` John Wiegley
2015-11-16 17:03                                   ` raman
2015-11-06 15:50           ` Proposed new core library: alert.el John Wiegley
2015-11-06  1:47     ` raman
2015-11-06  2:16       ` John Wiegley
2015-11-06  9:47         ` Rasmus
2015-11-06 10:42           ` Artur Malabarba
2015-11-06 11:27             ` Xue Fuqiao
2015-11-06  9:50         ` Juanma Barranquero
2015-11-06 10:07           ` Eli Zaretskii
2015-11-06 13:59             ` Stefan Monnier
2015-11-06 16:12         ` raman
2015-11-06 16:13           ` John Wiegley
2015-11-06 17:22             ` T.V Raman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bnb716um.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.