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.) > > In a release tarball, this first time is normally on a GNU/Linux box, > and so the w32-specific setting will never be chosen. > > 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. > >> 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. > > 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). ~/software/emacs/cyg.w32/src $ ./emacs --daemon ("./emacs") ... 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.