Last active
October 13, 2015 04:57
-
-
Save Altech/4142388 to your computer and use it in GitHub Desktop.
The way to `cache` the application Cocoa Emacs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(global-set-key (kbd "C-x C-c") 'close-on-mac) | |
(require 'cl) | |
(defun close-buffers-without-default () | |
(interactive) | |
(loop for buffer being the buffers | |
do ((lambda (buffer) | |
(if (and (not (string= (buffer-name buffer) "*GNU Emacs*")) | |
(not (string= (buffer-name buffer) "*scratch*")) | |
(not (string= (buffer-name buffer) "*Messages*"))) | |
(kill-buffer buffer))) buffer))) | |
(defun close-on-mac () | |
(interactive) | |
(close-buffers-without-default) | |
(switch-to-buffer "*GNU Emacs*") | |
(delete-other-windows) | |
(delete-other-frames) | |
(beginning-of-buffer) | |
(ns-do-hide-emacs)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment