From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: Is it ok to use (redisplay), or should this be left to the experts? Date: Tue, 12 Feb 2019 00:27:09 +0100 Message-ID: <87va1pgb3m.fsf@fastmail.fm> References: <871s5ktf9b.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="58937"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: mu4e 1.1.0; emacs 26.1 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 12 00:27:41 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gtKzD-000FFE-KW for geh-help-gnu-emacs@m.gmane.org; Tue, 12 Feb 2019 00:27:40 +0100 Original-Received: from localhost ([127.0.0.1]:57877 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtKzC-0000Xj-Hk for geh-help-gnu-emacs@m.gmane.org; Mon, 11 Feb 2019 18:27:38 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:51855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gtKyz-0000Xa-R4 for help-gnu-emacs@gnu.org; Mon, 11 Feb 2019 18:27:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gtKyy-0003xh-88 for help-gnu-emacs@gnu.org; Mon, 11 Feb 2019 18:27:24 -0500 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:49421) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gtKyx-0003qN-Vp for help-gnu-emacs@gnu.org; Mon, 11 Feb 2019 18:27:24 -0500 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id B4C1720E89 for ; Mon, 11 Feb 2019 18:27:11 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 11 Feb 2019 18:27:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= references:from:to:subject:in-reply-to:date:message-id :mime-version:content-type; s=fm2; bh=kQgFWXLsobTqLi1xQNKO7IfGr4 fRQtkpBaODx7m6FU4=; b=G5xk/WM/YJOmToMVVfDTOCnYoVvQtNMGnrPrvOEwbD nCm8V9pKXFjHeDGn7sPgHbrNSr3/H12ynjOFzoRbCUd11inuKVGNz+Wuf0/gQ2Pf Nn5TUqU8dDGZy96JlaLUwuEuqkPITV4nqoHyWwMlgz8l+LYnKrzpWx8haRTLdM0b 18DNg2KFdspMiBfW6ZAK2SP43G1bmZOC1YRIGmWYRMZmCsm31wLpU2ebPUoe213s ugF+5xslUZGwhxzajb0qPadOm7P6IPpUFgATJct4TPmmuUmRhFiFwRNuwy1/2q2e 4V2atwMOOtYfLVQxci2zujYnKslOqs+6cfMjRN5advPw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=kQgFWX LsobTqLi1xQNKO7IfGr4fRQtkpBaODx7m6FU4=; b=AsTlKAz2coVtlyqLNUo7KS htKQOrMEqfmQO8DEWLUlcDXV93xBJ7hM85ceg4xwwKKaiLX+2sj/M0Nujdse0gQ0 S25lM56oW/140tDLDNwqV89QnizhFDMhmEspWjNl3zFXshCQFw/USmvV8prZDwL+ JzzwHNKIpTI+loqywbF5SUlfK78CkVj/420iYRZKFiZ4GQPtxWbBGBOi00WQZfzl MqVz72upqqZ5pbL+JW40njfXyVy+gmfIz8jqPNIWohgYYuQREEkv82YvBTi87F8v MT5sTpCH8wL8oQwnNMsc5MdxIvgg7oFyrr3eAa2dAM5r4S/nr77QGeRQso6UKM6g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledruddttddgtdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhepfhgfhffvufgjfffkgggtsehttdertddtredtnecuhfhrohhmpe flohhoshhtucfmrhgvmhgvrhhsuceojhhoohhsthhkrhgvmhgvrhhssehfrghsthhmrghi lhdrfhhmqeenucfkphepleehrdeltddrvddtuddrudegnecurfgrrhgrmhepmhgrihhlfh hrohhmpehjohhoshhtkhhrvghmvghrshesfhgrshhtmhgrihhlrdhfmhenucevlhhushht vghrufhiiigvpedt X-ME-Proxy: Original-Received: from Swift.fastmail.com (ip5f5ac90e.dynamic.kabel-deutschland.de [95.90.201.14]) by mail.messagingengine.com (Postfix) with ESMTPA id DBAF610288 for ; Mon, 11 Feb 2019 18:27:10 -0500 (EST) In-reply-to: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.26 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:119359 Archived-At: Hi Stefan, Sorry about the late reply... On Thu, Jan 10 2019, Stefan Monnier wrote: >> The problem is that although full screen is activated before >> calculating the >> text width, (window-total-width) still reports the window width >> that existed >> before full screen was activated. > > Adding a call to `redisplay` is fine to handle such cases. > This said, it may be insufficient (e.g. the window-manager may > actually > execute the full-screen request asynchronously). > > I think a better solution is to use window-size-change-functions > in > order to detect when the window-total-width changes and only > change the > text width at that point. The new text width only needs to be calculated once, so if I solve this with a function in `window-size-change-functions', the function would need to remove itself from that hook again. I guess it's feasible to call remove-hook inside the function, right? -- Joost Kremers Life has its moments