From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alex Newsgroups: gmane.emacs.devel Subject: Re: Renaming non-X x_* procedures in xdisp.c (and elsewhere) Date: Sun, 24 Mar 2019 12:30:16 -0600 Message-ID: <87ftrcqg5j.fsf@gmail.com> References: <87wokp4okn.fsf@gmail.com> <83ef6xpo6b.fsf@gnu.org> <0f4be9a6-6e09-f55d-9f58-2a15aef264cd@cs.ucla.edu> <837ecpplw8.fsf@gnu.org> <871s2w510a.fsf@gmail.com> <922F9B91-2E9E-45F6-BB96-66CAE5E9FB81@gnu.org> <87k1goqpnn.fsf@gmail.com> <83imw8nspc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="193524"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 24 19:30:38 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 1h87tF-000oDk-PV for ged-emacs-devel@m.gmane.org; Sun, 24 Mar 2019 19:30:37 +0100 Original-Received: from localhost ([127.0.0.1]:59396 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h87tE-0002qi-Pq for ged-emacs-devel@m.gmane.org; Sun, 24 Mar 2019 14:30:36 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h87t4-0002qN-Tw for emacs-devel@gnu.org; Sun, 24 Mar 2019 14:30:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h87t3-0000H5-Qb for emacs-devel@gnu.org; Sun, 24 Mar 2019 14:30:26 -0400 Original-Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]:34498) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h87t2-0000Do-Pc; Sun, 24 Mar 2019 14:30:25 -0400 Original-Received: by mail-pf1-x42d.google.com with SMTP id b3so3406347pfd.1; Sun, 24 Mar 2019 11:30:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=vuxZqaSWKLscgyWZ04nMtI7P2gNemhk4RpiZfrjk4HU=; b=TDT+TGYVujA7wAYj5FIUTu+o/SlXuFKsYXBIqVsB0iYye69lGWuB/5zmYuJcquzeUO lm+S7BfUJQYPRkl2DFBBYYJtKWnIb+7ACJw7werQ8S/XpZB77XAo2qRV2e9TjR7SI4TA kWoU27vBvOG82rNoQ93G+vjTSNSaQqsSY/DdiTfdavefkX+suSEeKt7Tl1jY4nATZ7R5 72UBER42P6whOq3SolsAbyA1VLBH6XT4BGEgYO28vbV5wqK3Bog1NwU0Hqe703RufbFK qs4Cke3QJ3SvZhY3+NLAWx/dNuJKU4JVutkfCXUcCXVBaPQ5Kibgg7UyaO9+1QdmGktY xSMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=vuxZqaSWKLscgyWZ04nMtI7P2gNemhk4RpiZfrjk4HU=; b=sr8qaqjE27/dSGJZxNz+EQcgK/M/F1/99mFdw1DD5so4x6sFF2KnB1x8WJFlsrLgat Cqou2dqIIf5KIHVzkpichZ/PW/P/A0giAYrGQL5C/rKyamDyEJqS5ya79IRPxNVSMJMc rSqDQISuTdv9l+29Eg3z5yJgkyq+5QaFCTLhCbwxhISahA66oobMZlIZz+WgG6fYXYy7 IdhtLYRRJuPr0G9Swb057WMu5oiKlRsr2qGm5z6IUTcVTCtDl5I4X8wVyx8TNfbixHzh i4nsbAGSucf5EVNnk0aT5SuL7OMb4TlhTC9s9UHM9qExHQ1u5YCy2KOqgOP+iwNiUCYz TDJQ== X-Gm-Message-State: APjAAAXAzOHddL4qnPNZskCow7i2uh6du/y5om+h5W0ZSMw/DFNcbXS+ /US6lJEertceziLFqVsYAXxzHZEC X-Google-Smtp-Source: APXvYqy/QZiVCvy2tVDDsna62fu+oZJnTHew/Ie4DhPrrXJzygvMAgSHUPVIGvxVN+Do0WHvUQLZwA== X-Received: by 2002:a17:902:7247:: with SMTP id c7mr1687796pll.255.1553452220834; Sun, 24 Mar 2019 11:30:20 -0700 (PDT) Original-Received: from lylat ([2604:3d09:e380:2255:962f:b96:2aaf:c3d5]) by smtp.gmail.com with ESMTPSA id f192sm23456217pfc.180.2019.03.24.11.30.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 24 Mar 2019 11:30:20 -0700 (PDT) In-Reply-To: <83imw8nspc.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 24 Mar 2019 18:27:27 +0200") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42d 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:234689 Archived-At: Eli Zaretskii 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?