[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Functions that need X
From: |
Barry Margolin |
Subject: |
Re: Functions that need X |
Date: |
Sat, 01 Jan 2011 18:29:35 -0500 |
User-agent: |
MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) |
In article <8739pcwake.fsf@puma.rapttech.com.au>,
Tim X <timx@nospam.dev.null> wrote:
> Cecil Westerhof <Cecil@decebal.nl> writes:
>
> > I have a lot of functionality written for my Emacs. I was asked to
> > maintain a server for a friend. I installed Emacs there and put my
> > Emacs functionality there also. But some things are depending on X.
> > Because of this I made those depended working with X. In the start of
> > my .emacs I have:
> > (defconst +using-X+ (getenv "DISPLAY"))
> >
>
> Alternatively, just use the built-in variable window-system i.e.
>
> (unless (eq 'x window-system)
> ....)
>
> or even better, use one of the display capability predicates, such as
>
> (unless (display-graphic-p)
> ...)
>
> > And where I use X-functionality (not much at the moment) I have:
> > (unless (not +using-X+)
> > (set-scroll-bar-mode 'right)
> > (tool-bar-mode -1))
>
> Do you actually need the above? Long time since I've used emacs in a
> non-graphics mode, but when I did, you didn't get things like tool-bar
> unless the display could support it.
The reason is that if the display doesn't support it these functions
aren't even defined, so you get an error when you try to turn off the
nonexistent tool bar.
It probably would be better if there were stub versions of all these
functions in console Emacs, so that they would just be ignored. But
since there aren't, you need to check first.
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Re: Functions that need X, Cecil Westerhof, 2011/01/03
Re: Functions that need X, Barry Margolin, 2011/01/01
Re: Functions that need X, Kevin Rodgers, 2011/01/10