[Top][All Lists]

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

Re: Renaming non-X x_* procedures in xdisp.c (and elsewhere)

From: Eli Zaretskii
Subject: Re: Renaming non-X x_* procedures in xdisp.c (and elsewhere)
Date: Sun, 24 Mar 2019 20:48:37 +0200

> From: Alex <address@hidden>
> Cc: address@hidden
> Date: Sun, 24 Mar 2019 12:30:16 -0600
> > The remaining small minority should probably simply be added to
> > redisplay_interface, and used as we do with the other functions
> > there.  Some of those are not literally "for redisplay", but I don't
> > think it matters too much.
> I would find it confusing for procedures not used for redisplay to be
> used in the RIF. If there turns out to be a sizeable group of related
> x_* procedures, what about adding a separate set of function pointers
> for them?

Maybe you are right.  How about making a list of those functions
first?  When I looked at them, my impression was that most of them
_are_ related to display, but maybe I was wrong.  We can decide once
we see the list.

> > The only remaining problem that I could spot is that there's a small
> > number of Lisp primitives named x-SOMETHING, which are implemented by
> > each GUI backend.  Example: x-display-pixel-width.  I think for now we
> > should leave those primitives alone without renaming, and only change
> > their implementation to call the x_*, w32_*, or ns_* functions for
> > each back-end.  Renaming of these primitives can be done as a separate
> > step, and we will have to decide on the name pattern (something like
> > "xw-SOMETHING, perhaps?), and add obsolete aliases for backward
> > compatibility.
> IMO it would be nicer to get rid of the `x' entirely, and go for `gui'
> as the generic prefix, and just `ns' and `w32' as the backend prefixes.

The xw-* thing has a precedent, though.  We use gui- for selections
and such likes, but xw- for the other kind.

> Where would be the best place to add the obsolete aliases?

lisp/term/common-win.el, perhaps?

> I noticed that several procedures in frame.c contained this comment:
> /* I think this should be done with a hook.  */
> Which seems to be from 1993. Do you agree with this? Several of the x_*
> could be turned into these hooks.

Almost all of them are x_* functions which are being taken care here
anyway.  The 2 remaining ones are related to moving the mouse pointer,
and should probably be handled in the same manner.

> P.S. I happen to have some code that refactors the tooltip code in
> xfns.c and w32fns.c (nsfns.c's is a bit too different, unfortunately)
> into generic procedures that call out to backend procedures. I figured
> that it would be nicer to create a new generic file guifns.c to host
> these generalizations rather than put them in a file like frame.c; would
> you rather not have such a new file?

I think frame.c is a better place.  That file is not too large, so
adding a couple of functions to its would be okay.  Tooltips are
frames, after all.


reply via email to

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