From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.devel Subject: Re: Renaming non-X x_* procedures in xdisp.c (and elsewhere) Date: Sun, 24 Mar 2019 23:01:09 +0700 Message-ID: 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> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="96618"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Eli Zaretskii , Paul Eggert , Emacs developers To: Alex Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 24 17:03:06 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 1h85aU-000P0Y-Lz for ged-emacs-devel@m.gmane.org; Sun, 24 Mar 2019 17:03:06 +0100 Original-Received: from localhost ([127.0.0.1]:57913 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h85aT-0005kw-IZ for ged-emacs-devel@m.gmane.org; Sun, 24 Mar 2019 12:03:05 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h85Z7-0005VJ-3V for emacs-devel@gnu.org; Sun, 24 Mar 2019 12:01:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h85Z5-0003mY-Up for emacs-devel@gnu.org; Sun, 24 Mar 2019 12:01:41 -0400 Original-Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]:41345) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h85Yz-0003Zx-Aw; Sun, 24 Mar 2019 12:01:35 -0400 Original-Received: by mail-ot1-x331.google.com with SMTP id 64so5913738otb.8; Sun, 24 Mar 2019 09:01:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3DWVN9f67IZ3h8QTeXYdXP4wVWyjtiymPSowrsoLgDE=; b=qkWZAZ1aJC0K4Wxe4Z6UhGiWJ2bQ/oHXZN/52nkH6VZQfXrLzBusDfxiRYtTnVu9R3 N4VkQnH8Iwo2MlGIIsfEURPq5P+1rqc++P7wgrJ6z+9NNCrAdOOa9HT8Z13UVxsmwJ6P 4o+V0UpubWQFdJP7naHNHG7gmi3T/lLmcCQYV5chSg8QZf3/EXOiZe1lE6K5Kx9wJA/0 8IqdhwUeYMJWXho5ChKL3saKVssn4RSF8cVaW/YOXVrE6+zNm7Y7KOOMGV4jBNWiecFd tJ4oxd5AZskQ6aVgXHj67Pea/CiYoDnuX8qtPRWuPNIg1sJf6NQT1oTVnp5vJAwPRj5g KH5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3DWVN9f67IZ3h8QTeXYdXP4wVWyjtiymPSowrsoLgDE=; b=iBiCatHQ3XdNd6qK6mBZDPHEyxnIga2MPLX9met4gYKbkdu8M5V85myyZO8fmSXPza pTCDfuqRSDTa2r3vX/4YELXolcDaHhu3ZoOrM/aVnIGh1Ez9iqMKS3JfZYNOYUjHj3vo 15VmvXaQ6Itb7Nfd+wo+U5spf6YVeNIe6se5Ha6wwqi9lo4caxk+0FQRI3isAY0xAvj6 HXt4qhiLA6uiRwhDcxHQpjId12Iqp+1yTgSovlyCmpUDcOXVNtb8YgNPrPCPjmR6s5hZ 5h8Fe3YuI5wizld3QrH4W2udycZMxPX0QhzOFYj88GvWtQKHcL/Bh4YSc6l9udmuK2UD L33w== X-Gm-Message-State: APjAAAV5iB/TVX0AfKntX+Y5MJ7hiCikuHcJdmcJHgJrZ96QgjYQkUsk 1v4Ne4/o1W62DRFL8uSR9bsUr7An0d83vr1ah9g= X-Google-Smtp-Source: APXvYqxupYvDYa0fjuFpwf9jCapFIQV5zjFULkUvsTNUhouUmoPbR7Rb6Rks2r3pCuv43Z82GJn+02M95gZ7CXhd/vY= X-Received: by 2002:a9d:69:: with SMTP id 96mr14949269ota.186.1553443282606; Sun, 24 Mar 2019 09:01:22 -0700 (PDT) In-Reply-To: <87k1goqpnn.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::331 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:234683 Archived-At: On Sun, Mar 24, 2019 at 10:07 PM Alex wrote: > This would be used wherever some generic procedure needed to call a > windowing system-specific procedure. Come on, this is a typical and solved design problem. The usual solution is called polymorphism or virtual methods, does not require a (macro-masked) switch statement at each call site, is quite possible in C and not only OOP languages, and is used in Emacs in at least a few places (terminals come to mind). 1: The generic part defines function pointer types for each WS-specific function. 2: The generic part also defines a structure type whose members are of function pointer types defined in step 1. 3: Each WS-specific part defines implementations for each WS-specific function, with its own name prefix, following signatures defined in step 1. 4: Each WS-specific part defines a global structure of type defined in step 2 and fills it out with pointers to implementations defined in step 3. 5: The structure defined in step 4 is either global (for a single-windowing-system build) or gets passed around (for a multiple-window-system build).