unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Alex <agrambot@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Renaming non-X x_* procedures in xdisp.c (and elsewhere)
Date: Sun, 24 Mar 2019 12:30:16 -0600	[thread overview]
Message-ID: <87ftrcqg5j.fsf@gmail.com> (raw)
In-Reply-To: <83imw8nspc.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 24 Mar 2019 18:27:27 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

> AFAICS, the vast majority of x_* functions defined in w32*.c and ns*.m
> are either static or used from other w32*.c/ns*.m files, i.e. by the
> same window-system back-end.  Those can be simply renamed into w32_*
> and ns_*, and that's it.

Sorry, I thought that most/all of the x_* were named that way due to
being used in generic places like image.c and frame.c since I
encountered a good few of them in those two files, but I guess it's good
that I was wrong here. I'll handle those first.

> 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?

> 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.

Where would be the best place to add the obsolete aliases? For example,
I'm not sure the best place to put the obsolete call for
x-stretch-cursor (now gui-stretch-cursor).

> Are there any other issues related to this that I missed?

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.

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?



  reply	other threads:[~2019-03-24 18:30 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-23 15:07 Renaming non-X x_* procedures in xdisp.c (and elsewhere) Alex
2019-03-23 15:38 ` Stefan Monnier
2019-03-23 16:10 ` Eli Zaretskii
2019-03-23 16:41   ` Paul Eggert
2019-03-23 16:59     ` Eli Zaretskii
2019-03-23 17:39       ` Alex
2019-03-23 17:54         ` Alex
2019-03-23 18:16         ` Eli Zaretskii
2019-03-23 18:55           ` Alex
2019-03-23 19:32             ` Eli Zaretskii
2019-03-24  4:14               ` Alex
2019-03-24  4:50       ` Alex
2019-03-24  5:39         ` Eli Zaretskii
2019-03-24 15:05           ` Alex
2019-03-24 16:01             ` Yuri Khan
2019-03-24 16:13               ` Eli Zaretskii
2019-03-24 17:03                 ` Eli Zaretskii
2019-03-24 16:27             ` Eli Zaretskii
2019-03-24 18:30               ` Alex [this message]
2019-03-24 18:48                 ` Eli Zaretskii
2019-03-25 19:21                   ` Alex
2019-03-30 10:07                     ` Eli Zaretskii
2019-03-30 17:26                       ` Alex
2019-03-30 17:40                         ` Eli Zaretskii
2019-03-30 17:59                           ` Alex
2019-03-30 18:55                             ` Eli Zaretskii
2019-03-30 23:27                               ` Alex
2019-03-31 14:52                                 ` Eli Zaretskii
2019-04-11 19:07                                   ` Alex
2019-04-12 19:03                                     ` Eli Zaretskii
2019-04-12 19:50                                       ` Alex Gramiak
2019-04-12 20:10                                         ` Eli Zaretskii
2019-04-13 16:26                                           ` Alex Gramiak
2019-04-13 17:20                                             ` Eli Zaretskii
2019-04-13 16:13                                   ` [PATCH] Renaming non-X x_* identifiers (was: Renaming non-X x_* procedures in xdisp.c (and elsewhere)) Alex Gramiak
2019-04-13 17:17                                     ` Eli Zaretskii
2019-04-13 18:43                                       ` [PATCH] Renaming non-X x_* identifiers Alex Gramiak
2019-04-13 19:00                                         ` Eli Zaretskii
2019-04-14  3:35                                           ` Alex Gramiak
2019-04-14 14:02                                             ` Eli Zaretskii
2019-04-14 15:57                                               ` Alex Gramiak
2019-04-14 16:10                                                 ` Eli Zaretskii
2019-04-14 17:34                                                   ` Alex Gramiak
2019-04-15 14:51                                                     ` Eli Zaretskii
2019-04-15 17:46                                                       ` Alex Gramiak
2019-04-15 18:43                                                         ` Eli Zaretskii
2019-04-16 16:24                                                           ` Alex Gramiak
2019-04-16 16:45                                                             ` Eli Zaretskii
2019-04-16 16:59                                                               ` Alex Gramiak
2019-04-16 17:04                                                                 ` Eli Zaretskii
2019-04-16 17:07                                                                   ` Alex Gramiak
2019-04-16 18:09                                                                     ` Eli Zaretskii
2019-04-24 19:40                                                                       ` Alex Gramiak
2019-04-25  5:25                                                                         ` Eli Zaretskii
2019-04-25  9:56                                                                           ` Eli Zaretskii
2019-04-25 14:50                                                                             ` Alex Gramiak
2019-04-25 15:04                                                                               ` Eli Zaretskii
2019-04-26  6:52                                                                                 ` Robert Pluim
2019-04-26  8:07                                                                                   ` Eli Zaretskii
2019-04-26 23:12                                                                                     ` Alex Gramiak
2019-04-15 22:01                                                       ` Stefan Monnier
2019-04-16  2:29                                                         ` Eli Zaretskii
2019-04-16 12:55                                                           ` Stefan Monnier
2019-04-16 14:58                                                             ` Eli Zaretskii
2019-04-14  3:47                                         ` Stefan Monnier
2019-04-27  1:53                                     ` Basil L. Contovounesios
2019-04-27  3:46                                       ` Alex Gramiak
2019-04-27 11:37                                         ` Basil L. Contovounesios

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=87ftrcqg5j.fsf@gmail.com \
    --to=agrambot@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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).