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: Proposal: window-system-version function Date: Tue, 22 May 2012 19:13:12 +0300 Message-ID: <83mx50xkh3.fsf@gnu.org> References: <4FBA4CF6.1030007@yandex.ru> <83zk91y08o.fsf@gnu.org> <4FBB2956.7000409@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1337703197 31905 80.91.229.3 (22 May 2012 16:13:17 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 22 May 2012 16:13:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: Dmitry Antipov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 22 18:13:17 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SWrhz-0005T1-L0 for ged-emacs-devel@m.gmane.org; Tue, 22 May 2012 18:13:15 +0200 Original-Received: from localhost ([::1]:39703 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWrhz-0005tm-4R for ged-emacs-devel@m.gmane.org; Tue, 22 May 2012 12:13:15 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:33308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWrhw-0005th-K1 for emacs-devel@gnu.org; Tue, 22 May 2012 12:13:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SWrhq-0008Vc-7V for emacs-devel@gnu.org; Tue, 22 May 2012 12:13:12 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:37859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SWrhp-0008VA-Vf for emacs-devel@gnu.org; Tue, 22 May 2012 12:13:06 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0M4F00800LYZ6X00@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Tue, 22 May 2012 19:13:03 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M4F007O9MDQVTB0@a-mtaout21.012.net.il>; Tue, 22 May 2012 19:13:02 +0300 (IDT) In-reply-to: <4FBB2956.7000409@yandex.ru> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:150608 Archived-At: > Date: Tue, 22 May 2012 09:51:18 +0400 > From: Dmitry Antipov > CC: emacs-devel@gnu.org This probably becomes a moot point, given Stefan's response, but... > On 05/21/2012 08:20 PM, Eli Zaretskii wrote: > > > Thanks. However, this change breaks backward compatibility. Perhaps > > it would be better to leave the variable alone, and _add_ the > > function; that would be backward-compatible. > > I fixed Lisp code in lisp/international/mule-diag.el and > lisp/textmodes/artist.el; not sure about external packages which > may also use it. I'm not sure either, but gray hair tells me they might. > Leaving the variable "as is" means that window-system-version > and (window-system-version) may have different values, which > is confusing. Not confusing at all, since we would deprecate the variable. But breaking working code over such a minor issue is not a good idea, IMO. > Ideally, window-system-version should be a frame-local > variable, but I'm wondering whether this is possible in Emacs. Yes, see "Frame Parameters". > >> +It's value is a number: > >> + - 0 for a termcap frame, > >> + - Major X protocol version for the frame on X display, > >> + - Major OS version for the frame on MS-Windows display, > >> + - 24 for the frame on direct-write MS-DOS display, > >> + - 10 for the frame on a GNUstep or Macintosh Cocoa display. > > > > This is inaccurate at least for MS-DOS and MS-Windows. Do we really > > want to document the precise meaning of the values here? Why is that > > important? > > I'm not sure about exact values on a systems beyond *nix, and I suppose > that every Lisp-visible function should be documented. I didn't mean not to document it. I meant to document it like this: Value is the version of the windowing system used for this frame, as a string. I think this is enough, since the number itself won't tell anything specific anyway. > >> +#ifdef HAVE_X_WINDOWS > >> + case output_x_window: > >> + return make_number (ProtocolVersion (FRAME_X_DISPLAY (f))); > >> +#endif > >> +#ifdef WINDOWSNT > >> + case output_w32: > >> + return make_number (w32_major_version); > >> +#endif > >> +#ifdef MSDOS > >> + case output_msdos_raw: > >> + return make_number (24); > >> +#endif > > > > The MSDOS build supports HAVE_X_WINDOWS as well, so HAVE_X_WINDOWS and > > MSDOS are not by themselves mutually exclusive. > > The cpp stuff above has no mutually exclusive paths (no #elif or so), > so it should work if both HAVE_X_WINDOWS and MSDOS are defined. Right, my bad. I've misread the code.