[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Message's text-properties in *Messages*

From: Stefan Monnier
Subject: Re: Message's text-properties in *Messages*
Date: Wed, 23 May 2018 13:41:36 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>> - Why would arbitrary Lisp code be dangerous (I understand that message_dolog
>>   can be called from within redisplay, but redisplay runs Elisp code
>>   at several places, so "from redisplay" doesn't inherently imply you
>>   can't run Elisp code).
> When Lisp code is called from redisplay, we always do that via
> safe_call.  Anything else is not safe, AFAIR.

I see.  This doesn't answer all the questions, tho:

- The current code still does

    call0 (intern ("messages-buffer-mode"));

  hence doesn't use safe_call here.  This is likely a bug (introduced
  when we added messages-buffer-mode) and it hasn't bitten us simply
  because it's run rarely enough (only after you kill the *Messages*
  buffer) and by default it probably doesn't do anything dangerous, so
  to trigger this bug, we'd need a "perfect storm" (i.e. set
  a nasty messages-buffer-mode-hook, then kill *Messages*, then arrange
  for the next message to come from within the redisplay code).

- AFAICT message_dolog avoids running before/after change functions, so
  the comment about the GC being sometimes called because we run
  before/after change hooks seems odd.

- If after/before change functions do end up called, are they really
  called via safe_call?  I don't see any trace of that.

- Would let-binding inhibit-foo-hooks good enough to avoid running
  Elisp code unsafely?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]