From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r102057: Make all 3 copies of x-select-enable-clipboard have the same doc. Date: Mon, 25 Oct 2010 04:20:15 -0400 Message-ID: References: <19651.37838.815906.240014@fencepost.gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1287996827 26363 80.91.229.12 (25 Oct 2010 08:53:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 25 Oct 2010 08:53:47 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 25 10:53:44 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PAIoK-00053g-3A for ged-emacs-devel@m.gmane.org; Mon, 25 Oct 2010 10:53:44 +0200 Original-Received: from localhost ([127.0.0.1]:43532 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PAIgx-00030J-06 for ged-emacs-devel@m.gmane.org; Mon, 25 Oct 2010 04:46:07 -0400 Original-Received: from [140.186.70.92] (port=57889 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PAIQM-00083h-1d for emacs-devel@gnu.org; Mon, 25 Oct 2010 04:29:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PAIHw-0006tM-DU for emacs-devel@gnu.org; Mon, 25 Oct 2010 04:20:18 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]:33735) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PAIHw-0006tE-83 for emacs-devel@gnu.org; Mon, 25 Oct 2010 04:20:16 -0400 Original-Received: from eliz by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1PAIHv-0006O9-L9; Mon, 25 Oct 2010 04:20:15 -0400 In-reply-to: (message from Glenn Morris on Mon, 25 Oct 2010 00:56:56 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:132082 Archived-At: > Cc: Eli Zaretskii , emacs-devel@gnu.org > From: Glenn Morris > Date: Mon, 25 Oct 2010 00:56:56 -0400 > > I find it weird that when faced with the issue "we need to define a > function, eg x-display-list, on multiple platforms; it should have the > same arguments, doc-string, and behaviour on each platform" that Emacs > consistently chose to have three completely separate definitions in > three separate files; rather than just having one with #ifdefs for > each platform where needed. > > Does anyone know what the reason for this design choice was? It's not a conscious design choice, just a historical accident. > Was it just that each port was developed independently by copying > the X files and modifying them, and nobody ever merged them? Yes. Also because the original X-centric design never bothered to separate the parts which are specific to X from purely Emacs internals. This made copy/paste job much easier than the refactoring required for adding yet another windowing backend. Btw, "nobody ever merged them" is not entirely true. Over the years, several such merges were done; as result, we now have menu.c where previously there were only xmenu.c and w32menu.c, and also several functions were moved from xterm.c/w32term.c to xdisp.c. So it's more accurate to say that the merge was never completed. In my experience, most of the job that's left should start by defining portable (and opaque, as far as possible) data types, and portable wrapper functions, that will have different definitions on different platforms. If this is done well, the rest should be almost a mechanical job. > Or is/was there some advantage to this duplication? No advantages; only disadvantages.