opfpipe.blogg.se

Launch emacs without gui
Launch emacs without gui






launch emacs without gui launch emacs without gui

Tell application "/Applications/Emacs.app/Contents/MacOS/Emacs" to activate # osascript /absolute/path/to/applescript/file "-e '(progn (dired \"/Applications\") (message \"Hello-World\!\"))'"ĭo shell script "/Applications/Emacs.app/Contents/MacOS/bin/emacsclient " & arg # This script can also be used in the terimal: osascript path-to-script arguments Here is an example applescript: # (server-start) must be inside `init.el` or `.emacs` file. See for additional ideas such as using the -daemon command-line argument instead of placing (server-start) within the user-configuration file.

launch emacs without gui

One idea would be to create an applescript that does whatever the original poster desires, and wrap it up in an application using something like platypus or automator. skhd is far more involved to learn, but ultimately makes it much easier to set up a large number of shell commands with rapid access.įor example, you could make "Ctrl-o" from anywhere in macOS enter a mode you name open_app, from which you could press "e" to open emacsclient, "d" to open emacs -debug-init, "t" to run emacs -adv-timers, "f" to open Firefox, "F" to open a second Firefox profile, etc. This also allows you to set the application to be the default application for certain file types.Īnother way to run the above shell command is with skhd (link).

launch emacs without gui

Automator automates passing this filename in when, eg, you click to open a file with the application we've just made. Here, this allows you to pass a filename to open with emacsclient. The added is where any optional arguments passed to this shell script will be placed. usr/local/bin/emacsclient -n -c -a "" - change "Pass input": use "as arguments" instead of "to stdin". Automator is built in to macOS.Ĭhoose to make an "Application", then choose "Run Shell Script", and add a modified version of the above call to emacsclient: To launch emacsclient from eg the Dock or Spotlight, it's easy to use Automator. Then we can add the appropriate emacsclient flags (see $ man emacsclient for details) to open the GUI: You can find the appropriate path to emacsclient using type in your shell (assuming emacsclient -c works from said shell): $ type emacsclientĮmacsclient is /usr/local/bin/emacsclient








Launch emacs without gui