From 52f7edb6566e7a498c37050c3add5c3377f1b3d3 Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Wed, 19 Jun 2024 11:12:43 +0200 Subject: [PATCH] Reorganize to keep all key binding related sections together --- README.org | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/README.org b/README.org index e0fc9e3..3feb2a9 100644 --- a/README.org +++ b/README.org @@ -962,6 +962,31 @@ Listing [[lst:setup-shortdoc]] binds {{{kbd(C-h y)}}} to =shortdoc-display-group (keymap-set help-map "y" #'shortdoc-display-group)) #+end_src +** [[info:emacs#Disabling][Disabling Commands (info)]] +:PROPERTIES: +:CUSTOM_ID: sec:enable-disabled-commands +:END: + +Execute src_emacs-lisp[:results none]{(find-library "novice")} to see how Emacs +prevents new users from shooting themselves in the feet. Listing +[[lst:configure-disabled-command-function]] enables [[https://www.emacswiki.org/emacs/DisabledCommands][disabled commands on the fly]]. + +#+caption[Configure the =disabled-command-function=]: +#+caption: Configure the =disabled-command-function=. +#+name: lst:configure-disabled-command-function +#+begin_src emacs-lisp -n :results silent +(with-eval-after-load 'emacs + (setq disabled-command-function + (defun enable-this-command (&rest _args) + "Called when executing a disabled command. +Enable it and re-execute it." + (put this-command 'disabled nil) + (message "You typed %s. Emacs enabled %s." + (key-description (this-command-keys)) this-command) + (sit-for 0) + (call-interactively this-command)))) +#+end_src + ** [[info:info#Top][Info (info)]] :PROPERTIES: :CUSTOM_ID: sec:info @@ -1011,31 +1036,7 @@ looks for files. | backward-sentence | global-map | {{{kbd(M-a)}}} | | forward-sentence | global-map | {{{kbd(M-e)}}} | |--------------------+------------+------------------------| - -** [[info:emacs#Disabling][Disabling Commands (info)]] -:PROPERTIES: -:CUSTOM_ID: sec:enable-disabled-commands -:END: - -Execute src_emacs-lisp[:results none]{(find-library "novice")} to see how Emacs -prevents new users from shooting themselves in the feet. Listing -[[lst:configure-disabled-command-function]] enables [[https://www.emacswiki.org/emacs/DisabledCommands][disabled commands on the fly]]. - -#+caption[Configure the =disabled-command-function=]: -#+caption: Configure the =disabled-command-function=. -#+name: lst:configure-disabled-command-function -#+begin_src emacs-lisp -n :results silent -(with-eval-after-load 'emacs - (setq disabled-command-function - (defun enable-this-command (&rest _args) - "Called when executing a disabled command. -Enable it and re-execute it." - (put this-command 'disabled nil) - (message "You typed %s. Emacs enabled %s." - (key-description (this-command-keys)) this-command) - (sit-for 0) - (call-interactively this-command)))) -#+end_src +|----------------------+------------+------------------------| ** [[https://github.com/michael-heerdegen/interaction-log.el#readme][Interaction-log]] :PROPERTIES: