Emacs 23 on OS X - use multiple instances or emacsclient?

I wonder if anyone has any recommendations on setting up emacs 23 on OS X. I have been using Linux / Windows for a while, and there, I would just open many instances of emacs and they were standalone - for example, I could have two separate files in separate frames, each with its own R, Python and / or shell. I think this is disapproving (?) - but he kept the working directory for each script file separately, which I liked.

I understand that there is some advantage in configuring (server-start) in my .emacs file, and calling emacsclient instead of emacs is now the preferred way (?). I found this thread that facilitates this through Applescript: Emacs 23, OS X, multi-tty and emacsclient

But I wonder if this is the only way around this - when I open two instances of emacs on OS X, it gives me an error:

** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x3803, name = 'org.gnu.Emacs.ServiceProvider'

but it opens a new frame that allows you to edit files. I understand that for vim on OS X there is something called "mvim" that allows you to run multiple instances of vim, but is there something similar for emacs? Sorry for the old question - in general, I think these are the questions for which I would like to request your experience:

(1) Is "emacsclient" an expert method and (2) if not necessary, is there a way to get multiple instances of emacs 23 (and not just frames) running on OS X?

Thanks! -Stephen

+5
source share
6 answers

.

, emacsclient , Emacs Emacs. "" ? . Emacs, emacsclient. ? Emacs . , , Emacs ( screen ), Emacs .. emacsclient .

, Emacsen, , . . Emacs, , , // .

, Emacs, , , .

, , (server-start) .emacs - , Emacsen . , , .emacs , --daemon .

, emacs ( emacs) , ( emacsclient).

+6

, ( ) emacs :

/Applications/Emacs.app/Contents/MacOS/Emacs &

(Generic form for any app) /Path_To_Application.app/Contents/MacOS/Application &
+7

script, , Emacs :

#!/bin/bash

/Applications/Emacs.app/Contents/MacOS/Emacs \
    --eval '(select-frame-set-input-focus (nth 0 (frame-list)))' \
    "$@"

:

  • script emacs emacs Linux, .
  • , , '(nth 0 (frame-list))' , script .
  • '(server-start)' .emacs.
+4

- .emacs, , :

(if (file-exists-p
 (concat (getenv "TMPDIR") "emacs"
         (number-to-string
          (user-real-uid)) "/server"))
nil (server-start))

.zshrc, ec :

# I use the Emacs package from emacsformacosx.com
alias emacs='open -a emacs'
alias emacsclient='/Applications/Emacs.app/Contents/MacOS/bin/emacsclient'
alias ec='emacsclient -a /Applications/Emacs.app/Contents/MacOS/Emacs'
export EDITOR='ec'
+1

script, emacs.

, emacs-ide script /usr/local/bin/ $PATH.

You can run multiple instances of Emacs with multiple files or directories:

emacs-ide ~/Projects/project-1
emacs-ide ~/Projects/project-2

The script also sets the window name according to the directory (project) or edited file.

+1
source

Using

open -a -n /Applications/Emacs.app

failed for me with a pop-up window "Emacs quits unexpectedly". (OS X Yosemite 10.10.3, Emacs 24.3.1 x86_64-apple-darwin)

As a workaround, I installed Aquamacs as well as Emacs, so at least I can have two copies.

0
source

All Articles