From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Harry Putnam Newsgroups: gmane.emacs.help Subject: Re: Concerning emacsclient cmdline Date: Sun, 08 Feb 2015 21:03:49 -0500 Organization: Still searching... Message-ID: <874mqv3koq.fsf@reader.local.lan> References: <87a90omjy3.fsf@reader.local.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1423447462 28344 80.91.229.3 (9 Feb 2015 02:04:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 9 Feb 2015 02:04:22 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 09 03:04:17 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YKdhv-0000GE-Ht for geh-help-gnu-emacs@m.gmane.org; Mon, 09 Feb 2015 03:04:15 +0100 Original-Received: from localhost ([::1]:58466 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKdhu-0007pB-Qp for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Feb 2015 21:04:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKdhk-0007p6-6o for help-gnu-emacs@gnu.org; Sun, 08 Feb 2015 21:04:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKdhf-0008Ay-7f for help-gnu-emacs@gnu.org; Sun, 08 Feb 2015 21:04:04 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:34088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKdhf-0008Aq-1p for help-gnu-emacs@gnu.org; Sun, 08 Feb 2015 21:03:59 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YKdhc-0000Ao-Qd for help-gnu-emacs@gnu.org; Mon, 09 Feb 2015 03:03:56 +0100 Original-Received: from c-76-97-127-193.hsd1.ga.comcast.net ([76.97.127.193]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 Feb 2015 03:03:56 +0100 Original-Received: from reader by c-76-97-127-193.hsd1.ga.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 09 Feb 2015 03:03:56 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 99 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-76-97-127-193.hsd1.ga.comcast.net User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:hH02NvqYQ3ydjq4On0g8/LFdNpI= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:102585 Archived-At: Philipp Stephani 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=") 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---