From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: Functions that need X Date: Sat, 01 Jan 2011 18:29:35 -0500 Organization: A noiseless patient Spider Message-ID: References: <87sjxcv2ld.fsf@Compaq.site> <8739pcwake.fsf@puma.rapttech.com.au> NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1293925250 2721 80.91.229.12 (1 Jan 2011 23:40:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 1 Jan 2011 23:40:50 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 02 00:40:44 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PZB3y-0001lK-F1 for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Jan 2011 00:40:42 +0100 Original-Received: from localhost ([127.0.0.1]:47449 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PZB3x-0006j3-Uo for geh-help-gnu-emacs@m.gmane.org; Sat, 01 Jan 2011 18:40:41 -0500 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.84.MISMATCH!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 45 Injection-Info: barmar.motzarella.org; posting-host="+bxBiZT/p0ZLLuDb5H+JCw"; logging-data="3393"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/bZVMaIsy7DlRlaML1qbQS" User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Cancel-Lock: sha1:7Fn5N2ik427seUYXDXYUAl8ZS70= Original-Xref: usenet.stanford.edu gnu.emacs.help:183826 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:78037 Archived-At: In article <8739pcwake.fsf@puma.rapttech.com.au>, Tim X wrote: > Cecil Westerhof 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 ***