help-gnustep
[Top][All Lists]
Advanced

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

Re: emacsclient and gworkspace


From: Camille Bourgoin
Subject: Re: emacsclient and gworkspace
Date: Tue, 13 Mar 2007 23:23:25 +0100
User-agent: GNUMail (Version 1.2.0)

On 2007-03-13 22:58:42 +0100 Charles philip Chan <cpchan@sympatico.ca> wrote:

> On 13 Mar 2007, monsieur.camille@gmail.com wrote:
> 
>> I open the file with a right click. It's open the "open with"
>> menu. emacsclient.app is present in this menu.
> 
> There is no "open with" menu in Gworkspace, are you talking about the
> "open with" dialog? This is really for openning file with non-gnustep
> programs when there is no appwrapper (to open a file that way with an
> app wrapper, you need to use the command gopen). However, using the
> "Tools" inspector is far simpler. Try doing this:

No, I'm talking about the "right-click open with" menu who list the
app in the Tools Inspector


> (1) Go to the file that you want to open in Gworkspace and invoke the
>     "Tools" inspector.
> 
> (2) Now double click on the Emacs icon in the "Tools" inspector. You can
>     make Emacs the default (so you can just double click on the file in
>     the browser) by selecting the Emacs icon and hit "Set Default".
> 
> If emacs is not showing up in the "Tools" Inspector, you will need to
> run "make_services" from a console and restart GWorkspace.
> 
> Charles
> 

But it's fine, with your help I've settled the problem. 

THE SOLUTION :
(with it, emacs.app launch Emacs if there is nos instances in motion. If there 
is an instance of Emacs, the file is open with it (with the emacsclient 
command).

1) put this in your .emacs :
(server-start)

2) and put this in your emacs.app/emacs :

#!/bin/sh
# Usage: emacs [ -GSFilePath file ]
# simple GNUstep launch script for emacs/xemacs
#
EMACS=emacs21-x
GNUCLIENT=emacsclient
#GNUCLIENT=gnuclient
#GNUCLIENT=/usr/bin/emacsclient
#
#--FUNCTIONS
#
usage()
{
echo Usage: `basename $0` '[ -GSFilePath file ]'
exit 2
}
#-- MAIN
#
# -- establish name of file to be opened
#
if [ $# -eq 2 ] ; then
  if [ "$1" = "-GSFilePath" ] ; then
    file="$2"
  else
    usage
  fi
elif [ $# -eq 0 ] ; then
  file=
else
  usage
fi
# -- check if gnuserv (emacs remote file opener)
# -- is running
ps -Ac | fgrep emacsserver
if [ $? -eq 0 ] ; then
    $GNUCLIENT $file &
else
    $EMACS $file &
fi

thank you for your help :)

-- 
Infidèle : À New York, qui ne croit pas à la religion chrétienne. À 
           Constantinople, qui y croit.
        -+- Ambrose Bierce -+-





reply via email to

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