From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Is it ok to use (redisplay), or should this be left to the experts? Date: Thu, 10 Jan 2019 21:43:44 +0100 Message-ID: <871s5ktf9b.fsf@fastmail.fm> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: blaine.gmane.org 1547152948 9760 195.159.176.226 (10 Jan 2019 20:42:28 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 10 Jan 2019 20:42:28 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 26.1 To: Help Gnu Emacs mailing list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 10 21:42:24 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 esmtp (Exim 4.84_2) (envelope-from ) id 1ghh9j-0002QZ-4o for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Jan 2019 21:42:24 +0100 Original-Received: from localhost ([127.0.0.1]:55090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghhBp-0004iZ-OM for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Jan 2019 15:44:33 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghhB9-0004he-Mp for help-gnu-emacs@gnu.org; Thu, 10 Jan 2019 15:43:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghhB8-0002JW-R7 for help-gnu-emacs@gnu.org; Thu, 10 Jan 2019 15:43:51 -0500 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:50531) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghhB8-0002Ic-E2 for help-gnu-emacs@gnu.org; Thu, 10 Jan 2019 15:43:50 -0500 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 8B0D11645 for ; Thu, 10 Jan 2019 15:43:47 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 10 Jan 2019 15:43:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= from:to:subject:date:message-id:mime-version:content-type; s= fm2; bh=AUusmGco1oaGBa1kVePW6vwwnRIteJv5+ZGlLx/INUw=; b=EoxcCijX KHe3E0/JvQ3Lb2wuu+ZSlcTo1w7DeLBZo03Mkr04liC8H7ksYO85oUzmaIlo107s Hqh/EMBg3iOpZPH3dpxrDG7MmA8K0Jz3welMbU/RxhrP7la6kcZ41/hqfbGrF7wT nugmLYXcBVXP0xOeFI+B2GGzQ/M5fD+odHznIohnG2DS/jiREtARVKXq4pUROG14 xWLyr0pS5Au5XYX/kwKeXuCzfawwbXbne04r58Hsab06LfJe8XDolehoH9P0I07w 63nor3RohtcQto5Ngk63hfqECd3u6Qct79riWB8L9w/g0yJNHeTJF/T6oHwFiJMF e1ozJ123K0B+8w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=AUusmGco1oaGBa1kVePW6vwwnRIte Jv5+ZGlLx/INUw=; b=oSU+yP/xmpn+ddrApvSfsNd4mwLp11Z0TdPyUYrSxdjHL Nm6f7RHokoCqmQgG5bEZ0hwMsxpO0U/zdi/l/jLXw/0PhX+IPEPy+3FddpiBe1m9 g3ElDu/lwvi6Ffxxu7SWTjB7X9X2RTluDlqGBf/8hZsRc4TESMOYxTtwP3OBzI8G Iym1qljBRxA2NeylvAY/wtXaoo3tEHB1bLNKZdqIdtWajo0VWoZnHXFapcVICkFZ twM0Jd0za/VH/fvu77NZdLkZsu8VzrF1jTeOmmkYjkzdYoDunfHBrfHnNR4wnC8r N28GSLVwsi2WZO1GpI47qagG8RH/1+mq3lk0K9FFQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtledrfeefgddugeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpegfhffvufffkf ggtgesthdtredttdertdenucfhrhhomheplfhoohhsthcumfhrvghmvghrshcuoehjohho shhtkhhrvghmvghrshesfhgrshhtmhgrihhlrdhfmheqnecuffhomhgrihhnpehgihhthh husgdrtghomhenucfkphepleegrddvvddtrdefhedrjeelnecurfgrrhgrmhepmhgrihhl fhhrohhmpehjohhoshhtkhhrvghmvghrshesfhgrshhtmhgrihhlrdhfmhenucevlhhush htvghrufhiiigvpedt X-ME-Proxy: Original-Received: from Swift.fastmail.com (dslb-094-220-035-079.094.220.pools.vodafone-ip.de [94.220.35.79]) by mail.messagingengine.com (Postfix) with ESMTPA id 78F77E40FF for ; Thu, 10 Jan 2019 15:43:46 -0500 (EST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 64.147.123.25 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:119104 Archived-At: Hi, I have a package for distraction-free writing[1], which, among other things, activates full screen and sets the text width to a user-defined value. There is an option to set the text width as a percentage of (window-total-width), which is now causing an issue, as reported by a user.[2] 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. This seems to be some sort of race condition, because adding (sleep-for 2) before calling (window-total-width) solves the issue. However, I don't want to force a one or two second wait on all my users just because in some conditions, on some system, there may be a race condition. (I can't reproduce the issue on my own computer, for example). It seems that a call to (redisplay) also does the trick, but I'm hesitant to add this, because, well, I'm not sure why, exactly, it's just that I'm not entirely sure when, i.e., in what circumstances, (redisplay) is meant to be used, what side effects to watch out for (in any), etc. So I guess what I'm asking is whether someone can tell me whether (redisplay) is the right way to deal with this issue, or whether there is a better way. Or perhaps the user is SOL and needs to do some local configuration to get things to behave? TIA Joost Footnotes: [1] https://github.com/joostkremers/writeroom-mode [2] https://github.com/joostkremers/writeroom-mode/issues/48 -- Joost Kremers Life has its moments