From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] emacs-26 e5471b2: Add commentary for subtle aspect of frame.el Date: Fri, 01 Jun 2018 16:30:55 -0400 Message-ID: References: <20180601123545.20823.3653@vcs0.savannah.gnu.org> <20180601123547.725252040B@vcs0.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1527884941 16473 195.159.176.226 (1 Jun 2018 20:29:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 1 Jun 2018 20:29:01 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Eli Zaretskii To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 01 22:28:57 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fOqfR-0004CL-IJ for ged-emacs-devel@m.gmane.org; Fri, 01 Jun 2018 22:28:57 +0200 Original-Received: from localhost ([::1]:57414 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOqhY-0007n1-OR for ged-emacs-devel@m.gmane.org; Fri, 01 Jun 2018 16:31:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56612) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOqhS-0007mt-FF for emacs-devel@gnu.org; Fri, 01 Jun 2018 16:31:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fOqhN-0008JN-Du for emacs-devel@gnu.org; Fri, 01 Jun 2018 16:31:02 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:39995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOqhN-0008Fx-8O; Fri, 01 Jun 2018 16:30:57 -0400 Original-Received: from lechazo.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.7/8.14.1) with ESMTP id w51KUtXe014283; Fri, 1 Jun 2018 16:30:56 -0400 Original-Received: by lechazo.home (Postfix, from userid 20848) id D2AE9605E4; Fri, 1 Jun 2018 16:30:55 -0400 (EDT) In-Reply-To: <20180601123547.725252040B@vcs0.savannah.gnu.org> (Eli Zaretskii's message of "Fri, 1 Jun 2018 08:35:47 -0400 (EDT)") X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 2 Rules triggered EDT_SA_DN_PASS=0, RV6299=0 X-NAI-Spam-Version: 2.3.0.9418 : core <6299> : inlines <6676> : streams <1788457> : uri <2651011> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:225900 Archived-At: > --- a/lisp/frame.el > +++ b/lisp/frame.el > @@ -2475,6 +2475,9 @@ See also `toggle-frame-maximized'." > ;; F5 then produces the correct effect, the variable doesn't need > ;; to be in this list; otherwise, it does. > (mapc (lambda (var) > + ;; Using symbol-function here tells the watcher machinery to > + ;; call the C function set-buffer-redisplay directly, thus > + ;; avoiding a potential GC. > (add-variable-watcher var (symbol-function 'set-buffer-redisplay))) > '(line-spacing > overline-margin I don't understand why triggering a GC when setting or let-binding those vars is something we worry about. Clearly, it's not a matter of correctness/safety: anyone can add GC-ing watchers to those vars and hence cause potential GCs at those points. But in terms of performance I don't see any significant difference either (if the GC doesn't happen there, it will happen right after that anyway). I don't actually have an objection to using (symbol-function 'set-buffer-redisplay), but I can't see any particular reason to do so, and the above comment doesn't clarify it either for me. What am I missing? Stefan