From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.devel Subject: `min-margins' window parameter. Date: Fri, 06 Nov 2020 13:37:24 +0100 Message-ID: <878sbevjtp.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24132"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.5.6; emacs 27.1.50 To: Emacs-Devel List Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 06 13:38:52 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kb112-0006C3-7t for ged-emacs-devel@m.gmane-mx.org; Fri, 06 Nov 2020 13:38:52 +0100 Original-Received: from localhost ([::1]:60812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kb111-00011u-Ab for ged-emacs-devel@m.gmane-mx.org; Fri, 06 Nov 2020 07:38:51 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kb0zj-00008R-5x for emacs-devel@gnu.org; Fri, 06 Nov 2020 07:37:31 -0500 Original-Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:60097) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kb0zg-000829-UV for emacs-devel@gnu.org; Fri, 06 Nov 2020 07:37:30 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 56D2B162A for ; Fri, 6 Nov 2020 07:37:27 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 06 Nov 2020 07:37:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= from:to:subject:message-id:date:mime-version:content-type; s= fm1; bh=PbHkNTK+gH5eW7i1KH1WZuthiYzHTDFs8vTnxyeknds=; b=FLtVtwkC mMp3uKtt5dbJdGKSS6WCt8v+dI11UqNkpj2T5V0BaZZxCixkO5Maan01Hy3/4jWX itooKty1a7w4i38F0BSt1LLCKaRS89pcOs3m36rnYSGsaGLgw76mIc4Ure4VA5JF 5oFsvBYVzPErGBcUFMwM1GRN7OeOA9JveFy8rhzitUVCbNNzJquHZFY9rQW19oXH rYyLHwUe7uhzaFfdpjqjMwdT1A2SKaanwMODW5bc1CuEB2Dom8D5HA5ISKAoEMPg Ph5Z8rWCWPwSs8++6UOA6gthPo7ikbU15wA34eUbGUrZouwbC0IBiNFzjawMnuj6 zNoawfiEhwSUSQ== 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=PbHkNTK+gH5eW7i1KH1WZuthiYzHT DFs8vTnxyeknds=; b=OdvWsSXKZd8T5uZYSADGYvoSCDKvOKzE51/A/lo3CKlVn /F1u23WJyf9fO6oPJJoULc/7M4w+LRzV+cPj5jJ6JmNcFLnHyhykUAEft15jNyOn IIyhiaDeoPyFWp03WXVIjmES1GgMEAzsfAdpqY85IaKpwxvxs8DuEDs+ggo2HKcj CD/wp6JEwp6mB5pG3IFCXkFgzEuVHB/6eKytDHCe4kMdJYyjkNt/Iren8/bqcjUQ aXFD50U5Ykl8LqXJ7069+BbiaArgdNIBARFQcNRFbJ8R1kDEKcXFb4cthWKSRGmi b0wUeS23YNVd3y7w/VGhfdd6LYfrLoqddOxZc38qQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddtledggeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfgfhvffukfffgggtsehttdertddtredtnecuhfhrohhmpeflohhoshhtucfm rhgvmhgvrhhsuceojhhoohhsthhkrhgvmhgvrhhssehfrghsthhmrghilhdrfhhmqeenuc ggtffrrghtthgvrhhnpeejkeekgeeifeeiheeufeelfffhgffhfeeuhedvuedutdejjedt veetgeekgfffgeenucffohhmrghinhepghhithhhuhgsrdgtohhmnecukfhppeelhedrle dtrddvvdegrddvfeefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomhepjhhoohhsthhkrhgvmhgvrhhssehfrghsthhmrghilhdrfhhm X-ME-Proxy: Original-Received: from Swift.fastmail.com (ip5f5ae0e9.dynamic.kabel-deutschland.de [95.90.224.233]) by mail.messagingengine.com (Postfix) with ESMTPA id 76E6832802F8 for ; Fri, 6 Nov 2020 07:37:26 -0500 (EST) Received-SPF: pass client-ip=64.147.123.19; envelope-from=joostkremers@fastmail.fm; helo=wout3-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/06 07:37:27 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:258810 Archived-At: Hi, In Emacs 25, the window parameter `min-margins' was added, after several discussions here and on bug-gnu-emacs about vertically splitting windows with wide margins. I've now finally started converting my code to use this parameter,[1] but it doesn't seem to be working as expected. When I invoke `C-x 3` (`split-window-right`) on a window with `visual-fill-column-mode` enabled, the split sometimes works as expected, but most of the time it doesn't. What I expect is for the window to be split in to side-by-side windows of equal size. What happens most of the time is that the window is split into two unevenly-sized windows, with the left window about as wide as the text area before the split and the right window taking up the rest of the original window. Twice during my tests Emacs actually hung, driving one of the CPU cores to 100%. I haven't been able to determine when the split works right and when it doesn't. It seems to be fairly random. Since all the relevant code runs during redisplay, Edebug doesn't seem to work. (At least ISTR that being the case.) The relevant code is here: https://github.com/joostkremers/visual-fill-column/tree/winparam Basically, what the code does is set the right margin of the window to some calculated width whenever the window size changes (i.e., whenever the hook `window-size-change-functions` is run). At the same time, the window parameter `min-margins` is set to `(0 . 0)` to allow splitting.[2] Is this the correct way of using the window parameter `min-margins`, or have I overlooked something? TIA Joost PS: I checked to see what `olivetti.el` does, but it still uses the workaround based on the `split-window` window parameter, that Martin Rudalics once suggested before `min-margins` was introduced. There seems to be a bug in this workaround, however, which prompted me to try the `min-margins` window parameter. Footnotes: [1] I maintain `visual-fill-column-mode` (https://github.com/joostkremers/visual-fill-column), which is a package that widens the right margin in a buffer so that the text is wrapped at `fill-column`. (It assumes that the buffer is using `visual-line-mode`.) [2] Well, actually it is set to whatever the width of the margins was before `visual-fill-column-mode` was invoked. -- Joost Kremers Life has its moments