From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andrew Pennebaker Newsgroups: gmane.emacs.help Subject: Re: Can't insert curly brace for string interpolation in ruby-mode Date: Sat, 6 Apr 2013 00:32:51 -0400 Message-ID: References: <20130405235212.GA12605@hysteria.proulx.com> <20130406032137.GA780@hysteria.proulx.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=14dae9399de35a319704d9a9b29c X-Trace: ger.gmane.org 1365278513 28139 80.91.229.3 (6 Apr 2013 20:01:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Apr 2013 20:01:53 +0000 (UTC) To: "help-gnu-emacs@gnu.org" , david+emacsformacosx@porkrind.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Apr 06 22:01:54 2013 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 1UOZIx-0007UX-1b for geh-help-gnu-emacs@m.gmane.org; Sat, 06 Apr 2013 22:01:39 +0200 Original-Received: from localhost ([::1]:49826 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOKoP-0006ZN-B7 for geh-help-gnu-emacs@m.gmane.org; Sat, 06 Apr 2013 00:33:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOKoA-0006ZC-Rr for help-gnu-emacs@gnu.org; Sat, 06 Apr 2013 00:32:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UOKo8-0002x4-MJ for help-gnu-emacs@gnu.org; Sat, 06 Apr 2013 00:32:54 -0400 Original-Received: from mail-ie0-x22e.google.com ([2607:f8b0:4001:c03::22e]:52531) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOKo8-0002wt-FT for help-gnu-emacs@gnu.org; Sat, 06 Apr 2013 00:32:52 -0400 Original-Received: by mail-ie0-f174.google.com with SMTP id aq17so5133517iec.33 for ; Fri, 05 Apr 2013 21:32:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=h87v5yGTWUPlDYCtSMK1BMRtp+FVtgolRnfe2gkDT6Y=; b=ATV27hlYTu7pltgQrkTZlVh45g5rhTH+2QDR/xW/lfHCyRGMS1y061Y3o0XDI4DRoi JfP8oOW0L1KpA70ZQC0QLmZTw1dZHV0kBjc7rzHRiNzy4d47ZMmy+g2woCI/NlBvFAvj vDqtvzo95GJhkr6jG8FjyFP+a06SB61GB2OFIbKjnYt4ELJRo82H1PrDn+VMVkZ6T6wg L4VRIwfKQ4tRSBUeWjLnco0ewfS2lWwXClfaO8VpEowRxHV5GLXazOb93cPNgAVVeRrH qc2YalhDxugNmv07ltvAj+XdbdRFVpVtoxwDKU+/t/vUbxQzxyIA1Md0VxUltG+NO2Gr o+7g== X-Received: by 10.50.236.100 with SMTP id ut4mr1125936igc.86.1365222771796; Fri, 05 Apr 2013 21:32:51 -0700 (PDT) Original-Received: by 10.42.147.133 with HTTP; Fri, 5 Apr 2013 21:32:51 -0700 (PDT) In-Reply-To: <20130406032137.GA780@hysteria.proulx.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c03::22e 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:90016 Archived-At: --14dae9399de35a319704d9a9b29c Content-Type: text/plain; charset=ISO-8859-1 With help from #macdev, I was finally able to write a more sophisticated Emacs shell script. If you download https://github.com/mcandre/dotfiles/blob/master/emacs.sh and soft link it as /usr/bin/emacs, it allows you to launch emacs from a terminal as a GUI app, or a pure command line ncurses app, by properly responding to the various emacs command line options. I'm fairly demanding of my programs, so I hassled a few communities to help the shell script meet a lot of constraints. The dependencies are Emacs for Mac OS X, bash, and Mac OS X, though conceivably the script could be ported to Aquamacs or Homebrew Emacs. The emacs shell script will work with a file to open, without a file to open, with and without other command line arguments such as -Q, --version, and --help, and files and command line flags can be passed to emacs in arbitrary order (${1+"$@"}). In GUI mode, Emacs will release control from the shell; you can keep entering commands in the terminal that Emacs was launched from without having to background the process with Control+Z. Emacs does not die with the shell, if you happen to close the terminal (nohup). Emacs will open in the foreground, not behind the terminal (osascript). Emacs will not interrupt your terminal experience with stdout messages (> /dev/null). If you do use the -nw flag, emacs will open inside the terminal in curses mode. On Fri, Apr 5, 2013 at 11:21 PM, Bob Proulx wrote: > Steven Degutis wrote: > > Andrew Pennebaker wrote: > > > When I try open -a emacs --args ${1+"$@"}, I have to choose either > open a > > > file, or provide a command line argument. I can't do both. > > > > (1) Yes, that's true. That's a limitation of emacs, not the open command. > > Do `emacs --help` > > You should be able to do 'emacs -Q filename.rb' however. > > I see you using the old idiom ${1+"$@"}. That is fine. That will > work everywhere. But unless you are working on Solaris then that > idiom can be shorted to simply "$@" without checking $1 first. All > modern shells treat "$@" correctly now and it is required by POSIX. > > You have been focusing on trying to get the "open" to work. But you > could just for the experiment try emacs in a terminal window and get > the test done. > > emacs -nw -Q > > Just ignore the who "open" problem for the moment and just test > whether -Q causes your curly brace problem to go away. Because if > it does then you now the problem is in your emacs customization in > your ~/.emacs or wherever you are locating it. > > Bob > -- Cheers, Andrew Pennebaker www.yellosoft.us --14dae9399de35a319704d9a9b29c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
With help from #macdev, I was finally able to write a more= sophisticated Emacs shell script. If you download=A0https://github.com/mcandre/d= otfiles/blob/master/emacs.sh=A0and soft link it as /usr/bin/emacs, it a= llows you to launch emacs from a terminal as a GUI app, or a pure command l= ine ncurses app, by properly responding to the various emacs command line o= ptions.

I'm fairly demanding of my programs, so I hassled a few = communities to help the shell script meet a lot of constraints. The depende= ncies are Emacs for Mac OS X, bash, and Mac OS X, though conceivably the sc= ript could be ported to Aquamacs or Homebrew Emacs.

The emacs shell script will work with a file to open, w= ithout a file to open, with and without other command line arguments such a= s -Q, --version, and --help, and files and command line flags can be passed= to emacs in arbitrary order (${1+"$@"}).

In GUI mode, Emacs will release control from the shell;= you can keep entering commands in the terminal that Emacs was launched fro= m without having to background the process with Control+Z.=A0Emacs does not= die with the shell, if you happen to close the terminal (nohup).

Emacs will open in the foreground, not behind the termi= nal (osascript).

Emacs will not interrupt your ter= minal experience with stdout messages (> /dev/null).

If you do use the -nw flag, emacs will open inside the terminal in cur= ses mode.



On Fri, Apr 5, 2013 at 11:21 PM, Bo= b Proulx <bob@proulx.com> wrote:
Steven Degutis wrote:
> Andrew Pennebaker wrote:
> > When I try open -a emacs --args ${1+"$@"}, I have to ch= oose either open a
> > file, or provide a command line argument. I can't do both. >
> (1) Yes, that's true. That's a limitat= ion of emacs, not the open command.
> Do `emacs --help`

You should be able to do 'emacs -Q filename.rb' however.

I see you using the old idiom ${1+"$@"}. =A0That is fine. =A0That= will
work everywhere. =A0But unless you are working on Solaris then that
idiom can be shorted to simply "$@" without checking $1 first. = =A0All
modern shells treat "$@" correctly now and it is required by POSI= X.

You have been focusing on trying to get the "open" to work. =A0Bu= t you
could just for the experiment try emacs in a terminal window and get
the test done.

=A0 emacs -nw -Q

Just ignore the who "open" problem for the moment and just test whether -Q causes your curly brace problem to go away. =A0Because if
it does then you now the problem is in your emacs customization in
your ~/.emacs or wherever you are locating it.

Bob



--
Cheers,

Andrew Pennebaker
--14dae9399de35a319704d9a9b29c--