unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Juanma Barranquero <lekktu@gmail.com>
Cc: martin rudalics <rudalics@gmx.at>,
	Emacs developers <emacs-devel@gnu.org>
Subject: Re: Delayed warnings
Date: Mon, 21 Mar 2011 18:05:55 -0400	[thread overview]
Message-ID: <jwvipvcgmi5.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <AANLkTi=cwqUF-dmztDoKyHgUY-GFSFOXD+aLFV_sqqZ7@mail.gmail.com> (Juanma Barranquero's message of "Mon, 21 Mar 2011 21:19:29 +0100")

> Only I would process `display-delayed-warnings' in reverse, so C code
> can add with

>   Vdisplay_delayed_warnings = Fcons (..., Vdisplay_delayed_warnings);

> but the user still gets the warnings in order.

Or you could have your C code all `add-hook-once' on post-command-hook
which would be a new function that adds a function onto a hook such that
the function is only run once and then automatically removed.
Something like:

   (defun add-hook-once (hook function &optional append local)
     "Same as `add-hook', but FUN is only run once.
   Also contrary to `add-hook', this is not idempotent."
     ;; FIXME: need to check if `function' was already added to the hook.
     (let ((code (list 'lambda)))
       (setcdr code `(() (,function) (remove-hook ',hook ',code ',local)))
       (add-hook hook code append local)))


-- Stefan



  reply	other threads:[~2011-03-21 22:05 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-20  5:44 Delayed warnings Juanma Barranquero
2011-03-21  8:01 ` martin rudalics
2011-03-21 12:01   ` Juanma Barranquero
2011-03-21 13:17     ` martin rudalics
2011-03-21 13:43       ` Eli Zaretskii
2011-03-21 18:06         ` martin rudalics
2011-03-21 14:48       ` Juanma Barranquero
2011-03-21 18:06         ` martin rudalics
2011-03-21 20:19           ` Juanma Barranquero
2011-03-21 22:05             ` Stefan Monnier [this message]
2011-03-22  7:59               ` martin rudalics
2011-03-22 11:59               ` Juanma Barranquero
2011-03-23 13:50               ` Jeff Sparkes
2011-03-25 13:10               ` Juanma Barranquero
2011-04-27  0:55                 ` Juanma Barranquero
2011-04-27  3:05                   ` Eli Zaretskii
2011-04-27 11:27                     ` Juanma Barranquero
2011-04-27 17:32                   ` Stefan Monnier
2011-04-27 22:11                     ` Juanma Barranquero
2011-04-28  0:40                       ` Stefan Monnier
2011-04-28  0:59                         ` Juanma Barranquero
2011-04-28 15:26                           ` Stefan Monnier
2011-04-28 16:22                             ` Juanma Barranquero
2011-04-28 18:39                               ` Stefan Monnier
2011-05-08 17:58                               ` Chong Yidong
2011-05-08 18:43                                 ` Juanma Barranquero
2011-05-09 14:15                                   ` Stefan Monnier
2011-05-09 18:28                                   ` Richard Stallman
2011-03-22  7:58             ` martin rudalics
2011-03-22 12:04               ` Juanma Barranquero

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvipvcgmi5.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=lekktu@gmail.com \
    --cc=rudalics@gmx.at \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).