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: Drew Adams
Subject: RE: Using the same custom file in two different OSes
Date: Thu, 17 Jan 2013 10:15:58 -0800

> > 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,

These occurrences all looked to me superficially like they were just testing
whether FRAME is for graphic display:

1. (when (memq (window-system frame) '(x w32 ns))
     (x-focus-frame frame))

2. (or (window-system frame)
       (and tty-type
            (string-match "^\\(xterm\\|\\rxvt\\|dtterm\\|eterm\\)"
                          tty-type)))

3. (cond ((null (window-system frame))
          (if (tty-display-color-p frame) 'color 'mono))

4. (and (window-system frame)
        (x-get-resource "backgroundMode" "BackgroundMode"))

5 and 6 (two occurrences).

   (or window-system
       (face-set-after-frame-default (selected-frame)))

OK, these occurrences use the variable `window-system', not the function, but it
too is deprecated in favor of function `display-*-p'.

7. (not (memq window-system '(x w32 ns)))

Again, the deprecated variable.  If you don't count the variable occurrences
then 4, not 5, AFAICT.

> and it is not clear to me what display-*-p predicate would be
> appropriate in their stead.

If it's not clear to you how to replace deprecated `window-system' occurrences
here, I wonder how it should be clear to us mortals. ;-)

But which of the functions with names matching `display-*-p' correspond to what
you and the `window-system' deprecation doc mean by `display-*-p'?  All of them?

 display-color-p
 display-graphic-p
 display-grayscale-p 
 display-images-p
 display-mouse-p
 display-multi-font-p 
 display-multi-frame-p
 display-popup-menus-p
 display-selections-p 
 display-supports-face-attributes-p
 display-time-file-nonempty-p

If all of them, then there should be a comma in the `window-system' doc string
here, just before "which":

  Instead, use `display-graphic-p' or any of the other `display-*-p'
  predicates which report frame's specific UI-related capabilities.
            ^

Without a comma, the text suggests that there are some `display-*-p' predicates
that do not "report frame's...", and that those are not included as
`window-system' substitutes.

(BTW, "frame's" here should be "FRAME's", referring to the argument.  Or else it
should say "the frame's".)




reply via email to

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