> I'm trying to make my .emacs work on MS Windows and X on Solaris,

Excellent.

> but on X when I setup my initial-frame-alist, and default-frame-alist,
> it chokes on an invalid font, namely,
> -outline-Courier New-normal-r-normal-normal-12-90-96-96-c-*-iso10646-1.
> Is there a method which will display all that's available? M-x
> list-fontsets didn't seem to be what I needed.

Well, here's something resembling what I do to make fonts happy under
different system types.

(require 'cl)
(set-frame-parameter nil 'font
  (or (find-if (lambda (font)
                 (ignore-errors (x-list-fonts font)))
               '("-*-andale mono-medium-r-*--14-*-*-*-*-*-*-*"
                 "-*-bitstream vera sans 
mono-medium-r-*-*-14-*-*-*-*-*-iso8859-*"
                 "-*-Lucida Console-normal-r-*-*-18-*-*-*-c-*-iso8859-1"))
      "-adobe-courier-medium-r-*-*-14-*-*-*-*-*-*-*"))

The explanation: we want to set Emacs' font to one we like, but not all
machines have the same fonts available. First, we look for Andale Mono
14 (a common font on Mac OS X). If such a font is available
(`x-list-fonts' returns non-null), we use it. Otherwise, we try
Bitstream Vera Sans Mono 14 (common under X11). If we can't find that,
we'll try Lucida Console 18 (common under Windows). If all of the above
have failed, we'll use Courier 14 (common everywhere, so good as a
default).

Disclaimer: the actual code in my .emacs file is a bit more complicated
than the above, and I haven't tested what appears above. But it should
convey the idea I think.


Ted

-- 
Edward O'Connor
[EMAIL PROTECTED]

Ense petit placidam sub libertate quietem.



_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

Reply via email to