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

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

Re: End of file during parsing?


From: Barry Margolin
Subject: Re: End of file during parsing?
Date: Sun, 10 Apr 2005 23:39:53 -0400
User-agent: MT-NewsWatcher/3.4 (PPC Mac OS X)

In article <mailman.1001.1113162562.2895.help-gnu-emacs@gnu.org>,
 Rui Tiago Matos <tiagomatos@gmail.com> wrote:

> I hacked up a bash function [1] to open some files in different
> frames. It works great after emacs is running. Otherwise it doesn't:
> it opens up emacs but I get:
> 
> command-line-1: End of file during parsing
> 
> Now, this is very strange because if I use --eval=... from the command
> line directly it works as expected. Anyone has an idea about why this
> doesn't work?

Try changing the command line that invokes emacs in that case to:

emacs21 "$CMDLINE"

The problem is that the shell is splitting the arguments at the spaces 
when you don't quote it.  So the argument that emacs is seeing is:

  --eval=(find-file-other frame

> 
> [1]
> emacs () 
> { 
>     if [ -z "$DISPLAY" ]; then
>         emacs21 $@;
>     else
>         if [ ! "`/bin/ps -U $UID | grep emacs`" ]; then
>             local CMDLINE="--eval=";
>             local FILE;
>             for FILE in $*;
>             do
>                 if ( grep ^/ <<< $FILE ) || ( grep ^~ <<< $FILE ); then
>                     CMDLINE="$CMDLINE(find-file-other-frame \"$FILE\")";
>                 else
>                     CMDLINE="$CMDLINE(find-file-other-frame \"$PWD/$FILE\")";
>                 fi;
>             done;
>             if [ "$CMDLINE" != "--eval=" ]; then
>                 emacs21 $CMDLINE &
>             else
>                 emacs21 &
>             fi;
>         else
>             local CMDLINE="-q";
>             local FILE;
>             for FILE in $*;
>             do
>                 if ( grep ^/ <<< $FILE ) || ( grep ^~ <<< $FILE ); then
>                     CMDLINE="$CMDLINE (find-file-other-frame \"$FILE\")";
>                 else
>                     CMDLINE="$CMDLINE (find-file-other-frame \"$PWD/$FILE\")";
>                 fi;
>             done;
>             if [ "$CMDLINE" != "-q" ]; then
>                 gnudoit $CMDLINE;
>             fi;
>         fi;
>     fi
> }

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***


reply via email to

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