I'm using Linux, and alternate between emacs and sublime text. In sublime text, Ctrl-Z is undo. This means sometimes I sometimes hit Ctrl-Z in emacs; unfortunately when I do this, the whole process simply freezes. I assume this has to do with the typical Ctrl-Z behavior of suspending a process; however I'm running Emacs in a GUI, so why it would have this behavior is a bit beyond me. Is there any way to change this?
I would suggest the following over simply disabling the binding entirely:
(global-unset-key (kbd "C-z"))
(global-set-key (kbd "C-z C-z") 'my-suspend-frame)
(defun my-suspend-frame ()
"In a GUI environment, do nothing; otherwise `suspend-frame'."
(interactive)
(if (display-graphic-p)
(message "suspend-frame disabled for graphical displays.")
(suspend-frame)))
Or you could just bind the function directly to C-z
, but I find it super-useful to open up that as a prefix binding for other commands -- given how very infrequently I actually need to call suspend-frame
, I find a double C-z C-z
just as convenient.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With