Skip to content

Instantly share code, notes, and snippets.

@c02y
Last active March 28, 2019 06:14
Show Gist options
  • Save c02y/cadc2a108bc9d09b7a853fe69ffa291d to your computer and use it in GitHub Desktop.
Save c02y/cadc2a108bc9d09b7a853fe69ffa291d to your computer and use it in GitHub Desktop.
alias and emacsclient
(defalias 'eit-list 'benchmark-init/show-durations-tabulated)
;; (setq desktop-save 'ask)
;;desktop-save ask means always ask
;; (desktop-save-mode nil)
(setq confirm-kill-emacs 'y-or-n-p)
(defun ask-before-closing ()
"Prompt for confirmation for emacsclient(not daemon) like confirm-kill-emacs for running Emacs without daemon."
(interactive)
(if (y-or-n-p (format "Really exit Emacs? "))
(save-buffers-kill-terminal)
(message "Canceled frame close!")))
(when (daemonp)
(global-set-key (kbd "C-x C-c") 'ask-before-closing))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment