From 31379209f5a1f044f6b3183de9c8432a444ecc16 Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Tue, 18 Jan 2022 07:26:09 +0100 Subject: [PATCH] Move key bindings section upwards --- README.org | 64 ++++++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/README.org b/README.org index b9bdb95..0b1f49a 100644 --- a/README.org +++ b/README.org @@ -324,6 +324,34 @@ a path in my home directory to the places where =info= looks for files. (expand-file-name "~/.local/share/info"))) #+end_src +* [[info:emacs#Key Bindings][Key bindings (info)]] +:PROPERTIES: +:CUSTOM_ID: sec:key-bindings +:END: +** [[info:emacs#Disabling][Disabling Commands (info)]] +:PROPERTIES: +:CUSTOM_ID: sec:enable-disabled-commands +:END: + +Execute src_emacs-lisp{(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 + (setq disabled-command-function + (defun my-enable-this-command (&rest _args) + "Called when a disabled command is executed. + Enable it and re-execute it." + (put this-command 'disabled nil) + (message "You typed %s. %s was disabled until now." + (key-description (this-command-keys)) this-command) + (sit-for 0) + (call-interactively this-command))) +#+end_src + * [[info:emacs#Emacs Server][Using Emacs as a server (info)]] :PROPERTIES: :CUSTOM_ID: sec:using-emacs-server @@ -2054,34 +2082,6 @@ instance [[https://numpy.org/][numpy]] and [[https://scipy.org/][scipy]]. *** TODO Look into: editing facilities 1. [[https://github.com/douglasdavis/numpydoc.el/blob/main/numpydoc.el][Emacs extension to insert numpy style docstrings in function definitions]] -* [[info:emacs#Key Bindings][Key Bindings (info)]] -:PROPERTIES: -:CUSTOM_ID: sec:key-bindings -:END: -** [[info:emacs#Disabling][Disabling Commands (info)]] -:PROPERTIES: -:CUSTOM_ID: sec:enable-disabled-commands -:END: - -Execute src_emacs-lisp{(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 - (setq disabled-command-function - (defun my-enable-this-command (&rest _args) - "Called when a disabled command is executed. - Enable it and re-execute it." - (put this-command 'disabled nil) - (message "You typed %s. %s was disabled until now." - (key-description (this-command-keys)) this-command) - (sit-for 0) - (call-interactively this-command))) -#+end_src - * [[info:emacs#Minor Modes][Minor Modes (info)]] :PROPERTIES: :CUSTOM_ID: sec:minor-modes @@ -2233,9 +2233,6 @@ code formatter for Python]]. :CUSTOM_ID: sec:display :END: -This setup does not configure [[info:emacs#Custom Themes][custom themes (info)]] in order to prevent endless -useless tweaking. - ** [[info:emacs#Narrowing][Narrowing]] :PROPERTIES: :CUSTOM_ID: sec:narrowing @@ -2292,8 +2289,9 @@ on tables by means of =org-narrow-to-table=. :CUSTOM_ID: sec:text-faces-or-styles :END: -See the [[https://protesilaos.com/codelog/2020-09-05-emacs-note-mixed-font-heights/][note on mixed font heights in Emacs]] for how to setup fonts properly. It -boils down to two rules: +This setup does not configure [[info:emacs#Custom Themes][custom themes (info)]] in order to prevent endless +useless tweaking. See the [[https://protesilaos.com/codelog/2020-09-05-emacs-note-mixed-font-heights/][note on mixed font heights in Emacs]] for how to setup +fonts properly. It boils down to two rules: 1. The height of the default face must be an integer number to make the height a physical quantity. 2. The heights of all other faces must be real numbers to scale those heights