unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: floyd@apaflo.com (Floyd L. Davidson)
Subject: Re: emacs in xterm
Date: Sat, 28 Oct 2006 11:24:39 -0800	[thread overview]
Message-ID: <87r6ws9rbc.fld@apaflo.com> (raw)
In-Reply-To: u64e4gzoh.fsf@comcast.net

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

  parent reply	other threads:[~2006-10-28 19:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.348.1162049311.27805.help-gnu-emacs@gnu.org>
2006-10-28 15:45 ` emacs in xterm Colin S. Miller
2006-10-28 17:01   ` zeycus
2006-10-28 15:51 ` jmg3000
2006-10-28 16:59   ` zeycus
2006-10-28 16:42 ` don provan
2006-10-28 18:06   ` David Hansen
2006-10-28 19:24   ` Floyd L. Davidson [this message]
2006-10-29  8:20   ` Malte Spiess
2006-10-31 18:10   ` zeycus
2006-11-01  1:37     ` Michaël Cadilhac
     [not found]   ` <mailman.473.1162318249.27805.help-gnu-emacs@gnu.org>
2006-11-01  6:50     ` Tim X
2006-11-01  8:30       ` Floyd L. Davidson
2006-11-02  8:00         ` Tim X
2006-11-01  8:43       ` zeycus
     [not found]       ` <mailman.10.1162370610.2155.help-gnu-emacs@gnu.org>
2006-11-02  8:06         ` Tim X
2006-10-28 10:16 zeycus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r6ws9rbc.fld@apaflo.com \
    --to=floyd@apaflo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).