From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Steven Degutis Newsgroups: gmane.emacs.help Subject: Re: Can't insert curly brace for string interpolation in ruby-mode Date: Fri, 5 Apr 2013 23:39:56 -0500 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=bcaec544ece0a7d8d204d9a9cb39 X-Trace: ger.gmane.org 1365278516 28179 80.91.229.3 (6 Apr 2013 20:01:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Apr 2013 20:01:56 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" , david+emacsformacosx@porkrind.org To: Andrew Pennebaker 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 1UOZIw-0007UX-6I for geh-help-gnu-emacs@m.gmane.org; Sat, 06 Apr 2013 22:01:38 +0200 Original-Received: from localhost ([::1]:50743 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOKvJ-0001hw-66 for geh-help-gnu-emacs@m.gmane.org; Sat, 06 Apr 2013 00:40:17 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOKv2-0001WC-NQ for help-gnu-emacs@gnu.org; Sat, 06 Apr 2013 00:40:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UOKuz-0005JL-BM for help-gnu-emacs@gnu.org; Sat, 06 Apr 2013 00:40:00 -0400 Original-Received: from mail-pd0-f175.google.com ([209.85.192.175]:58286) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOKuz-0005JH-2N for help-gnu-emacs@gnu.org; Sat, 06 Apr 2013 00:39:57 -0400 Original-Received: by mail-pd0-f175.google.com with SMTP id g10so2102636pdj.34 for ; Fri, 05 Apr 2013 21:39:56 -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:cc:content-type; bh=OBPB4P83Z8k4bUuw7cFhASTyG/IMw0ahuPjY8g6+4w4=; b=dwMN3s9s0GCcnGB0WfJYAOR1+q+OWkS2Y0gWUiwAH6dJBDOwB3zn35g/Rc5y3ZosT0 HzZ////D9e+7VaJeWHeVxTvUJany+xK0uiHvS4ydv8jfSx42cWi2BV5cFzMNKvmyY/wE 6QTZD1Gv040i2A0ocA5VN5LUH2SBurnEhJtpIbySgXd7Xh7eg6OJ+ptd/xhs1v+gvjdU OV5mGNqptb5VqU4VkQdzjwBWnQJHf3DaIN6VDFgnAm3aGAlhDlq6DzYauDfsRMo8w0Xf brlAYkZMSlMaGbPbEKgzb6qjr95Z472jpwiVWsHNtM3aTgjr7T+kQrKpRt3oT1VkwYMg b2mg== X-Received: by 10.68.59.8 with SMTP id v8mr14958837pbq.218.1365223196315; Fri, 05 Apr 2013 21:39:56 -0700 (PDT) Original-Received: by 10.70.6.100 with HTTP; Fri, 5 Apr 2013 21:39:56 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.192.175 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:90018 Archived-At: --bcaec544ece0a7d8d204d9a9cb39 Content-Type: text/plain; charset=ISO-8859-1 Your first two paragraphs reminded me of something: http://media.tumblr.com/tumblr_lo3fy1mswH1qanohb.jpg -Steven On Fri, Apr 5, 2013 at 11:32 PM, Andrew Pennebaker < andrew.pennebaker@gmail.com> wrote: > 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 > --bcaec544ece0a7d8d204d9a9cb39 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Your first two paragraphs reminded me of something: http://media.tum= blr.com/tumblr_lo3fy1mswH1qanohb.jpg

-Stev= en


On Fri,= Apr 5, 2013 at 11:32 PM, Andrew Pennebaker <andrew.pennebaker= @gmail.com> wrote:
With help from #macdev, I w= as finally able to write a more sophisticated Emacs shell script. If you do= wnload=A0https://github.com/mcandre/dotfiles/blob/master/emacs.= sh=A0and 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 proper= ly 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 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, Bob 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 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+"$@"}. =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,

Andre= w Pennebaker

--bcaec544ece0a7d8d204d9a9cb39--