unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Re: How can Emacs tell if it's started with Xwindow?
  2003-05-15 14:43 How can Emacs tell if it's started with Xwindow? Wang Yin
@ 2003-05-15 14:37 ` Lute Kamstra
  2003-05-15 15:24 ` William D. Colburn (aka Schlake)
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Lute Kamstra @ 2003-05-15 14:37 UTC (permalink / raw)


Wang Yin <wang-y01@mails.tsinghua.edu.cn> writes:

[...]

> How can I add a predicate to tell Emacs if we are in X?

,----[ C-h v window-system RET ]
| window-system's value is x
| 
| Documentation:
| A symbol naming the window-system under which Emacs is running
| (such as `x'), or nil if emacs is running on an ordinary terminal.
`----

Lute.

-- 
(spook) => "Aladdin S Key BLU-97 A/B"
(insert-file-contents "~/.signature") => (error "`~/.signature' too rude")

^ permalink raw reply	[flat|nested] 6+ messages in thread

* How can Emacs tell if it's started with Xwindow?
@ 2003-05-15 14:43 Wang Yin
  2003-05-15 14:37 ` Lute Kamstra
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Wang Yin @ 2003-05-15 14:43 UTC (permalink / raw)


Hi,

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How can Emacs tell if it's started with Xwindow?
  2003-05-15 14:43 How can Emacs tell if it's started with Xwindow? Wang Yin
  2003-05-15 14:37 ` Lute Kamstra
@ 2003-05-15 15:24 ` William D. Colburn (aka Schlake)
  2003-05-15 17:43   ` Niels Freimann
  2003-05-15 17:11 ` Benjamin Riefenstahl
  2003-05-16  1:17 ` It's me FKtPp ;)
  3 siblings, 1 reply; 6+ messages in thread
From: William D. Colburn (aka Schlake) @ 2003-05-15 15:24 UTC (permalink / raw)
  Cc: help-gnu-emacs

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
>Help-gnu-emacs@gnu.org
>http://mail.gnu.org/mailman/listinfo/help-gnu-emacs

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How can Emacs tell if it's started with Xwindow?
  2003-05-15 14:43 How can Emacs tell if it's started with Xwindow? Wang Yin
  2003-05-15 14:37 ` Lute Kamstra
  2003-05-15 15:24 ` William D. Colburn (aka Schlake)
@ 2003-05-15 17:11 ` Benjamin Riefenstahl
  2003-05-16  1:17 ` It's me FKtPp ;)
  3 siblings, 0 replies; 6+ messages in thread
From: Benjamin Riefenstahl @ 2003-05-15 17:11 UTC (permalink / raw)


Hi,


Wang Yin <wang-y01@mails.tsinghua.edu.cn> writes:
> I want to define some font in my .emacs file as:
>
> (create-fontset-from-fontset-spec
>  "-adobe-courier-medium-r-*-*-14-*-*-*-*-*-fontset-wangyin,
> [...]
>
> How can I add a predicate to tell Emacs if we are in X?

You may want to use "(if (display-multi-font-p) ...".

X11 is not what you really specifically want in this place, even
though it may work in your current situation.  Therefore asking the
question that way is considered bad style.


so long, benny

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How can Emacs tell if it's started with Xwindow?
  2003-05-15 15:24 ` William D. Colburn (aka Schlake)
@ 2003-05-15 17:43   ` Niels Freimann
  0 siblings, 0 replies; 6+ messages in thread
From: Niels Freimann @ 2003-05-15 17:43 UTC (permalink / raw)


this may also be interesting for emacs -nw:

(if window-system
    nil
        ;;
)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: How can Emacs tell if it's started with Xwindow?
  2003-05-15 14:43 How can Emacs tell if it's started with Xwindow? Wang Yin
                   ` (2 preceding siblings ...)
  2003-05-15 17:11 ` Benjamin Riefenstahl
@ 2003-05-16  1:17 ` It's me FKtPp ;)
  3 siblings, 0 replies; 6+ messages in thread
From: It's me FKtPp ;) @ 2003-05-16  1:17 UTC (permalink / raw)


不好意思,冒昧的问一句.你应改能看到中文吧,和和
定义fontset为什么不在资源文件里作呢?在.emacs里面对字体的改动是很拖累
启动时间的.本来emacs启动就很慢,这么一来,就更慢了.所以,我把定义窗口大
小,和fontset的与X相关的定义都写在了资源文件里面了.(呵呵,这个方法可能
不能让你满义,毕竟是个回避问题的方法,也许,你只是用fontset举个例子,那就
请原谅在下多嘴了. :P

I think define a fontset in Xresources *CAN SAVE YOUR INIT-TIME*
X's things should be set in Xresources :P

Yours FKtPp ;)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-05-16  1:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-15 14:43 How can Emacs tell if it's started with Xwindow? Wang Yin
2003-05-15 14:37 ` Lute Kamstra
2003-05-15 15:24 ` William D. Colburn (aka Schlake)
2003-05-15 17:43   ` Niels Freimann
2003-05-15 17:11 ` Benjamin Riefenstahl
2003-05-16  1:17 ` It's me FKtPp ;)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).