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

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

Re: How can Emacs tell if it's started with Xwindow?


From: William D. Colburn (aka Schlake)
Subject: Re: How can Emacs tell if it's started with Xwindow?
Date: Thu, 15 May 2003 09:24:53 -0600
User-agent: Mutt/1.4i

Here are two different examples from my .emacs that checks for X and
does things based on what it finds:

;;;
;;; I like my windows to fit on the screen
;;;
(if (eq (framep (selected-frame)) 'x)
    (let ((val (cdr (assq 'height (frame-parameters)))))
      (set-frame-height (selected-frame) (- val 1))
      )
  )

;;;
;;; I dislike the menu bars on non-X term windows 
;;;
(let ((frame-type (framep (selected-frame))))
  (cond
   ((eq frame-type 'x) (menu-bar-mode 1))
   ((eq frame-type 'pc) (menu-bar-mode -1))
   ((eq frame-type t) (menu-bar-mode -1))
   )
  )


On Thu, May 15, 2003 at 10:43:53PM +0800, Wang Yin wrote:
>I want to define some font in my .emacs file as:
>
>(create-fontset-from-fontset-spec
> "-adobe-courier-medium-r-*-*-14-*-*-*-*-*-fontset-wangyin,
>       chinese-gb2312:-*-simsun-medium-r-*--16-*-*-*-*-*-gbk-0,
>               
> mule-unicode-0100-24ff:-misc-fixed-medium-r-normal--16-*-*-*-*-*-iso10646-1,
>       korean-ksc5601:-*-medium-r-normal-*-16-*-ksc5601*-*,
>        chinese-cns11643-5:-*-simsun-medium-r-*--16-*-*-*-*-*-gbk-0,
>        chinese-cns11643-6:-*-simsun-medium-r-*--16-*-*-*-*-*-gbk-0,
>        chinese-cns11643-7:-*-simsun-medium-r-*--16-*-*-*-*-*-gbk-0" t)
>
>(setq default-frame-alist
>        (append
>        '((font . "fontset-wangyin"))
>        default-frame-alist))
>
>
>I think this is more flexible than put this stuff in
>.Xdefaults.
>
>But I have a problem now. If Emacs is started with -nw
>switch, it will report error.
>
>How can I add a predicate to tell Emacs if we are in X?
>
>
>-- 
>Wang Yin
>DA Lab, Tsinghua University,
>100084
>Beijing China
>_______________________________________________
>Help-gnu-emacs mailing list
>address@hidden
>http://mail.gnu.org/mailman/listinfo/help-gnu-emacs

--
William Colburn, "Sysprog" <address@hidden>
Computer Center, New Mexico Institute of Mining and Technology
http://www.nmt.edu/tcc/     http://www.nmt.edu/~wcolburn




reply via email to

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