From: John Wiegley <jwiegley@gmail.com>
To: Artur Malabarba <bruce.connor.am@gmail.com>
Cc: Oleh <ohwoeowho@gmail.com>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: Redirecting messages
Date: Fri, 06 Nov 2015 16:55:50 -0500 [thread overview]
Message-ID: <m2h9ky7t53.fsf@newartisans.com> (raw)
In-Reply-To: <CAAdUY-LP6FvcVV6hQQR1WTg1m9kx5rO6Z=KZGYQteM2EoiAKyw@mail.gmail.com> (Artur Malabarba's message of "Fri, 6 Nov 2015 09:23:49 +0000")
>>>>> Artur Malabarba <bruce.connor.am@gmail.com> writes:
> 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
Maybe we can do something even simpler:
1. Rename `message' to `message-echo-area'.
2. (defalias 'message 'alert)
3. alert's default severity is `normal'.
4. Have alert's default behavior for `normal' be to call `message-echo-area'
(i.e., don't log to *Alerts*, don't do anything else).
5. Optionally, inject a :file parameter to `alert' (as a hack) to identify
which Elisp file the alert came from.
Alternatively, we could provide a general mechanism allowing Elisp
functions to determine the file/line/feature of the function that called
them (when such information is available). Maybe this already exists?
6. Document how to enable different backends at higher severities. Or,
default to message+log for such messages, but with a bold color, and so
they also appear in *Alerts* with a timestamp.
This gives us, for the default case, the same behavior we have today. Users
can then choose different backends for different scenarios, such as matching
on regexp, or by severity, to get rich notifications as they wish.
In the future it would be nice if package authors provided more metadata, but
this might not be necessary if we have regexps and know the source location.
John
prev parent reply other threads:[~2015-11-06 21:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-06 9:23 Redirecting messages (was: Proposed new core library: alert.el) Artur Malabarba
2015-11-06 9:31 ` Daniel Colascione
2015-11-06 21:54 ` File-handle streams (was: Redirecting messages) John Wiegley
2015-11-06 9:38 ` Redirecting messages Rasmus
2015-11-06 20:48 ` John Wiegley
2015-11-06 15:57 ` John Wiegley
2015-11-07 1:23 ` raman
2015-11-06 21:55 ` John Wiegley [this message]
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=m2h9ky7t53.fsf@newartisans.com \
--to=jwiegley@gmail.com \
--cc=bruce.connor.am@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=ohwoeowho@gmail.com \
/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.