From 8282fa547f79230a112da9e4e49c4149d4c31f7f Mon Sep 17 00:00:00 2001 From: Gregory Heytings Date: Fri, 19 Mar 2021 18:51:49 +0000 Subject: [PATCH] * lisp/loadup.el: Change the 'C-o' ('open-line') binding experimentally --- lisp/loadup.el | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/lisp/loadup.el b/lisp/loadup.el index 4a0b8f508c..02808365f0 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -477,6 +477,40 @@ +(define-key global-map "\C-o" #'free-ctl-o) + +(defun free-ctl-o () + (interactive) + (setq prefix-arg current-prefix-arg) + (message "Repeat C-o to insert newlines after point, or type C-h or ? for help") + (let ((map (make-sparse-keymap))) + (define-key map (kbd "C-o") #'open-line) + (define-key map (kbd "C-h") #'free-ctl-o-explain) + (define-key map (kbd "?") #'free-ctl-o-explain) + (set-transient-map map t))) + +(defun free-ctl-o-explain () + (interactive) + (switch-to-buffer "*Change to C-o*") + (let ((inhibit-read-only t)) + (erase-buffer) + (insert "[Type `q' to exit this buffer.]\n\n" + "We've disabled the normal `C-o' binding for a month (until April\n" + "23th, 2021) in the development version of GNU Emacs, while keeping\n" + "the `open-line' command that was bound to `C-o' on repeated `C-o'.\n\n" + "If this change doesn't annoy too many people, the plan is to leave\n" + "the `C-o' key unbound, except when it is repeated, for usage by\n" + "third-party packages.\n\n" + "If you wish to restore the `C-o' binding, you can put the following\n" + "in your .emacs or .emacs.d/init.el file:\n\n" + "(global-set-key (kbd \"C-o\") #'open-line)\n\n" + "If you wish to protest this change, please send you thoughts to the\n" + "emacs-devel@gnu.org mailing list.\n")) + (goto-char (point-min)) + (special-mode)) + + + (if dump-mode (let ((output (cond ((equal dump-mode "pdump") "emacs.pdmp") ((equal dump-mode "dump") "emacs") -- 2.30.1