Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alias to make emacs open a file in a new buffer (NOT frame) and be activated/come to front?

What I have so far is

alias em="open -a /Applications/Emacs.app "$@" && osascript -e 'tell application "Emacs.app" to activate'"

But I am stumped.

With that code, em file.txt will activate, but won't open the file. And I get '22:23: syntax error: Expected end of line but found unknown token. (-2741)'


Doing

alias em=open -a /Applications/Emacs.app "$@"

Works fine and then it will open the file, but obviously not bring emacs to the front.


And for some strange reason

osascript -e 'tell application "Emacs.app" to activate'

doesn't activate emacs.... I have no idea what is going on.


I am happy to fix this either with alias code, or with .emacs code


edit: see comments for another thing tried.

like image 701
tobeannounced Avatar asked Dec 07 '22 21:12

tobeannounced


1 Answers

Try this:

(setq ns-pop-up-frames nil)

Works fine for me.

Found it here

like image 56
jeff Avatar answered Mar 06 '23 07:03

jeff