unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Problem quoting expression to be eval'ed by emacsclient
@ 2013-10-23  8:33 Sebastien Vauban
  2013-10-23  8:52 ` Thorsten Jolitz
  2013-10-23 10:14 ` Andreas Röhler
  0 siblings, 2 replies; 14+ messages in thread
From: Sebastien Vauban @ 2013-10-23  8:33 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ

Hello,

I'm trying to evaluate an expression via `emacsclient' (from a Zsh shell),
for example:

--8<---------------cut here---------------start------------->8---
$ emacsclient -e "(message \"hello\")"
--8<---------------cut here---------------end--------------->8---

But all I get is:

  *ERROR*: End of file during parsing

Using `bash -x', I see that's due to a quoting problem:

--8<---------------cut here---------------start------------->8---
$ bash -x emacsclient -e "(message \"hello\")"
+ 'C:/Program Files (x86)/emacs-trunk/bin/emacsclient' -e '(message' '"hello")'

*ERROR*: End of file during parsing

$ bash -x emacsclient -e '(message \"hello\")'
+ 'C:/Program Files (x86)/emacs-trunk/bin/emacsclient' -e '(message' '\"hello\")'

*ERROR*: End of file during parsing

$ bash -x emacsclient -e \"(message \"hello\")\"
zsh: no matches found: "(message "hello")"

$ bash -x emacsclient "-e \"(message \"hello\")\""
+ 'C:/Program Files (x86)/emacs-trunk/bin/emacsclient' -e '"(message' '"hello")"'

*ERROR*: End of file during parsing
--8<---------------cut here---------------end--------------->8---

But I don't see how to pass the right expression to `emacsclient'. Is there
anybody able to help me sort this out?  TIA!

Best regards,
  Seb

-- 
Sebastien Vauban


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Problem quoting expression to be eval'ed by emacsclient
  2013-10-23  8:33 Problem quoting expression to be eval'ed by emacsclient Sebastien Vauban
@ 2013-10-23  8:52 ` Thorsten Jolitz
  2013-10-23 14:07   ` Tassilo Horn
                     ` (2 more replies)
  2013-10-23 10:14 ` Andreas Röhler
  1 sibling, 3 replies; 14+ messages in thread
From: Thorsten Jolitz @ 2013-10-23  8:52 UTC (permalink / raw)
  To: help-gnu-emacs

"Sebastien Vauban" <sva-news@mygooglest.com>
writes:

Hello,

> I'm trying to evaluate an expression via `emacsclient' (from a Zsh shell),
> for example:
>
> $ emacsclient -e "(message \"hello\")"

This works for me (bash):

#+begin_src sh
$  emacsclient -s my-server -e "(message \"hello\")"
"hello"
#+end_src

-- 
cheers,
Thorsten




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Problem quoting expression to be eval'ed by emacsclient
  2013-10-23  8:33 Problem quoting expression to be eval'ed by emacsclient Sebastien Vauban
  2013-10-23  8:52 ` Thorsten Jolitz
@ 2013-10-23 10:14 ` Andreas Röhler
  1 sibling, 0 replies; 14+ messages in thread
From: Andreas Röhler @ 2013-10-23 10:14 UTC (permalink / raw)
  To: help-gnu-emacs

Am 23.10.2013 10:33, schrieb Sebastien Vauban:
> Hello,
>
> I'm trying to evaluate an expression via `emacsclient' (from a Zsh shell),
> for example:
>
> --8<---------------cut here---------------start------------->8---
> $ emacsclient -e "(message \"hello\")"
> --8<---------------cut here---------------end--------------->8---
>
> But all I get is:
>
>    *ERROR*: End of file during parsing
>
> Using `bash -x', I see that's due to a quoting problem:
>
> --8<---------------cut here---------------start------------->8---
> $ bash -x emacsclient -e "(message \"hello\")"
> + 'C:/Program Files (x86)/emacs-trunk/bin/emacsclient' -e '(message' '"hello")'
>
> *ERROR*: End of file during parsing
>
> $ bash -x emacsclient -e '(message \"hello\")'
> + 'C:/Program Files (x86)/emacs-trunk/bin/emacsclient' -e '(message' '\"hello\")'
>
> *ERROR*: End of file during parsing
>
> $ bash -x emacsclient -e \"(message \"hello\")\"
> zsh: no matches found: "(message "hello")"
>
> $ bash -x emacsclient "-e \"(message \"hello\")\""
> + 'C:/Program Files (x86)/emacs-trunk/bin/emacsclient' -e '"(message' '"hello")"'
>
> *ERROR*: End of file during parsing
> --8<---------------cut here---------------end--------------->8---
>
> But I don't see how to pass the right expression to `emacsclient'. Is there
> anybody able to help me sort this out?  TIA!
>
> Best regards,
>    Seb
>

Maybe something with  batch-mode?

That works here, however not emacsclient:

emacs -Q --batch --eval "(message \"%s\" \"hello\")"



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Problem quoting expression to be eval'ed by emacsclient
  2013-10-23  8:52 ` Thorsten Jolitz
@ 2013-10-23 14:07   ` Tassilo Horn
  2013-10-23 15:33   ` Eli Zaretskii
       [not found]   ` <mailman.4544.1382542407.10748.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 14+ messages in thread
From: Tassilo Horn @ 2013-10-23 14:07 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: help-gnu-emacs

Thorsten Jolitz <tjolitz@gmail.com> writes:

>> I'm trying to evaluate an expression via `emacsclient' (from a Zsh shell),
>> for example:
>>
>> $ emacsclient -e "(message \"hello\")"
>
> This works for me (bash):
>
> #+begin_src sh
> $  emacsclient -s my-server -e "(message \"hello\")"
> "hello"
> #+end_src

Works for me, too (with ZSH).

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Problem quoting expression to be eval'ed by emacsclient
  2013-10-23  8:52 ` Thorsten Jolitz
  2013-10-23 14:07   ` Tassilo Horn
@ 2013-10-23 15:33   ` Eli Zaretskii
       [not found]   ` <mailman.4544.1382542407.10748.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 14+ messages in thread
From: Eli Zaretskii @ 2013-10-23 15:33 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Thorsten Jolitz <tjolitz@gmail.com>
> Date: Wed, 23 Oct 2013 10:52:19 +0200
> 
> > I'm trying to evaluate an expression via `emacsclient' (from a Zsh shell),
> > for example:
> >
> > $ emacsclient -e "(message \"hello\")"
> 
> This works for me (bash):
> 
> #+begin_src sh
> $  emacsclient -s my-server -e "(message \"hello\")"
> "hello"
> #+end_src

But you aren't on Windows, are you?



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Problem quoting expression to be eval'ed by emacsclient
       [not found]   ` <mailman.4544.1382542407.10748.help-gnu-emacs@gnu.org>
@ 2013-10-23 21:56     ` Sebastien Vauban
  2013-10-24  2:52       ` Eli Zaretskii
       [not found]       ` <mailman.4580.1382583151.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 14+ messages in thread
From: Sebastien Vauban @ 2013-10-23 21:56 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ

Eli Zaretskii wrote:
>> From: Thorsten Jolitz <tjolitz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> Date: Wed, 23 Oct 2013 10:52:19 +0200
>> 
>>> I'm trying to evaluate an expression via `emacsclient' (from a Zsh shell),
>>> for example:
>>>
>>> $ emacsclient -e "(message \"hello\")"
>> 
>> This works for me (bash):
>> 
>> #+begin_src sh
>> $  emacsclient -s my-server -e "(message \"hello\")"
>> "hello"
>> #+end_src
>
> But you aren't on Windows, are you?

If you're asking the question to me, then yes, I'm on Windows. But the above
tests I made are from a Cygwin Zsh session.

I did not think that would differ from a Unix Zsh, but it seems so, then?

Best regards,
  Seb

-- 
Sebastien Vauban


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Problem quoting expression to be eval'ed by emacsclient
  2013-10-23 21:56     ` Sebastien Vauban
@ 2013-10-24  2:52       ` Eli Zaretskii
       [not found]       ` <mailman.4580.1382583151.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 14+ messages in thread
From: Eli Zaretskii @ 2013-10-24  2:52 UTC (permalink / raw)
  To: help-gnu-emacs

> From: "Sebastien Vauban" <sva-news@mygooglest.com>
> Date: Wed, 23 Oct 2013 23:56:16 +0200
> 
> Eli Zaretskii wrote:
> >> From: Thorsten Jolitz <tjolitz@gmail.com>
> >> Date: Wed, 23 Oct 2013 10:52:19 +0200
> >> 
> >>> I'm trying to evaluate an expression via `emacsclient' (from a Zsh shell),
> >>> for example:
> >>>
> >>> $ emacsclient -e "(message \"hello\")"
> >> 
> >> This works for me (bash):
> >> 
> >> #+begin_src sh
> >> $  emacsclient -s my-server -e "(message \"hello\")"
> >> "hello"
> >> #+end_src
> >
> > But you aren't on Windows, are you?
> 
> If you're asking the question to me, then yes, I'm on Windows.

You evidently are, but I thing Thorsten isn't.

> But the above tests I made are from a Cygwin Zsh session.

And emacsclient was a Cygwin build or a native build?  If the latter,
your problems could be due to this mix.  (Your example works for me
from cmd and even from MSYS Bash.)



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Problem quoting expression to be eval'ed by emacsclient
       [not found]       ` <mailman.4580.1382583151.10748.help-gnu-emacs@gnu.org>
@ 2013-10-25 12:37         ` Sebastien Vauban
  2013-10-25 13:47           ` Eli Zaretskii
       [not found]           ` <mailman.4697.1382708854.10748.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 14+ messages in thread
From: Sebastien Vauban @ 2013-10-25 12:37 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ

Eli Zaretskii wrote:
> Sebastien Vauban wrote:
>> Eli Zaretskii wrote:
>>>>>
>>>>> I'm trying to evaluate an expression via `emacsclient' (from a Zsh shell),
>>>>> for example:
>>>>>
>>>>> $ emacsclient -e "(message \"hello\")"
>>
>> The above tests I made are from a Cygwin Zsh session.
>
> And emacsclient was a Cygwin build or a native build? If the latter, your
> problems could be due to this mix. (Your example works for me from cmd and
> even from MSYS Bash.)

That does indeed makes a difference:

--8<---------------cut here---------------start------------->8---
$ emacsclient -e "(message \"hello\")"

*ERROR*: End of file during parsing
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
$ /usr/bin/emacsclient -e "(message \"hello\")"
/usr/bin/emacsclient: can't find socket; have you started the server?
To start the server in Emacs, type "M-x server-start".
"hello"
--8<---------------cut here---------------end--------------->8---

However, that still leaves me with the following problem:

  How can I work in a correct shell on Windows (read: not `cmd.exe'), and
  edit in my graphical Emacs w32?

More generally, as:

- it happens I switch between GNU Emacs 23/24 versions (for test purpose, in
  case of problem)

- an Emacs server must be contacted by an `emacsclient' of the same release

- Cygwin (/usr/bin) is second in my PATH, after ~/bin

I currently have a small `~/bin/emacsclient' script (one-liner) which allows me
to set the full path to the right `emacsclient' without having to fiddle with
the PATH environment variable (as that requires me to quit my shell, and start
a new one):

--8<---------------cut here---------------start------------->8---
"C:/Program Files (x86)/emacs-trunk/bin/emacsclient" $@
--8<---------------cut here---------------end--------------->8---

This is a hack. Indeed, I'd like to be able to launch whichever Emacs version
(clicking on one of the many versions I have on my Windows desktop), and that
launching `emacsclient' in the shell would work in all contexts.

Am I missing a better way to handle this?

Best regards,
  Seb

-- 
Sebastien Vauban


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Problem quoting expression to be eval'ed by emacsclient
  2013-10-25 12:37         ` Sebastien Vauban
@ 2013-10-25 13:47           ` Eli Zaretskii
       [not found]           ` <mailman.4697.1382708854.10748.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 14+ messages in thread
From: Eli Zaretskii @ 2013-10-25 13:47 UTC (permalink / raw)
  To: help-gnu-emacs

> From: "Sebastien Vauban" <sva-news@mygooglest.com>
> Date: Fri, 25 Oct 2013 14:37:28 +0200
> 
> >> The above tests I made are from a Cygwin Zsh session.
> >
> > And emacsclient was a Cygwin build or a native build? If the latter, your
> > problems could be due to this mix. (Your example works for me from cmd and
> > even from MSYS Bash.)
> 
> That does indeed makes a difference:
> 
> --8<---------------cut here---------------start------------->8---
> $ emacsclient -e "(message \"hello\")"
> 
> *ERROR*: End of file during parsing
> --8<---------------cut here---------------end--------------->8---
> 
> --8<---------------cut here---------------start------------->8---
> $ /usr/bin/emacsclient -e "(message \"hello\")"
> /usr/bin/emacsclient: can't find socket; have you started the server?
> To start the server in Emacs, type "M-x server-start".
> "hello"
> --8<---------------cut here---------------end--------------->8---

I'm confused: didn't you say that /usr/bin is a Cygwin directory?  If
so, /usr/bin/emacsclient is a Cygwin build of emacsclient, right?
Then what kind of emacsclient is in ~/bin?

> However, that still leaves me with the following problem:
> 
>   How can I work in a correct shell on Windows (read: not `cmd.exe'), and
>   edit in my graphical Emacs w32?

My best advice is to avoid that combination entirely.  It's just too
fragile and replete of subtle "issues".

Let me turn the table and ask why do you need to invoke emacsclient
from the shell command line?  Why not simply visit the file from the
running Emacs?  (You do have an Emacs session running at all times,
right?)  emacsclient is mainly for letting other programs ask Emacs to
edit a file.  Since the w32 Emacs does not support multiple tty
devices in the same session, even invoking "emacsclient -t" bu hand
doesn't make sense when the server is the w32 Emacs.  So I wonder why
do you use this at all.

Another pertinent question is: why not use the Cygwin build of Emacs?
It does support GUI sessions, and can even be built with the w32
graphics as its "toolkit".  If you use a Cygwin Emacs and emacsclient
from the Cygwin shell, I don't expect you to have any problems with
quoting.

But if, for some reason, you must use this crazy mix, then I suggest
to at least switch to the MSYS Bash.  It is friendlier to native
programs than Cygwin shells, although you will have problems there as
well.

> - an Emacs server must be contacted by an `emacsclient' of the same release

This is not really accurate.  It's just that the format of the server
file changed between Emacs 23 and 24, so you cannot mix client and
server that are on different sides of that schism.

> - Cygwin (/usr/bin) is second in my PATH, after ~/bin

Why do you need Cygwin executables on your PATH?

And what kind of programs are in ~/bin?

> I currently have a small `~/bin/emacsclient' script (one-liner) which allows me
> to set the full path to the right `emacsclient' without having to fiddle with
> the PATH environment variable (as that requires me to quit my shell, and start
> a new one):
> 
> --8<---------------cut here---------------start------------->8---
> "C:/Program Files (x86)/emacs-trunk/bin/emacsclient" $@
> --8<---------------cut here---------------end--------------->8---
> 
> This is a hack.

I don't see anything wrong with such a script.  But it only works
around the PATH problem, it does nothing to alleviate the subtle
incompatibilities between native Windows executables and Cygwin/MSYS
executables.

> Indeed, I'd like to be able to launch whichever Emacs version
> (clicking on one of the many versions I have on my Windows desktop), and that
> launching `emacsclient' in the shell would work in all contexts.

See above: I don't understand why you are invoking emacsclient in the
first place.

As for the v23 vs v24 emacsclient issue, you could have emacsclient23
and emacsclient24 (scripts, aliases, whatever) to DTRT for each one.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Problem quoting expression to be eval'ed by emacsclient
       [not found]           ` <mailman.4697.1382708854.10748.help-gnu-emacs@gnu.org>
@ 2013-10-30  9:59             ` Sebastien Vauban
  2013-10-30 11:38               ` Stefan Monnier
                                 ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Sebastien Vauban @ 2013-10-30  9:59 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ

Eli Zaretskii wrote:
>> From: "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
>> Date: Fri, 25 Oct 2013 14:37:28 +0200
>> 
>>>> The above tests I made are from a Cygwin Zsh session.
>>>
>>> And emacsclient was a Cygwin build or a native build? If the latter, your
>>> problems could be due to this mix. (Your example works for me from cmd and
>>> even from MSYS Bash.)
>> 
>> That does indeed makes a difference:
>> 
>> --8<---------------cut here---------------start------------->8---
>> $ emacsclient -e "(message \"hello\")"
>> 
>> *ERROR*: End of file during parsing
>> --8<---------------cut here---------------end--------------->8---
>> 
>> --8<---------------cut here---------------start------------->8---
>> $ /usr/bin/emacsclient -e "(message \"hello\")"
>> /usr/bin/emacsclient: can't find socket; have you started the server?
>> To start the server in Emacs, type "M-x server-start".
>> "hello"
>> --8<---------------cut here---------------end--------------->8---
>
> I'm confused: didn't you say that /usr/bin is a Cygwin directory?

Yes, it is.

> If so, /usr/bin/emacsclient is a Cygwin build of emacsclient, right?

Right.

> Then what kind of emacsclient is in ~/bin?

That was answered later in my post; ~/bin/emacsclient is the following script:

--8<---------------cut here---------------start------------->8---
"C:/Program Files (x86)/emacs-trunk/bin/emacsclient" $@
--8<---------------cut here---------------end--------------->8---

That's (mostly) a way to bypass the Cygwin emacsclient, as ~/bin is before
/usr/bin in my PATH environment variable:

--8<---------------cut here---------------start------------->8---
/cygdrive/d/Users/sva/bin
/cygdrive/d/Users/sva/winbin
...
/usr/bin
...
/cygdrive/c/Windows/system32
/cygdrive/c/Windows
...
--8<---------------cut here---------------end--------------->8---

IOW, a way to be able to instruct which "real" emacsclient program I want to
invoke when I type emacsclient in a shell, without the need to play with the
PATH environment variable.

>> However, that still leaves me with the following problem:
>> 
>>   How can I work in a correct shell on Windows (read: not `cmd.exe'), and
>>   edit in my graphical Emacs w32?
>
> My best advice is to avoid that combination entirely.  It's just too
> fragile and replete of subtle "issues".
>
> Let me turn the table and ask why do you need to invoke emacsclient
> from the shell command line?  Why not simply visit the file from the
> running Emacs?  (You do have an Emacs session running at all times,
> right?)  emacsclient is mainly for letting other programs ask Emacs to
> edit a file.  Since the w32 Emacs does not support multiple tty
> devices in the same session, even invoking "emacsclient -t" bu hand
> doesn't make sense when the server is the w32 Emacs.  So I wonder why
> do you use this at all.

You're right asking such questions about the "why". It sometimes can be very
enlightening.

So, here, in my case, I almost only use `emacsclient' from "sendpatch", a shell
script (I wrote) which automates the sending of a diff per email, for other
colleagues to review and see what we commit in our SVN server.

High-level, what sendpatch does is the following:

1. it makes a patch file with the output of "svn diff",
2. asks for an email subject,
3. launches the preferred EDITOR of the user to let him write a more complete
   commit message,
4. commits the diff in SVN, and
5. sends the "review" on a mailing list.

In my case, EDITOR is `emacsclient'. For other colleagues, it can be `vi' or
some such.

That script is written in Bash; it heavily relies on standard Unix commands
such as `cut', `grep', `head', `awk', etc.

> Another pertinent question is: why not use the Cygwin build of Emacs?
> It does support GUI sessions, and can even be built with the w32
> graphics as its "toolkit".

(... searching for more info about this...)

You're talking of the Cygwin package emacs-w32, right?

I wasn't aware of it. I will give it a try...

I thought that the graphical Cygwin Emacs was only a X-version (installed via
the Cygwin package emacs-X11, IIUC).

> If you use a Cygwin Emacs and emacsclient from the Cygwin shell, I don't
> expect you to have any problems with quoting.
>
> But if, for some reason, you must use this crazy mix, then I suggest
> to at least switch to the MSYS Bash.  It is friendlier to native
> programs than Cygwin shells, although you will have problems there as
> well.

But I'd loose Zsh, right?  OK, honestly, apart using `M-q' (to type another
command in the middle of a long command) and `vared' (to interactively a edit
variable), I don't really use special Zsh features either.

>> - an Emacs server must be contacted by an `emacsclient' of the same release
>
> This is not really accurate.  It's just that the format of the server
> file changed between Emacs 23 and 24, so you cannot mix client and
> server that are on different sides of that schism.

Thanks for the precision.

>> - Cygwin (/usr/bin) is second in my PATH, after ~/bin
>
> Why do you need Cygwin executables on your PATH?

You mean from PATH as seen in a CMD shell?  Or from a Bash shell?

I need the Cygwin executables them all the time in my Bash sessions.

And I need the Cygwin executables from Emacs as well (for the `M-x
find-grep-dired' or `M-x rgrep' commands, among others, which I use quite
extensively -- `rgrep', at least). And, there, I need them to be before the
default Windows executable, because of `find' (which also exist in
c:\Windows\system32).

Though, it's certainly possible to `setq' a couple (or a lot?) of vars to avoid
adding C:/cygwin/bin to the PATH. Is it that you're talking about?

> And what kind of programs are in ~/bin?
>
>> I currently have a small `~/bin/emacsclient' script (one-liner) which allows me
>> to set the full path to the right `emacsclient' without having to fiddle with
>> the PATH environment variable (as that requires me to quit my shell, and start
>> a new one):
>> 
>> --8<---------------cut here---------------start------------->8---
>> "C:/Program Files (x86)/emacs-trunk/bin/emacsclient" $@
>> --8<---------------cut here---------------end--------------->8---
>> 
>> This is a hack.
>
> I don't see anything wrong with such a script.  But it only works
> around the PATH problem, it does nothing to alleviate the subtle
> incompatibilities between native Windows executables and Cygwin/MSYS
> executables.

Rigth. And these are subtle incompatibilities about which I was unaware up to a
couple of days ago...

>> Indeed, I'd like to be able to launch whichever Emacs version
>> (clicking on one of the many versions I have on my Windows desktop), and that
>> launching `emacsclient' in the shell would work in all contexts.
>
> See above: I don't understand why you are invoking emacsclient in the
> first place.

I hope you now do.

> As for the v23 vs v24 emacsclient issue, you could have emacsclient23
> and emacsclient24 (scripts, aliases, whatever) to DTRT for each one.

Yes, but the question arises from the fact that `sendpatch' has no way to
detect (does it?) which Emacs server version is currently running, so which
`emacsclient' it has to call.

Thanks for your help!

Best regards,
  Seb

-- 
Sebastien Vauban


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Problem quoting expression to be eval'ed by emacsclient
  2013-10-30  9:59             ` Sebastien Vauban
@ 2013-10-30 11:38               ` Stefan Monnier
  2013-10-30 18:55               ` Eli Zaretskii
                                 ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: Stefan Monnier @ 2013-10-30 11:38 UTC (permalink / raw)
  To: help-gnu-emacs

> --8<---------------cut here---------------start------------->8---
> "C:/Program Files (x86)/emacs-trunk/bin/emacsclient" $@
> --8<---------------cut here---------------end--------------->8---

There's your problem.  You need quotes around the $@.


        Stefan




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Problem quoting expression to be eval'ed by emacsclient
  2013-10-30  9:59             ` Sebastien Vauban
  2013-10-30 11:38               ` Stefan Monnier
@ 2013-10-30 18:55               ` Eli Zaretskii
       [not found]               ` <mailman.4965.1383133220.10748.help-gnu-emacs@gnu.org>
       [not found]               ` <mailman.4986.1383159329.10748.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 14+ messages in thread
From: Eli Zaretskii @ 2013-10-30 18:55 UTC (permalink / raw)
  To: help-gnu-emacs

> From: "Sebastien Vauban" <sva-news@mygooglest.com>
> Date: Wed, 30 Oct 2013 10:59:24 +0100
> 
> So, here, in my case, I almost only use `emacsclient' from "sendpatch", a shell
> script (I wrote) which automates the sending of a diff per email, for other
> colleagues to review and see what we commit in our SVN server.

So you are using emacsclient as EDITOR, which is what it is for.

> >> - Cygwin (/usr/bin) is second in my PATH, after ~/bin
> >
> > Why do you need Cygwin executables on your PATH?
> 
> You mean from PATH as seen in a CMD shell?  Or from a Bash shell?

Both, and also why you need that in Emacs.

> I need the Cygwin executables them all the time in my Bash sessions.

You can set up your Bash sessions so that when you are in Bash,
Cygwin's bin directory is on PATH, but when you are in cmd or Emacs,
it is not.  There's no necessity to have a single PATH in all your
sessions.

> And I need the Cygwin executables from Emacs as well (for the `M-x
> find-grep-dired' or `M-x rgrep' commands, among others, which I use quite
> extensively -- `rgrep', at least). And, there, I need them to be before the
> default Windows executable, because of `find' (which also exist in
> c:\Windows\system32).

To avoid the problem with 'find', have the directory where the GNU
'find' lives appear before c:\Windows\system32 in PATH.  After all,
chances of you wanting to invoke the Windows 'find' are nil, right?

As for grep, there's a native Windows port around, so no need to go
Cygwin when you use Emacs.

> > As for the v23 vs v24 emacsclient issue, you could have emacsclient23
> > and emacsclient24 (scripts, aliases, whatever) to DTRT for each one.
> 
> Yes, but the question arises from the fact that `sendpatch' has no way to
> detect (does it?) which Emacs server version is currently running, so which
> `emacsclient' it has to call.

I presume that you already have some arrangements to work with 2 Emacs
versions, so that it should be easy to put something in the
environment in each case, such that 'sendpatch' could look at that and
decide.



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Problem quoting expression to be eval'ed by emacsclient
       [not found]               ` <mailman.4965.1383133220.10748.help-gnu-emacs@gnu.org>
@ 2013-11-07 15:37                 ` Sebastien Vauban
  0 siblings, 0 replies; 14+ messages in thread
From: Sebastien Vauban @ 2013-11-07 15:37 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ

Hello Stefan,

Stefan Monnier wrote:
>> --8<---------------cut here---------------start------------->8---
>> "C:/Program Files (x86)/emacs-trunk/bin/emacsclient" $@
>> --8<---------------cut here---------------end--------------->8---
>
> There's your problem.  You need quotes around the $@.

Yep. That does solve my problem, indeed!

Many, many thanks...

Best regards,
  Seb

-- 
Sebastien Vauban


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Problem quoting expression to be eval'ed by emacsclient
       [not found]               ` <mailman.4986.1383159329.10748.help-gnu-emacs@gnu.org>
@ 2013-11-07 15:44                 ` Sebastien Vauban
  0 siblings, 0 replies; 14+ messages in thread
From: Sebastien Vauban @ 2013-11-07 15:44 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ

Eli,

Eli Zaretskii wrote:
>> From: "Sebastien Vauban" <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
>> Date: Wed, 30 Oct 2013 10:59:24 +0100
>> 
>> So, here, in my case, I almost only use `emacsclient' from "sendpatch", a shell
>> script (I wrote) which automates the sending of a diff per email, for other
>> colleagues to review and see what we commit in our SVN server.
>
> So you are using emacsclient as EDITOR, which is what it is for.

Good.

>>>> - Cygwin (/usr/bin) is second in my PATH, after ~/bin
>>>
>>> Why do you need Cygwin executables on your PATH?
>> 
>> You mean from PATH as seen in a CMD shell?  Or from a Bash shell?
>
> Both, and also why you need that in Emacs.
>
>> I need the Cygwin executables them all the time in my Bash sessions.
>
> You can set up your Bash sessions so that when you are in Bash,
> Cygwin's bin directory is on PATH, but when you are in cmd or Emacs,
> it is not.  There's no necessity to have a single PATH in all your
> sessions.

Those remarks are orthogonal to my problem, but they make sense.

In Emacs, at the end, I would have Cygwin's bin directory in my PATH, only when
Bash would be used as `shell-file-name'.

>> And I need the Cygwin executables from Emacs as well (for the `M-x
>> find-grep-dired' or `M-x rgrep' commands, among others, which I use quite
>> extensively -- `rgrep', at least). And, there, I need them to be before the
>> default Windows executable, because of `find' (which also exist in
>> c:\Windows\system32).
>
> To avoid the problem with 'find', have the directory where the GNU
> 'find' lives appear before c:\Windows\system32 in PATH.  After all,
> chances of you wanting to invoke the Windows 'find' are nil, right?

Right!

> As for grep, there's a native Windows port around, so no need to go
> Cygwin when you use Emacs.

OK. I have to take a lot at that.

>> > As for the v23 vs v24 emacsclient issue, you could have emacsclient23
>> > and emacsclient24 (scripts, aliases, whatever) to DTRT for each one.
>> 
>> Yes, but the question arises from the fact that `sendpatch' has no way to
>> detect (does it?) which Emacs server version is currently running, so which
>> `emacsclient' it has to call.
>
> I presume that you already have some arrangements to work with 2 Emacs
> versions, so that it should be easy to put something in the
> environment in each case, such that 'sendpatch' could look at that and
> decide.

FYI, I've tried running the Emacs-W32 version present in Cygwin. The look and
feel is absolutely the same as the native Windows binary. That's great.

Though, some things don't work anymore (such as "fancy splitting" in Gnus). I
have no idea why at this stage. I'll need a couple of hours to try and
understand what's going on -- though, right now, I'm back using the native
Windows application made available by Dani.

Best regards,
  Seb

-- 
Sebastien Vauban


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-11-07 15:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-23  8:33 Problem quoting expression to be eval'ed by emacsclient Sebastien Vauban
2013-10-23  8:52 ` Thorsten Jolitz
2013-10-23 14:07   ` Tassilo Horn
2013-10-23 15:33   ` Eli Zaretskii
     [not found]   ` <mailman.4544.1382542407.10748.help-gnu-emacs@gnu.org>
2013-10-23 21:56     ` Sebastien Vauban
2013-10-24  2:52       ` Eli Zaretskii
     [not found]       ` <mailman.4580.1382583151.10748.help-gnu-emacs@gnu.org>
2013-10-25 12:37         ` Sebastien Vauban
2013-10-25 13:47           ` Eli Zaretskii
     [not found]           ` <mailman.4697.1382708854.10748.help-gnu-emacs@gnu.org>
2013-10-30  9:59             ` Sebastien Vauban
2013-10-30 11:38               ` Stefan Monnier
2013-10-30 18:55               ` Eli Zaretskii
     [not found]               ` <mailman.4965.1383133220.10748.help-gnu-emacs@gnu.org>
2013-11-07 15:37                 ` Sebastien Vauban
     [not found]               ` <mailman.4986.1383159329.10748.help-gnu-emacs@gnu.org>
2013-11-07 15:44                 ` Sebastien Vauban
2013-10-23 10:14 ` Andreas Röhler

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).