unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] trunk r117640: * keyboard.c (safe_run_hook_funcall): Avoid consing around
       [not found] <E1XE9Us-00047U-Id@vcs.savannah.gnu.org>
@ 2014-08-04  7:28 ` Stefan Monnier
  2014-08-04  8:28   ` Dmitry Antipov
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2014-08-04  7:28 UTC (permalink / raw)
  To: Dmitry Antipov; +Cc: emacs-devel

>  safe_run_hooks (Lisp_Object hook)
>  {
> -  /* FIXME: our `internal_condition_case' does not provide any way to pass data
> -     to its body or to its handlers other than via globals such as
> -     dynamically-bound variables ;-)  */
>    ptrdiff_t count = SPECPDL_INDEX ();
> +
>    specbind (Qinhibit_quit, hook);
> -
>    run_hook_with_args (1, &hook, safe_run_hook_funcall);
> -
>    unbind_to (count, Qnil);
>  }
 
You remove the comment but don't fix the code accordingly: if the FIXME
is not valid any more, than we should cleanly pass `hook' as argument
rather than let-binding it to inhibit-quit.


        Stefan



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

* Re: [Emacs-diffs] trunk r117640: * keyboard.c (safe_run_hook_funcall): Avoid consing around
  2014-08-04  7:28 ` [Emacs-diffs] trunk r117640: * keyboard.c (safe_run_hook_funcall): Avoid consing around Stefan Monnier
@ 2014-08-04  8:28   ` Dmitry Antipov
  2014-08-04 22:35     ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Antipov @ 2014-08-04  8:28 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

On 08/04/2014 11:28 AM, Stefan Monnier wrote:

> You remove the comment but don't fix the code accordingly: if the FIXME
> is not valid any more, than we should cleanly pass `hook' as argument
> rather than let-binding it to inhibit-quit.

Hm...isn't it required to bind inhibit-quit to non-nil value before running
hooks?

Dmitry




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

* Re: [Emacs-diffs] trunk r117640: * keyboard.c (safe_run_hook_funcall): Avoid consing around
  2014-08-04  8:28   ` Dmitry Antipov
@ 2014-08-04 22:35     ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2014-08-04 22:35 UTC (permalink / raw)
  To: Dmitry Antipov; +Cc: emacs-devel

>> You remove the comment but don't fix the code accordingly: if the FIXME
>> is not valid any more, than we should cleanly pass `hook' as argument
>> rather than let-binding it to inhibit-quit.
> Hm...isn't it required to bind inhibit-quit to non-nil value before running
> hooks?

Yes, binding it to a non-nil value is necessary.  But that doesn't mean
that hook needs to be passed via that dynamic var.


        Stefan



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

end of thread, other threads:[~2014-08-04 22:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <E1XE9Us-00047U-Id@vcs.savannah.gnu.org>
2014-08-04  7:28 ` [Emacs-diffs] trunk r117640: * keyboard.c (safe_run_hook_funcall): Avoid consing around Stefan Monnier
2014-08-04  8:28   ` Dmitry Antipov
2014-08-04 22:35     ` Stefan Monnier

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).