From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: [PATCH 3/4] Implement cygw32 Date: Fri, 30 Dec 2011 01:36:03 -0800 Message-ID: <4EFD8603.3060402@dancol.org> References: <5624badc7ef2eea96f90da1a823144757a5f0290.1325166472.git.dancol@dancol.org> <83oburuvzt.fsf@gnu.org> <4EFCA8FF.5080200@dancol.org> <83fwg3uts8.fsf@gnu.org> <4EFCE0A8.1080305@dancol.org> <83zkeatnto.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig20970DDB3187246E5D1A43FD" X-Trace: dough.gmane.org 1325237785 22485 80.91.229.12 (30 Dec 2011 09:36:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 30 Dec 2011 09:36:25 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 30 10:36:21 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RgYst-0004IH-AK for ged-emacs-devel@m.gmane.org; Fri, 30 Dec 2011 10:36:19 +0100 Original-Received: from localhost ([::1]:59249 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgYss-00018X-SL for ged-emacs-devel@m.gmane.org; Fri, 30 Dec 2011 04:36:18 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:41599) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgYsp-00015x-KK for emacs-devel@gnu.org; Fri, 30 Dec 2011 04:36:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RgYso-00076A-5N for emacs-devel@gnu.org; Fri, 30 Dec 2011 04:36:15 -0500 Original-Received: from dancol.org ([96.126.100.184]:35874) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgYsl-00074n-NL; Fri, 30 Dec 2011 04:36:11 -0500 Original-Received: from c-24-18-179-193.hsd1.wa.comcast.net ([24.18.179.193] helo=[192.168.1.2]) by dancol.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1RgYsl-0001X4-0W; Fri, 30 Dec 2011 01:36:11 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0 In-Reply-To: <83zkeatnto.fsf@gnu.org> X-Enigmail-Version: 1.3.4 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 96.126.100.184 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:147041 Archived-At: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig20970DDB3187246E5D1A43FD Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12/30/11 1:23 AM, Eli Zaretskii wrote: >> Date: Thu, 29 Dec 2011 13:50:32 -0800 >> From: Daniel Colascione >> CC: emacs-devel@gnu.org >> >>>>>> - (if (eq system-type 'windows-nt) >>>>>> + (if (featurep 'w32) >>>>>> '(("iso8859-1" "ms-oemlatin") >>>>>> ("gb2312.1980" "gb2312" "gbk" "gb18030") >>>>>> ("jisx0208.1990" "jisx0208.1983" "jisx0208.1978") >>>>> >>>>> Why not use window-system (the function) here? >>>> >>>> Isn't it a little early for window-system at this point? >>> >>> A defcustom is evaluated more than once. So I'm a bit fuzzy about >>> "too early" ;-) >> >> When we initialize for the first time, we won't have a GUI frame to >> check, yes? (And then we dump the table into pure storage.) >=20 > In a release tarball, this first time is normally on a GNU/Linux box, > and so the w32-specific setting will never be chosen. >=20 > The important initialization is when the dumped Emacs is started on a > Windows system. At that time, we do have a GUI frame, I think. >=20 >> If there's >> no facility to force reevaluation of the mapping table, we'll end up >> using the wrong one when we *do* finally come up with a GUI frame. >=20 > But there _is_ such a facility: defcustoms are reevaluated upon > startup (and then again when you actually use "M-x customize", or have > custom-related forms in your .emacs). =20 ~/software/emacs/cyg.w32/src $ ./emacs --daemon ("./emacs") =2E.. Restarting server ~/software/emacs/cyg.w32/src $ cd ../lib-src/ ~/software/emacs/cyg.w32/lib-src $ ./emacsclient --eval '(emacs-version)' "GNU Emacs 24.0.92.71 (i686-pc-cygwin)\n of 2011-12-29 on dfaew" ~/software/emacs/cyg.w32/lib-src $ ./emacsclient --eval '(window-system)' nil ~/software/emacs/cyg.w32/lib-src $ ./emacsclient --eval 'window-system' nil ~/software/emacs/cyg.w32/lib-src $ ./emacsclient --eval "(featurep 'w32)" t > My point, however, is that it is a good idea to use window-system (the > function) where it could happen that different frames have different > types, in the current mult-tty Emacs. If nothing else, using > window-system consistently contributes to the clarity of the code and > shows the overall design to newcomers, who would otherwise become > confused if they see inconsistent tests in each and every place. I agree that using window-system where appropriate is best. That said, window-system isn't always appropriate. It answers the question "what window system am I using right now?". The featurep query answers "what window system is this copy of Emacs capable of using?". Sometimes, the latter question is of greater interest. --------------enig20970DDB3187246E5D1A43FD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) Comment: GPGTools - http://gpgtools.org iEYEARECAAYFAk79hgQACgkQ17c2LVA10VuU4QCgqIRC5fDGuhz3+gsrYGQyhCCM xxoAoIW6uLKX2bwlO7J40y5HjXB+adX9 =R7PE -----END PGP SIGNATURE----- --------------enig20970DDB3187246E5D1A43FD--