diff options
Diffstat (limited to '.config/emacs/modules/mm-darwin.el')
-rw-r--r-- | .config/emacs/modules/mm-darwin.el | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/.config/emacs/modules/mm-darwin.el b/.config/emacs/modules/mm-darwin.el new file mode 100644 index 0000000..79df610 --- /dev/null +++ b/.config/emacs/modules/mm-darwin.el @@ -0,0 +1,22 @@ +;;; mm-darwin.el --- MacOS Configuration -*- lexical-binding: t; -*- + +(unless (featurep 'ns) + (error "'NS not available. Something has gone horribly wrong.")) + + +;;; Launch Emacs Properly + +(defun mm-ns-raise-emacs () + (ns-do-applescript "tell application \"Emacs\" to activate")) + +(add-hook + 'after-make-frame-functions + (defun mm-ns-raise-emacs-with-frame (frame) + (when (display-graphic-p) + (with-selected-frame frame + (mm-ns-raise-emacs))))) + +(when (display-graphic-p) + (mm-ns-raise-emacs)) + +(provide 'mm-darwin) |