;;; Make it more difficult to kill emacs accidentally
(defun my-kill-emacs ()
"Confirm before 'save-buffers-kill-emacs'."
(interactive)
(if (y-or-n-p "Really kill Emacs? ")
(save-buffers-kill-emacs)
(message "Aborted")
)
)
(global-set-key "\C-x\C-c" 'my-kill-emacs)
Re:Emacs is special regarding UIs
by jimmyvalmer on Thursday September 10, 2020 @11:09AM
(#24433022)
Dude, `M-x custom-set-variable RET confirm-kill-emacs RET TAB`
Or just unbind it, you won't typo `M-x kill-emacs`...
Re:Emacs is special regarding UIs
by fennecfoxen on Tuesday September 15, 2020 @09:21AM
(#24480881)
TBH it actually helps me a little. I seldom lose any work at all, and I have to remember to commit editor config changes somewhere persistent. :P
Run Emacs as a server. You can kill the client accidentally, then just load another client instantly and carry on from where you left off.
Re:Emacs is special regarding UIs
by momentoftop on Thursday September 10, 2020 @06:54PM
(#24437410)
Exactly.
My emacs uptimes (M-x emacs-uptime) are generally the same as my machine's uptime, which is typically months. Emacs is one of the most rock-solid pieces of software I have running.
It's also great for remote. I have emacs daemons running continuously on my remote boxes. To start work on those machines, I log in and start my emacs client. I've never had a need for things like "screen".
Re:Emacs is special regarding UIs
by disgruntledphd2 on Saturday September 12, 2020 @07:06AM
(#24451557)
Does that actually work?
My understanding is that without screen/tmux, the process will die if you disconnect the shell (on a remote box).
Interesting that --daemon works too (I've been running emacs through tmux for years, and never knew that).
Re:Emacs is special regarding UIs
by momentoftop on Sunday September 13, 2020 @08:59AM
(#24460563)
It definitely works, starting emacs with "--daemon".
Also I hit Cx-c by mistake thrice a week.