emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: input-pending-p after make-frame-visible


From: Aaron Jensen
Subject: Re: input-pending-p after make-frame-visible
Date: Thu, 21 Oct 2021 16:27:54 -0400

On Thu, Oct 21, 2021 at 2:04 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Aaron Jensen <aaronjensen@gmail.com>
> > Date: Thu, 21 Oct 2021 13:46:47 -0400
> > Cc: martin rudalics <rudalics@gmx.at>, Alan Third <alan@idiocy.org>,
> >  Gregory Heytings <gregory@heytings.org>,
> >  YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>, emacs-devel@gnu.org
> >
> > Right, READABLE_EVENTS_FILTER_EVENTS does not (and should not)
> > indicate that it is only used from input-pending-p.
>
> Does not: agree.  Should not: why?  If we decide that this is its only
> purpose, why shouldn't limit its use to that caller only?

It's a general principle that that I try to adhere to -- name things
for what they do, rather than their use case. We cannot imagine all of
the use cases that may come in the future and someone else may want to
use readable events with non-input events filtered. If it was named
after input-pending-p, they could either use it anyway and create
confusing code, or rename it back to what it was, or rewrite it. Also,
a reader of the code would no longer get any hints as to what the flag
does from its name. Whereas if it were named after what it did they
can always grep to find its uses -- no information is lost. If
anything, I would suggest renaming it to
READABLE_EVENTS_FILTER_NON_INPUT_EVENTS to go along with the
non-input-events variable.

I'm not here to enforce my norms onto Emacs though, I will conform
with Emacs norms.

> Well, one solution could be renaming the flag, or documenting that it
> must not be used by any caller except input-pending-p.

Documentation seems like it could be useful, would you want it to say
it can't be used by anything but input-pending-p or that it is
currently only used by it?

Does the rest of the plan seem reasonable to you?

Thanks,

Aaron



reply via email to

[Prev in Thread] Current Thread [Next in Thread]