(1) Yes, that's true. That's a limitation of emacs, not the open command. Do `emacs --help` (2) Please do reply-all instead of just replying to me, so more people have an opportunity to answer you. (3) None of this is related to curly braces in ruby-mode, i.e. the topic of this thread. Let's stay on topic. -Steven On Fri, Apr 5, 2013 at 10:12 PM, Andrew Pennebaker < andrew.pennebaker@gmail.com> 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. > > > On Fri, Apr 5, 2013 at 10:57 PM, Andrew Pennebaker < > andrew.pennebaker@gmail.com> wrote: > >> I'd like an emacs.sh script that I could pass command line arguments to. >> I wouldn't want to manually type "open -a emacs" each time. >> >> This almost completely does the job: >> >> open -a emacs $1 --args ${2+"$@"} >> >> But it only supplies files for Emacs to load. It doesn't support command >> line arguments like -Q or -nw. >> >> >> On Fri, Apr 5, 2013 at 9:45 PM, Steven Degutis wrote: >> >>> No, `open` works fine for this. Look again at the man page. It doesn't >>> expect a binary like you were passing it (Contents/MacOS/Emacs). Instead >>> you just pass it the name of an app bundle. The command I sent to you in >>> the last email works perfectly. >>> >>> -Steven >>> >>> >>> On Fri, Apr 5, 2013 at 8:42 PM, Andrew Pennebaker < >>> andrew.pennebaker@gmail.com> wrote: >>> >>>> Thank you. >>>> >>>> I did use the man page, and I did try --args, but open complained. >>>> Could you suggest a better shell script? >>>> On Apr 5, 2013 9:07 PM, "Steven Degutis" wrote: >>>> >>>>> First of all I highly recommend installing Cocoa Emacs from homebrew. >>>>> Look here for how to install it properly: >>>>> https://github.com/sdegutis/using-emacs#installing-emacs-properly >>>>> >>>>> Secondly, you pass args to open via --args (look at `man open`). So it >>>>> would be `open -a emacs --args -Q` if you want to launch Cocoa Emacs with -Q >>>>> >>>>> -Steven >>>>> >>>>> >>>>> On Fri, Apr 5, 2013 at 7:43 PM, Andrew Pennebaker < >>>>> andrew.pennebaker@gmail.com> wrote: >>>>> >>>>>> Good idea! >>>>>> >>>>>> Unfortunately I haven't been able to emacs -Q in Mac due to my poor >>>>>> setup. I can't even pass the option! >>>>>> >>>>>> Could someone suggest a better way to do this? >>>>>> >>>>>> $ which emacs >>>>>> /usr/bin/emacs >>>>>> >>>>>> $ cat `which emacs` >>>>>> #!/bin/sh >>>>>> open -a /Applications/Emacs.app/Contents/MacOS/Emacs "$@" >>>>>> >>>>>> My goal is to be able to launch "emacs " from Terminal.app, >>>>>> such that Emacs doesn't steal control over the terminal while it runs. >>>>>> Ordinarly, one would use "emacs &", but I like to close the >>>>>> terminal, and I don't want Emacs to die with it. So I use "open -a..." >>>>>> >>>>>> The problem with this arrangement is that this doesn't allow command >>>>>> line options to be sent to Emacs. "open" provides --args, but I haven't >>>>>> been able to use it properly. >>>>>> >>>>>> >>>>>> On Fri, Apr 5, 2013 at 7:52 PM, Bob Proulx wrote: >>>>>> >>>>>>> Andrew Pennebaker wrote: >>>>>>> > Ruby uses the syntax "... #{expression}..." for string >>>>>>> interpolation. But >>>>>>> > when I press left curly brace, Emacs says "Symbol's value as >>>>>>> variable is >>>>>>> > void: last-command-char". >>>>>>> >>>>>>> This works fine for me in emacs 24.2.1. And with 23.4.1 too. What >>>>>>> version are you using? >>>>>>> >>>>>>> > I C-h k {, and saw that { and } are bound to ruby-electric-brace. >>>>>>> >>>>>>> Same here. >>>>>>> >>>>>>> > This function appears to be malfunctioning. >>>>>>> >>>>>>> You didn't say so the obligatory response is, "Have you tried it >>>>>>> with -Q?" >>>>>>> >>>>>>> emacs -Q >>>>>>> >>>>>>> Works for me. >>>>>>> >>>>>>> Bob >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Cheers, >>>>>> >>>>>> Andrew Pennebaker >>>>>> www.yellosoft.us >>>>>> >>>>> >>>>> >>> >> >> >> -- >> Cheers, >> >> Andrew Pennebaker >> www.yellosoft.us >> > > > > -- > Cheers, > > Andrew Pennebaker > www.yellosoft.us >