From: Harry Putnam <reader@newsguy.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Concerning emacsclient cmdline
Date: Sun, 08 Feb 2015 21:03:49 -0500 [thread overview]
Message-ID: <874mqv3koq.fsf@reader.local.lan> (raw)
In-Reply-To: CAArVCkRPLUVPMFA49hr63yKaE3-z-iacCV8+Y9ip-xqHBqOw3Q@mail.gmail.com
Philipp Stephani <p.stephani2@gmail.com> writes:
> 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[@]}"
Thanks for the input.. I guess that script works on your host? What
OS are you on?
Here I get errors:
cat it
data
./emcl it
,----
| t
| ./emcl: line 17: (find-file (base64-decode-string "aXQ=")): command not found
`----
Then I thought perhaps you meant for emacsclient cmd to be all on one
line:
emacsclient --eval '(load "/home/harry/.emacs-dir/client2SomeServer.el" t)' "${args[@]}"
Recieved the same error
I'm running:
SunOS 2x 5.11 oi_151a9 i86pc i386 i86pc (openindiana)
bash 4.0.44(1)-release (i386-pc-solaris2.11)
GNU Emacs 24.3.1 (i386-pc-solaris2.10, X toolkit, Xaw
scroll bars) of 2013-08-03 on unstable10x
My version of bsae64 is from a pkg:
pkg:/file/gnu-coreutils@8.5-0.151.1.9
base64 --version
base64 (GNU coreutils) 8.5
Sorry to say I don't really know what all is supposed to be happening
in the script or maybe I could do more to get it going.
What I did do didn't seem to solve the mystery. I encoded the file `./it' to
`./file' like this:
base64 it >file
file contains ZGF0YQo=
I evaluated `./file' inside emacs like:
A-S-:
eval: (base64-decode-string "ZGF0YQo=") <RET>
Returns:
`data'
So base64 seems to be working ok and emacs is able to decode it.
------- ------- ---=--- ------- -------
I ran your script just as you posted it:
--8<---------------cut here---------------start------------->8---
#!/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[@]}"
--8<---------------cut here---------------end--------------->8---
prev parent reply other threads:[~2015-02-09 2:03 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
2015-02-09 2:03 ` Harry Putnam [this message]
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=874mqv3koq.fsf@reader.local.lan \
--to=reader@newsguy.com \
--cc=help-gnu-emacs@gnu.org \
/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.