From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Adding olivetti to GNU ELPA Date: Wed, 08 May 2019 09:20:37 +0300 Message-ID: <83ftppii16.fsf@gnu.org> 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> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="109110"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: "Paul W. Rankin" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 08 08:26:52 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 1hOG2W-000SH8-3W for ged-emacs-devel@m.gmane.org; Wed, 08 May 2019 08:26:52 +0200 Original-Received: from localhost ([127.0.0.1]:60217 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOG2U-0003jC-UH for ged-emacs-devel@m.gmane.org; Wed, 08 May 2019 02:26:50 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:41131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOFwg-0005pN-LV for emacs-devel@gnu.org; Wed, 08 May 2019 02:20:51 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:45671) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOFwg-00017R-IN; Wed, 08 May 2019 02:20:50 -0400 Original-Received: from [176.228.60.248] (port=3127 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hOFwf-0004up-VW; Wed, 08 May 2019 02:20:50 -0400 In-reply-to: (hello@paulwrankin.com) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:236272 Archived-At: > From: "Paul W. Rankin" > Cc: emacs-devel@gnu.org > Date: Wed, 08 May 2019 14:07:24 +1000 > > I'm sorry to say but this goes a bit over my head... From Emacs 24 - 27 > there seem to be three hooks that have shifting/overlapping > capabilities. The hooks are: > > - window-configuration-change-hook > - post-command-hook > - window-size-change-functions > > When I first created the minor mode, window-configuration-change-hook > was enough for all situations I encountered. > > With the introduction of display-line-numbers-mode, Eli suggested I > change this to post-command-hook. This seemed not to cover a few window > resize events, so I added window-configuration-change-hook back, but > I've since received complaints from people experiencing laggy input, but > then also errors with Emacs 27.x. > > At this point I've become too confused to find an adequate solution > between the Three Hooks so I (and I'm sure those who use the minor mode) > would love if someone more familiar with the changing nature of the > Three Hooks could provide a solution... I agree that we have a royal mess with these hooks. And if you think the above 3 are all of it, then, unfortunately, they aren't: there are also pre-redisplay-functions and window-scroll-functions -- those may be necessary if your mode needs to pay attention to when the screen space used by line numbers changes, either because the buffer is scrolled past the point where the line numbers need more or less digits than before, or because the user customizes the line-number face in a way which changes the font used by the face, with your mode already active. I'd like to try to help you, but I'm not sure I understand the problem well enough. Are you asking whether what you did could be simplified by using less hooks? Or are you saying that the current code doesn't yet handle well some situations? In the latter case, could you please describe those problematic situations? > I *think* what is needed is a way to apply the hooks contingent on > emacs-major-version <= 24 and <= 25 or 26(?) and <= 27. Yes, and there's nothing wrong with that for a package that wants to support multiple Emacs versions. Thanks.