From a63c4a44da8192dbb29ce0e26cb3d58c60945399 Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sun, 13 Jun 2021 09:29:59 -0700 Subject: Disabling frame suspending --- smart-documents.org | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/smart-documents.org b/smart-documents.org index d6c4a77..5e63bd4 100644 --- a/smart-documents.org +++ b/smart-documents.org @@ -377,12 +377,22 @@ The following bindings lead to more natural window & frame exit behaviors. (global-set-key (kbd "C-q") 'sd-delete-frame-or-kill-emacs) #+END_SRC -*** Disable =C-z= if using a graphical interface +*** Remap =C-z= when using a graphical interface -#+BEGIN_SRC emacs-lisp :tangle yes -(global-unset-key (kbd "C-z")) +By default, =C-z= suspends the editor. This is extremely handy when +the editor is started with the =-nw= option (no window, i.e. launched +in a terminal), because it returns control to the terminal command +line without quitting Emacs---it simply places the Emacs process in +the background. The user may then use the Linux job management tools +to return inside the Emacs process. + +However, when using a graphical display, we have no need for +suspending the frame, so we remap =C-z= to the much more sensible +~undo~ behaviour. -(global-set-key (kbd "C-z C-z") 'suspend-frame) +#+BEGIN_SRC emacs-lisp :tangle yes + (when (display-graphic-p) + (global-set-key (kbd "C-z") 'undo)) #+END_SRC ** Text display -- cgit v1.2.3