all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Noam Postavsky <npostavs@gmail.com>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: add-variable-watcher usage in lisp/frame.el
Date: Fri, 01 Jun 2018 12:31:22 +0200	[thread overview]
Message-ID: <87o9guu7b9.fsf@gmail.com> (raw)
In-Reply-To: <CAM-tV-_G=gRxft3=23u0jSwGQFBHh1TypL345viyYOMwT1Bu3g@mail.gmail.com> (Noam Postavsky's message of "Fri, 1 Jun 2018 05:55:46 -0400")

Noam Postavsky <npostavs@gmail.com> writes:

> On 1 June 2018 at 05:18, Robert Pluim <rpluim@gmail.com> wrote:
>> lisp/frame.el has:
>>
>> (mapc (lambda (var)
>>         (add-variable-watcher var (symbol-function 'set-buffer-redisplay)))
>
>> Not using symbol-function makes this output (set-buffer-redisplay)
>> instead, which I think looks better, Iʼm wondering why symbol-function
>> was used?
>
> Passing a subr object tells the variable watcher mechanism to call the
> C function directly (without a possible GC call), which is closer to
> what happened in Emacs 25 (see diff of [1: d3faef9bae]). I don't know
> that it's really needed in this case though.

Thanks for the explanation. By all means lets avoid adding potential GC to code
thatʼs not expecting it.

Robert



      reply	other threads:[~2018-06-01 10:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-01  9:18 add-variable-watcher usage in lisp/frame.el Robert Pluim
2018-06-01  9:55 ` Noam Postavsky
2018-06-01 10:31   ` Robert Pluim [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=87o9guu7b9.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=npostavs@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.