summaryrefslogtreecommitdiff
path: root/.config/emacs/modules/mm-darwin.el
blob: 90dbedda319f6eeb05f54950da024e6a9de9395c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
;;; mm-darwin.el --- MacOS Configuration  -*- lexical-binding: t; -*-

(unless (featurep 'ns)
  (error "'NS not available.  Something has gone horribly wrong."))

^L
;;; 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))

^L
;;; Set Modifier Keys

(setopt mac-option-key-is-meta  nil
        mac-command-key-is-meta t)
(setopt mac-option-modifier  'none
        mac-command-modifier 'meta)

(provide 'mm-darwin)