unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* How do I do _THIS_ with emacsclient?
@ 2007-07-29 17:53 David Kastrup
  2007-07-29 19:53 ` Ehud Karni
  0 siblings, 1 reply; 4+ messages in thread
From: David Kastrup @ 2007-07-29 17:53 UTC (permalink / raw)
  To: emacs-devel


Hi, I have the following problem: I try using something like
${EDITOR} --eval "(ediff-files (pop command-line-args-left) \
  (pop command-line-args-left))" "file1" "file2"

and when ${EDITOR} is equal to emacsclient, this fails pretty badly:
command-line-args-left is nil, and Emacs tried to execute file1 and
file2, leading to undefined variable complaints.

This behavior clearly is dissatisfactory.  Any idea what I could write
to have this more or less work with emacsclient without breaking when
using Emacs?

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: How do I do _THIS_ with emacsclient?
  2007-07-29 17:53 How do I do _THIS_ with emacsclient? David Kastrup
@ 2007-07-29 19:53 ` Ehud Karni
  2007-07-29 19:56   ` David Kastrup
  0 siblings, 1 reply; 4+ messages in thread
From: Ehud Karni @ 2007-07-29 19:53 UTC (permalink / raw)
  To: dak; +Cc: emacs-devel

On Sun, 29 Jul 2007 19:53:05, David Kastrup wrote:
>
>
> Hi, I have the following problem: I try using something like
> ${EDITOR} --eval "(ediff-files (pop command-line-args-left) \
>   (pop command-line-args-left))" "file1" "file2"
>
> and when ${EDITOR} is equal to emacsclient, this fails pretty badly:
> command-line-args-left is nil, and Emacs tried to execute file1 and
> file2, leading to undefined variable complaints.

I don't know what to do about the argmunents not available with
`command-line-args-left' but why not use a simpler command like:
    ${EDITOR} --eval '(ediff-files "file1" "file2")'

Ehud.


--
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 GnuPG: 98EA398D <http://www.keyserver.net/>    Better Safe Than Sorry

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

* Re: How do I do _THIS_ with emacsclient?
  2007-07-29 19:53 ` Ehud Karni
@ 2007-07-29 19:56   ` David Kastrup
  2007-07-29 20:10     ` Ehud Karni
  0 siblings, 1 reply; 4+ messages in thread
From: David Kastrup @ 2007-07-29 19:56 UTC (permalink / raw)
  To: ehud; +Cc: emacs-devel

"Ehud Karni" <ehud@unix.mvs.co.il> writes:

> On Sun, 29 Jul 2007 19:53:05, David Kastrup wrote:
>>
>>
>> Hi, I have the following problem: I try using something like
>> ${EDITOR} --eval "(ediff-files (pop command-line-args-left) \
>>   (pop command-line-args-left))" "file1" "file2"
>>
>> and when ${EDITOR} is equal to emacsclient, this fails pretty badly:
>> command-line-args-left is nil, and Emacs tried to execute file1 and
>> file2, leading to undefined variable complaints.
>
> I don't know what to do about the argmunents not available with
> `command-line-args-left' but why not use a simpler command like:
>     ${EDITOR} --eval '(ediff-files "file1" "file2")'

Because file1 and file2 may not be properly quoted for use in Lisp
strings.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: How do I do _THIS_ with emacsclient?
  2007-07-29 19:56   ` David Kastrup
@ 2007-07-29 20:10     ` Ehud Karni
  0 siblings, 0 replies; 4+ messages in thread
From: Ehud Karni @ 2007-07-29 20:10 UTC (permalink / raw)
  To: dak; +Cc: emacs-devel

On Sun, 29 Jul 2007 21:56:27, David Kastrup wrote:
>
> "Ehud Karni" <ehud@unix.mvs.co.il> writes:
>
> > On Sun, 29 Jul 2007 19:53:05, David Kastrup wrote:
> >>
> >>
> >> Hi, I have the following problem: I try using something like
> >> ${EDITOR} --eval "(ediff-files (pop command-line-args-left) \
> >>   (pop command-line-args-left))" "file1" "file2"
> >>
> >> and when ${EDITOR} is equal to emacsclient, this fails pretty badly:
> >> command-line-args-left is nil, and Emacs tried to execute file1 and
> >> file2, leading to undefined variable complaints.
> >
> > I don't know what to do about the arguments not available with
> > `command-line-args-left' but why not use a simpler command like:
> >     ${EDITOR} --eval '(ediff-files "file1" "file2")'
>
> Because file1 and file2 may not be properly quoted for use in Lisp
> strings.

Is it a real problem or a principal one ?
For real life you can always do:
    ln -s "file1" /tmp/file1_$$
    ln -s "file2" /tmp/file2_$$
    ${EDITOR} --eval '(ediff-files "'/tmp/file1_$$'" "'/tmp/file2_$$'")'
    rm -f /tmp/file1_$$ /tmp/file2_$$

Ehud.


--
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 GnuPG: 98EA398D <http://www.keyserver.net/>    Better Safe Than Sorry

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

end of thread, other threads:[~2007-07-29 20:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-29 17:53 How do I do _THIS_ with emacsclient? David Kastrup
2007-07-29 19:53 ` Ehud Karni
2007-07-29 19:56   ` David Kastrup
2007-07-29 20:10     ` Ehud Karni

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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