optionキーとcommandキーを両方meta キーにする
;; optionキーとcommandキーを,両方meta キーにする (setq ns-command-modifier (quote meta)) (setq ns-alternate-modifier (quote meta))
システムへ修飾キーを渡さない設定
;; システムへ修飾キーを渡さない設定 (setq mac-pass-control-to-system nil) (setq mac-pass-command-to-system nil) (setq mac-pass-option-to-system nil)
辞書と連携する
Macには標準で辞書アプリ(dictionary.app)がついています.
以下の設定をすると,カーソル下の単語に対して, C-c w で辞書が引けます.超便利.
(2012/4/17 typoを修正しました.melitoさん,御指摘感謝します!)
;;; mac で辞書アプリと連携する (defun dictionary () "dictionary.app" (interactive) (let ((editable (not buffer-read-only)) (pt (save-excursion (mouse-set-point last-nonmenu-event))) beg end) (if (and mark-active (<= (region-beginning) pt) (<= pt (region-end)) ) (setq beg (region-beginning) end (region-end)) (save-excursion (goto-char pt) (setq end (progn (forward-word) (point))) (setq beg (progn (backward-word) (point))) )) (start-process "dictionary.app" "*dictionary-region*" "open" (concat "dict:///" (url-hexify-string (buffer-substring-no-properties beg end)))))) (define-key global-map (kbd "C-c w") 'dictionary)