help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using the same custom file in two different OSes


From: Eli Zaretskii
Subject: Re: Using the same custom file in two different OSes
Date: Thu, 17 Jan 2013 19:48:51 +0200

> From: "Drew Adams" <address@hidden>
> Date: Thu, 17 Jan 2013 08:57:41 -0800
> 
> > > `window-system' has the advantage that it works with older 
> > > Emacs releases.
> > 
> > Only if you want to support Emacs versions before 21.1.
> 
> Fair enough.  However, even in the final Emacs 22 release there are _many_ 
> uses
> of `window-sytem' as a predicate in the Gnu Emacs source code, even though
> `display-graphic-p' was introduced two releases before that.

Old habits die hard.

> Heck, even in the latest Gnu Emacs development source code, to be Emacs 24.3,
> there are still many such "deprecated" uses, AFAICT.
> 
> Here is a typical one, in dframe.el:
> 
> ;; On a terminal, raise the frame or the user will
> ;; be confused.
> (if (not window-system)
>     (select-frame (symbol-value frame-var)))
> 
> In case you think dframe.el is a bit exotic, see the basic libraries faces.el
> and frame.el, where there are also several such uses.

We need a better QA, obviously.  However, at the time, the core files
were left only with uses which couldn't be easily replaced by some
display-*-p predicate, and inventing a predicate for 1 or 2 uses is
not a good idea.

> And frame.el is the very file where `display-graphic-p' is *defined*.  It is
> called only 3 times in that file, while `window-system' seems to be used there
> as a predicate 7 times.

I see only 5 instances, not 7, and it is not clear to me what
display-*-p predicate would be appropriate in their stead.

> Nobody's perfect, of course.

Emacs development certainly isn't.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]