From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: floyd@apaflo.com (Floyd L. Davidson) Newsgroups: gmane.emacs.help Subject: Re: emacs in xterm Date: Sat, 28 Oct 2006 11:24:39 -0800 Organization: __________ Message-ID: <87r6ws9rbc.fld@apaflo.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1162064476 26615 80.91.229.2 (28 Oct 2006 19:41:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 28 Oct 2006 19:41:16 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Oct 28 21:41:14 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Gdu3E-0002HY-Im for geh-help-gnu-emacs@m.gmane.org; Sat, 28 Oct 2006 21:41:04 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gdu3E-0007hj-1z for geh-help-gnu-emacs@m.gmane.org; Sat, 28 Oct 2006 15:41:04 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!sn-xt-sjc-02!sn-xt-sjc-06!sn-xt-sjc-01!sn-post-sjc-02!sn-post-sjc-01!supernews.com!corp.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: gnus 5.10.6/XEmacs 21.4.15/Linux 2.6.17-11 Cancel-Lock: sha1:OOGWdpcq+XkcE9bXxvGKcvCttfE= Original-X-Complaints-To: abuse@supernews.com Original-Lines: 89 Original-Xref: shelby.stanford.edu gnu.emacs.help:142748 Original-To: help-gnu-emacs@gnu.org 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:38367 Archived-At: don provan wrote: >zeycus writes: > >> But what if I prefer the old behaviour, expecting that emacs would >> make use of the whole particular xterm from which it is launched? I >> wish just that, with the same font I am using in that xterm, etc. >> The way it behaves if I launch emacs before starting theX-windows. > >You've got your answer from Mr. Miller, but let me just add that you >might want to give X a chance. I know from personal experience that ... Don is right. Let me expand on that, though this is not something you need to dive into implementing immediately. Keep it in mind as what you can do as you become familiar with Linux and begin look for ways to fine tune your working environment for more efficiency. Not only do you want (X)Emacs to run in its own window, you want to run it as an edit server. The server can be started by your login shell, by whatever mechanism you use to start X, or manually. It can be unmapped so there is no window when it starts. Instead of the slow process of invoking the entire huge (X)Emacs program, to edit something you invoke a very small client program which takes about half an instant to run. It remembers the last search pattern you used and various other odd things, which you will come to find useful. There are any number of ways to set up an edit server. Here are the basics of how I do it. First, I have a couple of things in my ~/.bashrc file that make it easier, Programs wanting an editor, use gnuclient: EDITOR=gnuclient VISUAL=gnuclient EDIT=gnuclient FCEDIT=gnuclient I have an alias that gives me a two letter command to invoke an editor from the command line: alias em='/usr/local/bin/gnuclient' This is a shell function I use to manually start an edit server. It has to be run only once, and survives between logins. function startxemacs { (cd ~/ #put nohup.out file in home directory nohup /usr/local/bin/xemacs -l ~/.semacs \ -unmapped -g 100x30+60+60 \ -T "GNUserver" 2>/dev/null &) } The above uses a special init file, ~/.semacs, which starts up the gnuserv process. It looks like this, ;; for GNU Emacs only (unless (featurep 'xemacs) (setq gnuserv-frame (current-frame))) (gnuserv-start) ;Start up the gnu edit server process ;; disallow exiting from a command (menu option only) (defun do-exit () "Exits Emacs or an Emacs client" (interactive) (if (gnuserv-running-p) (if (eq gnuserv-clients nil) (delete-frame) (gnuserv-edit)))) (define-key ctl-x-map "\C-c" 'do-exit) ;; end of file There are of course times when the edit server is *not* what you want to run. You can run (X)Emacs as a non server process too. I keep two of those running all the time on my workstation. One essentially works as a "notepad" that I have open all the time; it is "sticky" and shows up in any virtual desktop that I move to. The other is full screen in one desktop, and run /gnus/ for Usenet an email. (It has so many buffers open that I want to keep it entirely separate from the edit server.) -- Floyd L. Davidson Ukpeagvik (Barrow, Alaska) floyd@apaflo.com