all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Redirecting messages (was: Proposed new core library: alert.el)
@ 2015-11-06  9:23 Artur Malabarba
  2015-11-06  9:31 ` Daniel Colascione
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Artur Malabarba @ 2015-11-06  9:23 UTC (permalink / raw)
  To: emacs-devel; +Cc: Oleh

On 5 Nov 2015 7:48 pm, "Ted Zlatanov" <tzz@lifelogs.com> 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.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-11-07  1:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

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.