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.devel Subject: Re: Adding olivetti to GNU ELPA Date: Tue, 14 May 2019 23:56:24 +0200 Message-ID: <87a7fohf93.fsf@fastmail.fm> References: <83tvemzcn2.fsf@gnu.org> <9bb5fc63-61ae-44dc-a8d5-b67803eab1e5@www.fastmail.com> <83h8amz24g.fsf@gnu.org> <24cca761-36ea-4c16-bce1-e3651aad52c8@www.fastmail.com> <83ftq6yx5o.fsf@gnu.org> <83ftppii16.fsf@gnu.org> <875d1b0c-7f44-ba5d-4660-84637533b8f3@gmx.at> <877eat58ec.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="248771"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: mu4e 1.3.2; emacs 26.2 Cc: martin rudalics , Eli Zaretskii To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 14 23:57:13 2019 Return-path: Envelope-to: ged-emacs-devel@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 1hQfQ8-0012ZZ-7J for ged-emacs-devel@m.gmane.org; Tue, 14 May 2019 23:57:13 +0200 Original-Received: from localhost ([127.0.0.1]:55451 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQfQ7-0006uq-8i for ged-emacs-devel@m.gmane.org; Tue, 14 May 2019 17:57:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQfPZ-0006uZ-RI for emacs-devel@gnu.org; Tue, 14 May 2019 17:56:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQfPY-000222-PC for emacs-devel@gnu.org; Tue, 14 May 2019 17:56:37 -0400 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]:38061) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQfPT-0001vU-P9; Tue, 14 May 2019 17:56:31 -0400 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 04C8321B4C; Tue, 14 May 2019 17:56:31 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 14 May 2019 17:56:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= references:from:to:cc:subject:in-reply-to:date:message-id :mime-version:content-type; s=fm3; bh=Z78G0K32okti2ibrTf6XHT+zKs XSWmf/W8X9HX3aPmo=; b=kzvhrLYxyxXlzdNzdTAKSTrnlu8kGkKKDKuppynZ6F HW+zlvjkebkWQTcX9c1XdjDsbjYNP/O+jIsU56kXpF33H/dRKv1jDS2KCF0wl02W F8/DWc53YOvJ5isvjAO5BQEnbxBbi0M5e9ihJ1TsH8C3sI2IpJEhCSer2lsSmIwx CW5uysOftD7W/gyFwlt3gYUp1HZki0beBU9M4m9aNxjv4vL/mXwJhB3hldSsov5x X8zu9FPdcPNg5jwOcaQD3JNwyQv8MWyUx0UrW6lSAsZ3ev8o1GvH3Kb/bnzY4Xqw ULT60/75q9Lbnal5nmWw7O6owKV4RDmSjWjI7agRH0jg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=Z78G0K 32okti2ibrTf6XHT+zKsXSWmf/W8X9HX3aPmo=; b=PQ4KpCzN2LqAjvXowh5ELK uQ7TcuFALwPe7Kl3v+SeLck2wfHKolXa0b8egItCIgpVPQ9SnaAJ34JYVxTnXCnX 5nswybNKI9+6Gc1HL3f/lH0QBIVV0BKhnvAuWm+0RBGDVaj31kKx6IV36M0sgchF pP3zm+y6NS2hkXSa0yzU/enePah+w/tecaU+OLTqjkBDDY9r9kuwLVlcMHkEya1n eBA5KFiogVUpX6CBwfCfXLRxsPDuPlL1uaZNLX9Xnye/sJrtsXXPSchcSMCh2Ddp zGAK6WbVVhdKLShT9hLsQA7WOLkAA6czDRIp4ZeC6icWYtk/Prdex1WGPUJpCopg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrleejgddtfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpehffgfhvffujgffkfggtgesthdtredttdertdenucfhrhhomheplfhoohhsthcu mfhrvghmvghrshcuoehjohhoshhtkhhrvghmvghrshesfhgrshhtmhgrihhlrdhfmheqne cukfhppeegiedrudekledrvdekrdehkeenucfrrghrrghmpehmrghilhhfrhhomhepjhho ohhsthhkrhgvmhgvrhhssehfrghsthhmrghilhdrfhhmnecuvehluhhsthgvrhfuihiivg eptd X-ME-Proxy: Original-Received: from Swift.fastmail.com (unknown [46.189.28.58]) by mail.messagingengine.com (Postfix) with ESMTPA id AA8A610323; Tue, 14 May 2019 17:56:29 -0400 (EDT) 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: 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:236523 Archived-At: On Tue, May 14 2019, Stefan Monnier wrote: >> (defun visual-fill-column-mode--enable () >> "Set up `visual-fill-column-mode' for the current buffer." >> (add-hook 'window-configuration-change-hook >> #'visual-fill-column--adjust-window 'append 'local) >> (if (>= emacs-major-version 26) >> (add-hook 'window-size-change-functions >> #'visual-fill-column--adjust-frame 'append)) >> (visual-fill-column--adjust-window)) > > If you fundamentally only care about the size of the windows, Yes, specifically their width. > then in > Emacs-27 all you need is > > (add-hook 'window-size-change-functions > #'visual-fill-column--adjust-window 'append > 'local) > >> frame. In Emacs 27, this function must be in the global part of >> `window-size-change-functions`, > > Not really: in Emacs-26, if it's on the local-part of the hook, > then it > will fail to be called when your window's size is changed as > a side-effect of some other window being resized (this is fixed > in > Emacs-27). In Emacs-27, on the contrary it can be in the local > part of > the hook and can limit its action to the window passed as an > argument > rather than having to cycle through all windows on the selected > frame, > because the local part of the hook is run (separately) for every > window > whose size has changed. Ah, I see. The problem I ran into (and with prompted my remark above) was that in Emacs 26, the functions in window-size-change-functions are called with the frame as argument, even the functions in the local part of the hook. In Emacs 27, the functions in the global part are called with the frame as argument, while the functions in the local part are called with the window as argument. Since the function that `visual-fill-column-mode` puts in the hook assumes the frame as argument, the simplest change seemed to be to put it in the global part. It seems that wasn't the only solution, and arguably it's not the best solution either... I'll set up a VirtualBox so I can test it with Emacs 27 and make the change when I have some time. Thanks for the info. -- Joost Kremers Life has its moments