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

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

Re: emacs in xterm


From: Floyd L. Davidson
Subject: Re: emacs in xterm
Date: Sat, 28 Oct 2006 11:24:39 -0800
User-agent: gnus 5.10.6/XEmacs 21.4.15/Linux 2.6.17-11

don provan <dprovan@comcast.net> wrote:
>zeycus <miguelgarciadiaz@ono.com> 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            <http://www.apaflo.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)                         floyd@apaflo.com


reply via email to

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