[comp.emacs] GNU Emacs and TeX

nejdl@polya.Stanford.EDU (wolfgang) (07/30/88)

I usually use a subshell of Emacs for all c-shell commands.

However, I have not been able to use the edit feature of TeX in a
subshell, as I cannot start another emacs in the subshell.

Is there a way of setting TEXEDIT to something special, to get into
emacs again after giving the TeX command "e", when an error occurs?

Thanks

Wolfgang

nejdl@polya.Stanford.EDU (wolfgang) (08/01/88)

By accident, I got the answer as mail instead of as posting. So this is
the (partial) answer:
----------------------------------------------------------------------
Return-Path: <gaynor@aramis.rutgers.edu>
Date: Mon, 1 Aug 88 02:04:14 EDT
From: gaynor@aramis.rutgers.edu (Silver)
To: nejdl@polya.stanford.edu
Subject: Re: GNU Emacs and TeX
In-Reply-To: USENET article <3450@polya.Stanford.EDU>

nejdl@polya.Stanford.EDU (wolfgang) writes:
> [I do all my work in a subshell within [GNU?] Emacs.  I want to
>  be able to use the edit feature of TeX in a subshell.  How?]

This is my original reply:

  Oh, I don't expect that you should have any problems with this.  Simply do
  the following:

    1. `setenv TEXEDIT <emacsdir>/src/emacsclient' somewhere in your
       initialization stuff.
    2. Give the command `server-start' in your emacs (maybe start up your emacs
       like so: emacs -f server-start).
    3. This should bring you up in a buffer within your emacs, which you should
       finish off with a C-x # (don't bother writing this down - it's
       advertised).

  Regards, [Ag] gaynor@rutgers.edu

I thought that I should take a whack at it before I sent everything off,
expecting it to work easily and gracefully.  However, I got this error in the
subshell:

  ? e
  No pages of output.
  Transcript written on foo.log.
  Usage: /usr/local/gnuemacs/etc/emacsclient [filename]
  ! Trouble executing command /usr/local/gnuemacs/etc/emacsclient

Anybody recognize this?

Regards, [Ag] gaynor@rutgers.edu
--------------------------------------------------------------------
Thank you for your answer.

I tried it with 
    1. `setenv TEXEDIT <emacsdir>/etc/emacsclient %s' 
and it worked, so only the <filename> argument was missing.

However, I found no possibility of setting the cursor to the right
line (where the error is found).

Using emacs I can use
        'setenv TEXEDIT emacs +%d %s'
but I found no way to pass an argument to emacsclient.

Any ideas?

Wolfgang

ilham@athena.mit.edu (Ilhamuddin Ahmed) (08/01/88)

In article <3468@polya.Stanford.EDU> nejdl@polya.Stanford.EDU (wolfgang) writes:
>
>I tried it with 
>    1. `setenv TEXEDIT <emacsdir>/etc/emacsclient %s' 
>and it worked, so only the <filename> argument was missing.
>
>However, I found no possibility of setting the cursor to the right
>line (where the error is found).
>
>Using emacs I can use
>        'setenv TEXEDIT emacs +%d %s'
>but I found no way to pass an argument to emacsclient.
>
>Any ideas?
>
>Wolfgang


I have an Emacs Lisp code for server.el written by Micheal Platoff of
Siemens RTL which does exactly what you want. Drop me a note if you want
this then I'll mail it to you.

						- Ilham



==============================================================================

            \\\!///             From  :   Ilhamuddin Ahmed  (MIT '91)
             _   _              UUCP  :   {backbone}!mit-eddie!athena!ilham
           ( Q   Q )            Arpa  :   ilham@athena.mit.edu
 ---,,,,-------U-------,,,,---  USnail:   MIT Lab. for Computer Science
                                          545 Technology Sq, Room 213
            HELLO!!!                      Cambridge, MA 02139
 -----------------------------            (617)-253-3578

==============================================================================

squires@hpcvlx.HP.COM (Matt Squires) (08/02/88)

> / hpcvlx:comp.emacs / 
nejdl@polya.Stanford.EDU (wolfgang)
/ 11:05 pm  Jul 29, 1988 /

> Is there a way of setting TEXEDIT to something special, to get into
> emacs again after giving the TeX command "e", when an error occurs?

No promises... but have you tried setting your default editor ($EDITOR) to
emacsclient?  You can run one main GNUemacs, and call (server-start nil) in
your .emacs file.  Then every time you use the editor "emacsclient", your
current emacs will get interrupted, and start editing this new file.  C-x #
will send this interrupting buffer back to the client.  This is useful if you
have job control, or beter yet, a windowing system (like screen or X).  I've
never actually tried using emacsclient from emacs shell mode, though, and
the current implementation of emacs I use does not have emacsclient or
emacsserver, or I could tell you for sure if this works.  Good luck!

> Thanks

> Wolfgang

mcs

aglew@urbsdc.Urbana.Gould.COM (08/02/88)

>> Is there a way of setting TEXEDIT to something special, to get into
>> emacs again after giving the TeX command "e", when an error occurs?
>
>I never actually tried using emacsclient from emacs shell mode,  

I do not use TeX, but I regularly run non-fullscreen applications
in an Emacs shell window, with emacsclient as my default editor.
When emacsclient is invoked, Emacs neatly opens a window for
editing; \ gets rid of the window and sends the buffer to the
application.

I have occasionally used Emacs' terminal-mode for running full-screen
applications, with emacsclient as my editor. Occasionally this works,
but there are too many fullscreen applications that require a full
24x80 screen (terminal-mode is 22x78 or similar) and/or require a
real terminal type, like VT100. Running on a Sun with variable sized
windows solves the first problem; as for the second, a terminal
emulator that emulates a terminal, instead of screaming about 
non-use of termcaps, has been on my list of things to do for a while.