unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Paul W. Rankin" <hello@paulwrankin.com>
Cc: emacs-devel@gnu.org
Subject: Re: Adding olivetti to GNU ELPA
Date: Wed, 08 May 2019 09:20:37 +0300	[thread overview]
Message-ID: <83ftppii16.fsf@gnu.org> (raw)
In-Reply-To: <m28svhbncz.fsf@paulwrankin.com> (hello@paulwrankin.com)

> From: "Paul W. Rankin" <hello@paulwrankin.com>
> 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.



  reply	other threads:[~2019-05-08  6:20 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-25  8:32 Adding olivetti to GNU ELPA Paul W. Rankin
2019-04-25  8:56 ` Eli Zaretskii
2019-04-25 12:32   ` Paul W. Rankin
2019-04-25 12:43     ` Eli Zaretskii
2019-04-25 13:01       ` Paul W. Rankin
2019-04-25 14:30         ` Eli Zaretskii
2019-05-08  4:07           ` Paul W. Rankin
2019-05-08  6:20             ` Eli Zaretskii [this message]
2019-05-09  6:54               ` Paul W. Rankin
2019-05-09  7:53                 ` Eli Zaretskii
2019-05-09  8:14                 ` martin rudalics
2019-05-09 13:30                   ` Stefan Monnier
2019-05-10  8:00                     ` martin rudalics
2019-05-14  5:16                   ` Paul W. Rankin
2019-05-14  7:04                     ` Paul W. Rankin
2019-05-14 12:22                     ` Stefan Monnier
2019-05-15  8:26                       ` Paul W. Rankin
2019-05-14 16:05                     ` Joost Kremers
2019-05-14 16:50                       ` Stefan Monnier
2019-05-14 21:56                         ` Joost Kremers
2019-05-15  1:29                           ` Stefan Monnier
2019-05-20  8:24                     ` martin rudalics
2019-05-20 13:14                       ` Paul W. Rankin
2019-05-21  7:32                         ` martin rudalics
2019-05-21  7:38                           ` Paul W. Rankin
2019-05-21  7:45                             ` martin rudalics
2019-05-21  9:05                               ` Paul W. Rankin
2019-05-21 10:04                                 ` martin rudalics
2019-05-22  1:47                                   ` Paul W. Rankin
2019-05-22  8:32                                     ` martin rudalics
2019-05-22  9:14                                       ` Paul W. Rankin
2019-05-08 14:07             ` Stefan Monnier
2019-05-08 15:45             ` Stephen Leake
2019-05-08 17:50               ` Eli Zaretskii
2019-04-26  1:17   ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83ftppii16.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=hello@paulwrankin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).