From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.help Subject: Re: Concerning emacsclient cmdline Date: Sun, 08 Feb 2015 17:26:32 +0000 Message-ID: References: <87a90omjy3.fsf@reader.local.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1423416413 22353 80.91.229.3 (8 Feb 2015 17:26:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 Feb 2015 17:26:53 +0000 (UTC) To: Harry Putnam , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Feb 08 18:26:48 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 1YKVd8-00083h-5A for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Feb 2015 18:26:46 +0100 Original-Received: from localhost ([::1]:57259 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKVd7-0001AE-Dz for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Feb 2015 12:26:45 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKVcx-00019y-Cg for help-gnu-emacs@gnu.org; Sun, 08 Feb 2015 12:26:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YKVcw-0005jj-7K for help-gnu-emacs@gnu.org; Sun, 08 Feb 2015 12:26:35 -0500 Original-Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:38606) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YKVcv-0005jQ-T6 for help-gnu-emacs@gnu.org; Sun, 08 Feb 2015 12:26:34 -0500 Original-Received: by mail-wi0-f173.google.com with SMTP id em10so5144760wid.0 for ; Sun, 08 Feb 2015 09:26:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:from:date:message-id:subject:to :content-type; bh=vyVqZ9SkU7ri2bjuZyvgZUuwI3ptmqSdsfoCDhMFurM=; b=CRy5KoFiwewQ7bqliLvmMlvhOxoYw7QNP3+HoIQ478F26rtJoYgZyBDPxBUoPe1Ms4 St0Lag/i5YlFvGzGvOpBPvtxsKua5BY6bTtbnCrdrejkPRtx2NtuAcT0ufG/07+5JFJ6 Y2roDd4WE14wrqktmrCVHPZ7QIELRaorV92ZLpuZv7m1fRO3owd4vlWnZNchiflxagKL 6Ped8TVGK+45UByvyuLhALHQU92SFJ0U3N7BFPUfO+RCDsCREAhU5hLjpur7yijyxFpl 6ACiMfsM2LZRGBSxsrorg44x2CsLSnCOL2v9YnjbNqq+UU8m+oZZ4SU9nhz5RDcFIbXq 0ijw== X-Received: by 10.180.76.72 with SMTP id i8mr26994777wiw.22.1423416392426; Sun, 08 Feb 2015 09:26:32 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22d X-Content-Filtered-By: Mailman/MimeDel 2.1.14 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:102580 Archived-At: 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 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? > > >