all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Emacs, Mac OS X and opening from Shell
@ 2015-09-25 14:47 Alberto Simões
  2015-09-25 17:33 ` Eli Zaretskii
  2015-09-25 18:42 ` Chunyang Xu
  0 siblings, 2 replies; 8+ messages in thread
From: Alberto Simões @ 2015-09-25 14:47 UTC (permalink / raw)
  To: help-gnu-emacs

Dear Emacs users,

I've been an Emacs user for some decades, but never a really emacs hacker.
In the latest months I've been using Sublime for Mac, but I am missing
emacs a lot.

So, in the come back, I am trying to make the emacs command to open an
emacs window, if one is open, or opening a new buffer in the current window
(and focus that buffer if possible).

Currently, my emacs command line is a shell script that looks like this:

   /Applications/Emacs.app/Contents/MacOS/Emacs "$@" &

This, of course, open a new window (although I usually close it, as the
buffers are shared among windows).

Any idea how I can make it behave as I described earlier?

Thank you,
Alberto

-- 
Alberto Simões


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Emacs, Mac OS X and opening from Shell
  2015-09-25 14:47 Emacs, Mac OS X and opening from Shell Alberto Simões
@ 2015-09-25 17:33 ` Eli Zaretskii
  2015-09-25 17:38   ` Alberto Simões
  2015-09-25 18:42 ` Chunyang Xu
  1 sibling, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2015-09-25 17:33 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Fri, 25 Sep 2015 15:47:35 +0100
> From: Alberto Simões <hashashin@gmail.com>
> 
> So, in the come back, I am trying to make the emacs command to open an
> emacs window, if one is open, or opening a new buffer in the current window
> (and focus that buffer if possible).
> 
> Currently, my emacs command line is a shell script that looks like this:
> 
>    /Applications/Emacs.app/Contents/MacOS/Emacs "$@" &
> 
> This, of course, open a new window (although I usually close it, as the
> buffers are shared among windows).
> 
> Any idea how I can make it behave as I described earlier?

Make it invoke emacsclient instead.




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Emacs, Mac OS X and opening from Shell
  2015-09-25 17:33 ` Eli Zaretskii
@ 2015-09-25 17:38   ` Alberto Simões
  2015-09-25 18:31     ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Alberto Simões @ 2015-09-25 17:38 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

On Fri, Sep 25, 2015 at 6:33 PM, Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Fri, 25 Sep 2015 15:47:35 +0100
> > From: Alberto Simões <hashashin@gmail.com>
> >
> > So, in the come back, I am trying to make the emacs command to open an
> > emacs window, if one is open, or opening a new buffer in the current
> window
> > (and focus that buffer if possible).
> >
> > Currently, my emacs command line is a shell script that looks like this:
> >
> >    /Applications/Emacs.app/Contents/MacOS/Emacs "$@" &
> >
> > This, of course, open a new window (although I usually close it, as the
> > buffers are shared among windows).
> >
> > Any idea how I can make it behave as I described earlier?
>
> Make it invoke emacsclient instead.
>
>
>
It seems it opens another window as well :-(

Thanks

-- 
Alberto Simões


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Emacs, Mac OS X and opening from Shell
  2015-09-25 17:38   ` Alberto Simões
@ 2015-09-25 18:31     ` Eli Zaretskii
  2015-09-25 18:41       ` Alberto Simões
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2015-09-25 18:31 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Fri, 25 Sep 2015 18:38:39 +0100
> From: Alberto Simões <hashashin@gmail.com>
> Cc: help-gnu-emacs@gnu.org
> 
>     > Any idea how I can make it behave as I described earlier?
>     
>     Make it invoke emacsclient instead.
> 
> It seems it opens another window as well :-(

No, it doesn't, at least not by default.  Did you read its
documentation?




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Emacs, Mac OS X and opening from Shell
  2015-09-25 18:31     ` Eli Zaretskii
@ 2015-09-25 18:41       ` Alberto Simões
  2015-09-28 11:32         ` Alan Schmitt
  0 siblings, 1 reply; 8+ messages in thread
From: Alberto Simões @ 2015-09-25 18:41 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs

On Fri, Sep 25, 2015 at 7:31 PM, Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Fri, 25 Sep 2015 18:38:39 +0100
> > From: Alberto Simões <hashashin@gmail.com>
> > Cc: help-gnu-emacs@gnu.org
> >
> >     > Any idea how I can make it behave as I described earlier?
> >
> >     Make it invoke emacsclient instead.
> >
> > It seems it opens another window as well :-(
>
> No, it doesn't, at least not by default.  Did you read its
> documentation?


Well, as far as I understood, by default it should open in the same frame.
But it doesn't.
I tried adding the -c, that creates a new frame as promised (so, giving no
real difference).
I also tried -nw, but same behavior.

So, it seems to be a misbehavior of the MacOS Version (using this version -
http://emacsformacosx.com/)
Or I am really doing something wrong... that is *really* a possibility >:-)

Thanks,
Alberto

-- 
Alberto Simões


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Emacs, Mac OS X and opening from Shell
  2015-09-25 14:47 Emacs, Mac OS X and opening from Shell Alberto Simões
  2015-09-25 17:33 ` Eli Zaretskii
@ 2015-09-25 18:42 ` Chunyang Xu
  2015-09-25 18:44   ` Alberto Simões
  1 sibling, 1 reply; 8+ messages in thread
From: Chunyang Xu @ 2015-09-25 18:42 UTC (permalink / raw)
  To: Alberto Simões; +Cc: help-gnu-emacs


Alberto Simões writes:

> Dear Emacs users,
>
> I've been an Emacs user for some decades, but never a really emacs hacker.
> In the latest months I've been using Sublime for Mac, but I am missing
> emacs a lot.
>
> So, in the come back, I am trying to make the emacs command to open an
> emacs window, if one is open, or opening a new buffer in the current window
> (and focus that buffer if possible).

open(1) works for me, for example,

    $ open -a Emacs ~/.emacs.d/init.el

if *.el has been set Emacs as its default opening App, you can also omit '-a Emacs':

    $ open ~/.emacs.d/init.el

It should work out-of-box, i.e., no configuration needed from the Emacs
side, the following should works for you:

    # Start a fresh Emacs
    $ open -a /Applications/Emacs.app -n --args -Q
    # Open a file
    $ open -a /Applications/Emacs.app ~/.emacs.d/init.el


BTW, emacsclient(1) works as well. After 'M-x server-start' from a GUI
Emacs window:

    $ emacsclient --no-wait ~/.emacs.d/init.el

> Currently, my emacs command line is a shell script that looks like this:
>
>    /Applications/Emacs.app/Contents/MacOS/Emacs "$@" &
>
> This, of course, open a new window (although I usually close it, as the
> buffers are shared among windows).
>
> Any idea how I can make it behave as I described earlier?
>
> Thank you,
> Alberto

-- 
Chunyang Xu



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Emacs, Mac OS X and opening from Shell
  2015-09-25 18:42 ` Chunyang Xu
@ 2015-09-25 18:44   ` Alberto Simões
  0 siblings, 0 replies; 8+ messages in thread
From: Alberto Simões @ 2015-09-25 18:44 UTC (permalink / raw)
  To: Chunyang Xu; +Cc: help-gnu-emacs

Hi all,

Sorry for posting at the top, but I think this is the correct place for
this:

as far as i can tell, the sh script I think is being executed, is not.
So, sorry, as I wasn't really testing emacsclient :-(

Best,
Alberto

On Fri, Sep 25, 2015 at 7:42 PM, Chunyang Xu <xuchunyang56@gmail.com> wrote:

>
> Alberto Simões writes:
>
> > Dear Emacs users,
> >
> > I've been an Emacs user for some decades, but never a really emacs
> hacker.
> > In the latest months I've been using Sublime for Mac, but I am missing
> > emacs a lot.
> >
> > So, in the come back, I am trying to make the emacs command to open an
> > emacs window, if one is open, or opening a new buffer in the current
> window
> > (and focus that buffer if possible).
>
> open(1) works for me, for example,
>
>     $ open -a Emacs ~/.emacs.d/init.el
>
> if *.el has been set Emacs as its default opening App, you can also omit
> '-a Emacs':
>
>     $ open ~/.emacs.d/init.el
>
> It should work out-of-box, i.e., no configuration needed from the Emacs
> side, the following should works for you:
>
>     # Start a fresh Emacs
>     $ open -a /Applications/Emacs.app -n --args -Q
>     # Open a file
>     $ open -a /Applications/Emacs.app ~/.emacs.d/init.el
>
>
> BTW, emacsclient(1) works as well. After 'M-x server-start' from a GUI
> Emacs window:
>
>     $ emacsclient --no-wait ~/.emacs.d/init.el
>
> > Currently, my emacs command line is a shell script that looks like this:
> >
> >    /Applications/Emacs.app/Contents/MacOS/Emacs "$@" &
> >
> > This, of course, open a new window (although I usually close it, as the
> > buffers are shared among windows).
> >
> > Any idea how I can make it behave as I described earlier?
> >
> > Thank you,
> > Alberto
>
> --
> Chunyang Xu
>



-- 
Alberto Simões


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Emacs, Mac OS X and opening from Shell
  2015-09-25 18:41       ` Alberto Simões
@ 2015-09-28 11:32         ` Alan Schmitt
  0 siblings, 0 replies; 8+ messages in thread
From: Alan Schmitt @ 2015-09-28 11:32 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 615 bytes --]

On 2015-09-25 20:41, Alberto Simões <hashashin@gmail.com> writes:

> So, it seems to be a misbehavior of the MacOS Version (using this version -
> http://emacsformacosx.com/)
> Or I am really doing something wrong... that is *really* a possibility >:-)

I’m using this emacs for OS
X (https://github.com/railwaycat/homebrew-emacsmacport) and
"emacsclient -n" does what I expect.

By the way, make sure the emacsclient you call is not the one from the
system (in /usr/bin).

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Athmospheric CO₂ (Updated September 27, 2015, Mauna Loa Obs.): 397.23 ppm

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-09-28 11:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-25 14:47 Emacs, Mac OS X and opening from Shell Alberto Simões
2015-09-25 17:33 ` Eli Zaretskii
2015-09-25 17:38   ` Alberto Simões
2015-09-25 18:31     ` Eli Zaretskii
2015-09-25 18:41       ` Alberto Simões
2015-09-28 11:32         ` Alan Schmitt
2015-09-25 18:42 ` Chunyang Xu
2015-09-25 18:44   ` Alberto Simões

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.