From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Benny Sum Newsgroups: gmane.emacs.help Subject: Re: Question on frame title Date: Fri, 16 Oct 2015 04:05:48 -0700 (PDT) Message-ID: <6070a8cb-fb0f-4986-836c-296b9b4fac5b@googlegroups.com> References: <87y4f4hwer.fsf@fastmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1444993889 5224 80.91.229.3 (16 Oct 2015 11:11:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Oct 2015 11:11:29 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Oct 16 13:11:28 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zn2ut-0008I4-AA for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Oct 2015 13:11:19 +0200 Original-Received: from localhost ([::1]:52749 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zn2us-0001j6-Nf for geh-help-gnu-emacs@m.gmane.org; Fri, 16 Oct 2015 07:11:18 -0400 X-Received: by 10.107.160.72 with SMTP id j69mr12423441ioe.7.1444993548862; Fri, 16 Oct 2015 04:05:48 -0700 (PDT) X-Received: by 10.50.66.205 with SMTP id h13mr85656igt.10.1444993548813; Fri, 16 Oct 2015 04:05:48 -0700 (PDT) Original-Path: usenet.stanford.edu!kq10no22061874igb.0!news-out.google.com!z4ni22710ign.0!nntp.google.com!kq10no22061871igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=137.254.4.13; posting-account=F4v_QgkAAABvIIcQiQPSwLKFL-kD1tbH Original-NNTP-Posting-Host: 137.254.4.13 User-Agent: G2/1.0 Injection-Date: Fri, 16 Oct 2015 11:05:48 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:215390 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:107674 Archived-At: On Thursday, October 15, 2015 at 1:51:21 PM UTC-4, Random832 wrote: > Random832 writes: > > This will re-execute the info-data command every time you switch > > buffers. If the command is expensive, you may want to store the value in > > a buffer-local variable. > > Actually it turns out it evaluates quite a bit more often than that. I > can't quite find the rhyme or reason to precisely when it gets evaluated. > > Fun little test script: > > (setq test-index 0) > (setq frame-title-format > '(:eval (format "frame-title-format evaluated %d times " > (setq test-index (1+ test-index))))) > > It gets evaluated when: > > - Changing buffers > - Changing windows > - (Yes, that's even when it's the same window, or the same buffer) > - (Even the minibuffer. Sometimes.) > - Activating the mark > - Deactivating the mark > - Clicking the mouse anywhere (and again on release) > > Probably best to try to get the value in a buffer-local variable. Yes, it is very slow. How do I get the value in a buffer-local variable?