all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: Harry Putnam <reader@newsguy.com>, help-gnu-emacs@gnu.org
Subject: Re: Concerning emacsclient cmdline
Date: Sun, 08 Feb 2015 17:26:32 +0000	[thread overview]
Message-ID: <CAArVCkRPLUVPMFA49hr63yKaE3-z-iacCV8+Y9ip-xqHBqOw3Q@mail.gmail.com> (raw)
In-Reply-To: 87a90omjy3.fsf@reader.local.lan

Yes, --eval causes all arguments to be interpreted as Lisp expressions. The
following script should work (note that some contraptions are required to
let it deal with all kinds of filenames):

#!/bin/bash

set -o errexit -o nounset -o pipefail

declare -a args=()

for file
do
  # Use base64 encoding to deal with Lisp syntax in file names.
  # No herestring because that appends a newline.
  # No echo to deal with file names starting with dashes.
  encoded="$(printf '%s' "${file}" | base64)"
  args+=("(find-file (base64-decode-string \"${encoded}\"))")
done

emacsclient --eval '(load "/home/harry/.emacs-dir/client2SomeServer.el" t)'
"${args[@]}"


Harry Putnam <reader@newsguy.com> schrieb am Sun Feb 08 2015 at 17:45:24:

> Running SonOS (Openindiana, a solaris offshoot)
>
>   GNU Emacs 24.3.1 (i386-pc-solaris2.10, X toolkit, Xaw scroll bars)
>   of 2013-08-03 on unstable10x
>
> I've been dinking around with a script that calls emacsclient and
> having a problem figuring out the proper cmdline syntax.
>
> There are several things being checked and several different calls to
> emcaslient depending on other variables.
>
> Where my problem comes is trying to open a file and --eval an expression
> in the same command.
>
> the script name is `emcl' the cmdline:  `./emcl ./it'
>
> And the cmdline that gets run inside the script:
>  emacsclient -c -a "" --eval '(load-file "/home/harry/.emacs-dir/client2SomeServer.el")'
> $@
>
> When called it breaks with:
>  *ERROR*: Symbol's value as variable is void: \./it
>
> I've tried removeing "$@" and it opens without error but with no
> filename 'it'  opened.
>
> So I tried putting "$@" between "" and  `--eval'
> The error is the same.
>
>    *ERROR*: Symbol's value as variable is void: \./it
>
> Can anyone say what is wrong here?
>
> Perhaps the file call has to be an --eval too.  If so, how would that
> be done?
>
>
>


  reply	other threads:[~2015-02-08 17:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-08 16:44 Concerning emacsclient cmdline Harry Putnam
2015-02-08 17:26 ` Philipp Stephani [this message]
2015-02-09  2:03   ` Harry Putnam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAArVCkRPLUVPMFA49hr63yKaE3-z-iacCV8+Y9ip-xqHBqOw3Q@mail.gmail.com \
    --to=p.stephani2@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=reader@newsguy.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.